So I'm working on trying to find where the entity list is stored in memory in Zelda: Breath of the Wild. I am running BOTW on Cemu emulator for Wii U, and so because this game is being emulated, some of the usual methods involving finding pointers will not work.
Here are the steps I have taken in an effort to find the entity list:
First I dropped an item in game, spawning an entity. I have previously found the coordinates of my player, and so I am able to stand on top of the item I dropped to get a rough estimate of its coordinates. I then searched for these coordinates, slightly moved the item, searched again, and repeated until I found the coordinates of the item.
Now that I have the coordinates of the item, I used Cheat Engine's "Find out what accesses this Address", and found two opcodes that were accessing the address. Only one of the opcodes was actually writing to the address, and so I used the "Find out which addresses this instruction accesses" functionality to get a list of addresses accessed by it. In that list of addresses I found coordinates for other objects too, not just the object I had dropped. I am unsure at the moment whether this opcode only accesses item entities, or if it accesses all object entites.
I wanted to be able to find this instruction easily in the future, as it had been difficult to find it, and so what I did was I looked at the base address of the memory region that this opcode was stored in, and then I searched Cemu.exe for a pointer that pointed to this memory region. I then could easily search this region to find the opcode.
The relevant opcode reads:
Now I have minimal experience with any assembly languages, however from what I can tell, I believe that this is x86 ASM, and that what it is doing is reading from register r14d, and writing to the coordinates stored in r13+rcx+00. I am slightly confused by what the +00 is doing, as I would expect that it is doing nothing.
Code: Select all
That would mean that r13 and rcx added together would store the coordinates in memory of item entities. As such, I believe that I should somehow be able to work backwards from these to try to find the entity list. I'm not certain whether or not I am on the right track to find the entity list, and so I was hoping for some advice from someone more experienced than me. I'm not really sure what I should be doing next, or how I would be able to work backwards from the information that I have.