Hey all,
this is more like a general question about calling a function in another process via asm injection.
the Function looks like
Code:
int _stdcall Function(float,float)
so from what i know in an stdcall i simply push the values on the stack(from left to right) and call the function
my code looks like this:
Code:
AO.Asm.Clear();
AO.SuspendThread();
uint codeCave = AO.AllocateMemory(0x1000);
AO.Asm.AddLine("mov eax," + 0.0f);//first parameter (right one)
AO.Asm.AddLine("push eax");
AO.Asm.AddLine("mov eax," + 0.0f);//2nd parameter(the left one)
AO.Asm.AddLine("push eax");
AO.Asm.AddLine("mov eax," + (ModuleBase+0x1AE91));//this is the correct adresse where the function is i want to call
AO.Asm.AddLine("call eax");
AO.Asm.AddLine("retn");
AO.Asm.InjectAndExecute(codeCave);
AO.FreeMemory(codeCave);
AO.ResumeThread();
shouldn't it work this way? cause when i try to run this code, the application crashes(giving a custom gamespecific "game crashed" messagebox even tho in the background the game remains intact as long as you don't click anything in the massagebox
thanks for your help
streppel
PS: i can post the code of the function itself too, but wanted to know if my approach this way would be right