Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Dll injection

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions
View previous topic :: View next topic  
Author Message
IIZoom%
How do I cheat?
Reputation: 0

Joined: 28 Aug 2024
Posts: 1

PostPosted: Wed Aug 28, 2024 11:06 am    Post subject: Dll injection Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites