 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
iPromise Grandmaster Cheater
Reputation: -1
Joined: 27 Jun 2009 Posts: 529 Location: Canada
|
Posted: Wed Dec 23, 2009 11:44 am Post subject: [C++] Help |
|
|
Hello,
As you know i'm working on a memory scanner and I use the CreateWindowEx() api to create my forms because i'm coding this in a dll. Now to use the components in the CreateWindowEx api you need SendMessage. SendMessage from what I know is locally (ring3) hooked, so what would be the inline asm to emulate the operation codes that gameguard or hacksheild replaces with their own?
So basically, would the trampoline be like this:
| Code: |
DWORD SendMessagePtr = (DWORD) GetProcAddress(GetMoudleHandle(L"user32.dll"), "SendMessage");
void SendMessageX(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
__asm {
mov edi, edi
push ebp
mov esp, ebp
jmp [SendMessagePtr]
}
}
|
|
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Wed Dec 23, 2009 11:53 am Post subject: |
|
|
it should be something like
| Code: |
DWORD Address = (DWORD)GetProcAddress(GetModuleHandle(_T("User32.Dll")),"SendMessage") + 5;
__declspec(naked) BOOL WINAPI _SendMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
__asm
{
mov edi,edi
push ebp
mov ebp,esp
jmp dword ptr ds:[Address]
}
}
|
|
|
| Back to top |
|
 |
Anden100 Grandmaster Cheater
Reputation: 0
Joined: 20 Apr 2007 Posts: 668
|
Posted: Wed Dec 23, 2009 12:14 pm Post subject: |
|
|
| you need to add 5 to the SendMessagePtr, and then your prolouge is a little wrong (mov esp, edb should be mov edb, esp, and you dont need mov edi,edi)
|
|
| Back to top |
|
 |
iPromise Grandmaster Cheater
Reputation: -1
Joined: 27 Jun 2009 Posts: 529 Location: Canada
|
Posted: Wed Dec 23, 2009 12:36 pm Post subject: |
|
|
@Anden100 Forgot to add the + 5 because I did the code on the spot, thanks anyways.
@__DoR Thanks, worked
|
|
| Back to top |
|
 |
|
|
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
|
|