Right now the development of my script has hit a road bump. The heap system here compared to TWEWY's is a lot more... primitive. I am finding myself using save states a lot more during this research.
Differences from TWEWY's heap system:
- Block headers are nulled on deallocation (have not yet seen how this affects the linked list arrangement)
- Contains pointer to a general name (CPU_HEAP or something close)
Probably can be used as a signature for scanning for all blocks in memory with help from the previous bullet.
- Not yet able to identify block sizes
- Not yet able to identify which block contains which data in any way
- Each enemy has a different struct and size?
- Contains pointers to various locations (unable to identify any meaningful data yet)
If anybody is interested, here is the information I have on the block headers:
0x00 2 bytes 0xFFFF (0x0000 if unoccupied)
0x02 2 bytes Object State (unoccupied, etc?)
0x04 4 bytes null?
0x08 4 bytes null?
0x0C Ptr Previous Object
0x10 Ptr Next Object
0x14 4 bytes null?
0x18 4 bytes 0x081213DC (Pointer to name)
0x1C Ptr Object's Ptr (0x0)
Both current hp and max hp are 2 bytes with max hp right after current hp. I don't have time right now to do any further research.