Hello, I'm writing a DLL to inject into VisualBoyAdvance (gameboy emulator. Yes I actually have a gameboy, and yes I actually own the game. It's legal), and I was trying to figure something out. The thing has a base pointer which contains the dynamic base address for the game, which changes with every loading of the game. I want to be able to do something like this:
is there any sort of way to accomplish this? Basically I want to get what the base pointer holds, add offsets, and then be able to manipulate the values at those addresses, or move them into eachother, etc. Any help is appreciated.
// 0059EC80 is the base pointer
int dynamic_base_address = *(0059EC8);
// hp is the dynamic base address + 0x98
Int16 hp = dynamic_base_address+0x98;
Int16 maxhp = dynamic_base_address+0x9A;
*hp = *maxhp;