Finding the index of a symbol in unsigned char and extracting contents?