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;
VBA is open-source, so why do you have to inject a DLL? Besides, I believe it even offers pre-defined interfaces for cheats. Or at least there are utilities that do so.
I want a DLL so it's easier to distribute, so I can make it game-specifiic without having to scroll through all the code, and do things with code that the cheat interface doesn't allow.