@OP I think the "retn" in your inline-asm is causing the problem -- the retn instruction pops an addr off the stack and jmps there (essentially). Your C++ function was about to 'return' anyway, so, the asm retn isn't needed/is actuallycausing the problem? Try removing it : D
Why are you typing in the base addr by hand instead of doing it programmatically? Are you sure this isn't the problem? It does change each time you load the game, right?
^^set a breakpoint on the game's function before you inject your dll ; see if
Code:
DWORD base_addr = 0x005450D1;
DWORD addr = base_addr + 0x00430590;
__asm{
push text
call addr
..
is actually getting to that function, or if you're 'calculating' the addr wrong.
Please find base_addr programmatically, please.
edit: Also, you should post the beginning of the game-function you're calling -- so we can see how it's using the char* you passed it -- does it pop it like it's hot, etc.
Another important question: how does the game's function 'return' back to your code -- if it uses 'retn', you need to 'push' your function's address (see my first sentence). If not, how is it getting back?