IIZoom% How do I cheat?
Reputation: 0
Joined: 28 Aug 2024 Posts: 1
|
Posted: Wed Aug 28, 2024 11:06 am Post subject: Dll injection |
|
|
Hi, I'm trying to inject this function:
extern "C" TEST void Mfunc(void* stru)
{
Data* msg = (Data*)stru;
if (!msg)
return (MessageBoxA(NULL, "NULL", "NULL", MB_OK), (void)0);
std::string itemHandle = msg->m_vecData.at(0)._handle + "\t";
MessageBoxA(NULL, itemHandle.c_str(), itemHandle.c_str(), MB_OK);
return;
}
Basically, I'll take a pointer to a struct and modify its content. The struct in the original code is created on the stack, if that makes any difference.
I want to inject this code before another function that takes the same reference. Here is the code I have:
lea esi,[esp+1C]
diealy call my function here
call 006E4D00
So I created an Auto Assembler script like this:
lea esi,[esp+1C]
pushad
pushfd
push esi
call Mfunc
pop eax
popfd
popad
call 006E4D00
jmp return
But it crashes the game every time it is called. The message boxes do appear, though.
i just need to know what i might be doing wrond, thank you
|
|