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 


[Help] HookHop.dll in .NET (VB08).

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Shepherd
Expert Cheater
Reputation: 0

Joined: 28 Sep 2007
Posts: 186

PostPosted: Sat Dec 27, 2008 10:10 am    Post subject: [Help] HookHop.dll in .NET (VB08). Reply with quote

First of all, im learning VB atm.. dont expect me to be pro or something.

Now I want to create a maplestory bot in VB08. Though I do know that postmessage is patched and I know its possible to create a bot trough hookhop.dll. I dont know how to to this, a good googling result gave me a tutorial made by Holland ( http://screwajax88.org/viewtopic.php?f=95&t=2479 ) but thats a tutorial made for VB6 which is completely different then VB08..

So if anyone of you could give me some tips/advice/tutorials on how to do this, that would be awesome.
I want to do this in VB because my parents bought a book for me about VB, so please, dont say I need to learn another programming language..

Thanks. Smile
Back to top
View user's profile Send private message
Innovation
Grandmaster Cheater
Reputation: 12

Joined: 14 Aug 2008
Posts: 617

PostPosted: Sat Dec 27, 2008 11:13 am    Post subject: Reply with quote

You don't even need HookHop.dll.
You just need an inline asm function that starts the PostMessage function and then jumps 5 bytes into the function with the right parameters.

For the first parameter you need put the handle for MapleStory's window (you can get the handle using the function FindWindow).
For the second parameter you need to decide what type of message this will be (examples are: WM_KEYDOWN, WM_KEYUP, and WM_CHAR).
For the third and fourth parameters you need to put the details of the message you are going to send.

Example Console Application C++ code (MapleStory auto loot):
Code:
#include <iostream>
#include <windows.h>

using namespace std;

DWORD _PMA = (DWORD)GetProcAddress(LoadLibrary("user32.dll"), "PostMessageA") + 5;
int Loop_Number = 1;

__declspec(naked) BOOL WINAPI _PostMessageA(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    __asm
    {
        push   ebp
        mov    ebp, esp
        jmp    dword ptr ds:[_PMA]
   }
   return 0;
}

int main()
{
    for(;;Sleep(10))
    {
        HANDLE hWindow = FindWindow("MapleStoryClass", 0);
        if (hWindow != NULL)
        {
            _PostMessageA(hWindow, WM_KEYDOWN, 0x5A, (MapVirtualKey(0x5A, 0) << 16)); // Presses Z
            cout << "The Z key was pressed. Loop #" << Loop_Number << endl;
            Loop_Number = Loop_Number + 1;
        }
    }
}


I'm sorry I can't give you Visual Basic example code.
I really think you should code in C++ but it is completely your choice.
Back to top
View user's profile Send private message
Shepherd
Expert Cheater
Reputation: 0

Joined: 28 Sep 2007
Posts: 186

PostPosted: Sat Dec 27, 2008 11:18 am    Post subject: Reply with quote

inoobzx wrote:
You don't even need HookHop.dll.
You just need an inline asm function that starts the PostMessage function and then jumps 5 bytes into the function with the right parameters.

For the first parameter you need put the handle for MapleStory's window (you can get the handle using the function FindWindow).
For the second parameter you need to decide what type of message this will be (examples are: WM_KEYDOWN, WM_KEYUP, and WM_CHAR).
For the third and fourth parameters you need to put the details of the message you are going to send.

Example Console Application C++ code (MapleStory auto loot):
Code:
...

I'm sorry I can't give you Visual Basic example code.
I really think you should code in C++ but it is completely your choice.
Oh I tought MapleStory patched that =/

Thanks anyway, il try it.
Back to top
View user's profile Send private message
Innovation
Grandmaster Cheater
Reputation: 12

Joined: 14 Aug 2008
Posts: 617

PostPosted: Sat Dec 27, 2008 11:22 am    Post subject: Reply with quote

To0k wrote:
inoobzx wrote:
You don't even need HookHop.dll.
You just need an inline asm function that starts the PostMessage function and then jumps 5 bytes into the function with the right parameters.

For the first parameter you need put the handle for MapleStory's window (you can get the handle using the function FindWindow).
For the second parameter you need to decide what type of message this will be (examples are: WM_KEYDOWN, WM_KEYUP, and WM_CHAR).
For the third and fourth parameters you need to put the details of the message you are going to send.

Example Console Application C++ code (MapleStory auto loot):
Code:
...

I'm sorry I can't give you Visual Basic example code.
I really think you should code in C++ but it is completely your choice.
Oh I tought MapleStory patched that =/

Thanks anyway, il try it.


PostMessageA is patched but hook hopping is a bypass.

Hook hopping means you are jumping the first 5 bytes of the function because a hook was put there (the reason there are conveniently 5 bytes there perfect for a jmp hook was because Microsoft wanted to allow hot patching) but you are still starting the function basically the same (without the mov edi, edi because it is not needed).
Back to top
View user's profile Send private message
Shepherd
Expert Cheater
Reputation: 0

Joined: 28 Sep 2007
Posts: 186

PostPosted: Sat Dec 27, 2008 11:40 am    Post subject: Reply with quote

inoobzx wrote:
To0k wrote:
inoobzx wrote:
You don't even need HookHop.dll.
You just need an inline asm function that starts the PostMessage function and then jumps 5 bytes into the function with the right parameters.

For the first parameter you need put the handle for MapleStory's window (you can get the handle using the function FindWindow).
For the second parameter you need to decide what type of message this will be (examples are: WM_KEYDOWN, WM_KEYUP, and WM_CHAR).
For the third and fourth parameters you need to put the details of the message you are going to send.

Example Console Application C++ code (MapleStory auto loot):
Code:
...

I'm sorry I can't give you Visual Basic example code.
I really think you should code in C++ but it is completely your choice.
Oh I tought MapleStory patched that =/

Thanks anyway, il try it.


PostMessageA is patched but hook hopping is a bypass.

Hook hopping means you are jumping the first 5 bytes of the function because a hook was put there (the reason there are conveniently 5 bytes there perfect for a jmp hook was because Microsoft wanted to allow hot patching) but you are still starting the function basically the same (without the mov edi, edi because it is not needed).
I see, thanks for explaining.

Btw can someone also explain how to do it with a hookhop.dll?
Back to top
View user's profile Send private message
sponge
I'm a spammer
Reputation: 1

Joined: 07 Nov 2006
Posts: 6009

PostPosted: Sat Dec 27, 2008 11:55 am    Post subject: Reply with quote

you just import the dll and then call hhPostMessage()
_________________
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 programming 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