PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have been having the same problem with SHP files for generating map images. I think my dilemna is how do I determine the format string for unpacking certain data. For example, I know that "V" is the format for unpacking a "unsigned long (always 32 bit, little endian byte order)", but in one code example I was looking at:
What is the "1V" for? Why is it needed to unpack this section of the data string? How did the developer conclude in using that format string? Are there any applications out there, that would help me visualize the binary data, in order to successfully unpack data strings?
Thanks, that was very helpful. Cleared up a lot for me. Seems the manual doesn't really get into the details much about the pack/unpack features. What's the best way to analyze a binary file like this, so I don't have to look at ascii in the terminal?
on the far left is the starting byte offset. Each line is 16 bytes. Find the starting line, then count however many bytes in. That'll be your starting offset.
Is there a good resource online to goto and find out how to do this? I'm still not understanding your description. I mean, how does 2A represent my byte offset? Is that the hexidecimal representation of a number of bytes? The offset number of bytes is an offset from what initial byte place? Please, be patient with me, I'm a bitwise noob.
yes, the numbers are in hex. The left most column (offsets) is from the start of the file. The middle column is the binary data in hex (two hex digits for each byte.) The right column is a printable version of the bytes. So 2A is 42 bytes from the beginning of the file (zeroth byte.)