This can be very useful in determining the start and end of a particular data structure, as they should not overlap. Given this very strong assumption, it can be assumed that any file offset is going to point to the location of the beginning of another data structure. Given knowledge of how structures work in code, it is highly unlikely for an offset/pointer to jump into the middle of a structure. The main benefit this data provides for those not using it to convert absolute memory addresses, is that it gives the location of every other file offset within the data. If you are not planning on doing any real coding with this format, or have no issue using the other file offsets in a relative manner, then this information can be ignored entirely in most cases. Using the relocation table all file offsets within the file can easily be modified to be absolute instead of relative. As such all file offset within the data will still be relative to the beginning of the data and not absolute addresses in memory. This is done because when the file is loaded into memory by the game the memory location assigned by the main operating system will not be based on a zero offset like loading the file simply in a hex editor. The purpose of the relocation table is not to give access to specific data structures, but to show the location of every other file offset located within the data section. Each file offset is 32-bit and is relative to the beginning of the data section. The number of which is given in the header by relocationTableCount. Starting directly after the relocation table is a list of file offsets. Now that you have the header and data sections sorted out, they are not much use without knowing where various information begins within the data. If this is too confusing, copying all data from directly after the header, for the size given in the header, and placing it in a separate file will allow all the offsets in the file to be treated without modification. All file offsets found later in the file start from the beginning of this data section, so taking the entire file into account all offsets will be 0x20 bytes less than you would expect (as you have to add the base data offset). Given that main data section starts immediately after the header, the base offset within the file is 0x20 bytes from the beginning of the file. The next value is 32-bit as well and gives the length of the data section that follows directly after the header. ![]() The start of the header starts with the 32-bit (4-byte) size of the file upon creation, which can be used to verify the file is the correct length. ![]() Uint32 unknown0x14 // '001B' in main Pl*.dat files Uint32 dataBlockSize0x04 // size of main data block
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |