Here is the kind of stuff I'm trying to do now. This will be a new function, that needs to be in the games memory space.
- Code: Select all
Note: This is just a made up example.
static __declspec(naked) int GetHealth()
{
static int Result = 0;
// My ASM isn't that great yet, so.. This may be wrong...
__asm
{
mov eax, dword ptr ds:[0x005CB2C8]
mov Result, eax
}
return Result;
}
// I'll probably have to write prolog\epilogs since these will be new functions.
I have several questions, is this a smart thing to do? Is it even possible? (Not sure why it wouldn't be.) What's the best way to go about it. (I know I need a code cave, but, are there any C++ methods I can use to find them, I plan to create lot's of functions. I can use MHS, but, would prefer an automatic method in my .dll, that way I can just write code, tell it to inject itself, and be done with it.)
This method should be fine, so long as the addresses are globals, not locals, correct? Would Read\Write process memory be a better solution?
That about covers my concerns, any help would be appreciated.