   
Tony V
Username: tonyv
Registered: N/A
| | Posted on Sunday, Feb 4, 2007 - 4:55: | |
Hey all, I have binary files that has stuff aligned on four-byte boundaries. A typical example might be something like:
0x80: 07 00 // 16-bit uint String length 0x82: 46 6F 6F 62 61 72 21 // ASCII text 0x89: 00 00 00 // Padding to align on 4-byte boundary 0x8C: 00 00 A0 44 // 32-bit float (dec 1280) ... In other words, strings in particular may have zero, one, two, or three zero bytes of padding after them so that the next field is aligned on the four-byte boundary. That final 32-bit uint can start at 0x80, 0x84, 0x88, 0x8C, 0x90, 0x94, etc., but not at 0x89, 0x8A, or 0x8B because those aren't on a four-byte boundary. Is there any way that this can be cleverly accounted for in a template? If so, how? If not, can I put that on the list o' requested features to be added? |