| View previous topic :: View next topic |
| Author |
Message |
jackyyll Expert Cheater
Reputation: 0
Joined: 28 Jan 2008 Posts: 143 Location: here
|
Posted: Thu Jul 10, 2008 11:26 am Post subject: [Question] Hook hopping |
|
|
I know hook hopping is jumping over the hook that GG puts on some API's but i was wondering, is this a generic thing that all game protection software does? Like, is it going to be the same thing for xTrap, like jump ove the five bytes and stuff? Or, is it going to be a completely different routine with possibly more than just a jmp to their own code?
EDIT:
Also, can you hook hop the IsDebuggerPresent function and change the code so it always returns false thus allowing you to run debuggers?
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Thu Jul 10, 2008 11:35 am Post subject: |
|
|
If xTrap puts a hook at the beggining of user-mode functions like GG then yes you can use it.
For IsDebuggerPresent:
If you want to always return false then you have to hook IsDebuggerPresent, and always return false.
_________________
|
|
| Back to top |
|
 |
jackyyll Expert Cheater
Reputation: 0
Joined: 28 Jan 2008 Posts: 143 Location: here
|
Posted: Thu Jul 10, 2008 11:42 am Post subject: |
|
|
How can i tell if they're putting it at the beginning of the function, the UCE i'm using for some reason wont enumerate DLL's and Symbols :/ Don't know if it's xtrap stopping it or if it's the UCE.
Isn't hook hopping the IsDebuggerPresent going to accomplish the same thing as a hook since you're going to be rewriting the code can't you just add a ret false or something? Or when you hook hop it, redirect to a completely different function like a trampoline?
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Thu Jul 10, 2008 12:00 pm Post subject: |
|
|
Your missing the big picture about hook-hopping.
Your rewriting the original bytes ourselves then jumping right back to to the function past those bytes we just wrote ourself. It run's normally after that. Plus this only helps you.
If another process called IsDebuggerPresent it would run normally.
hooking something yourself is different. Your doing what GameGuard is doing. writing the first 5 bytes to a jump to your function. Where you rebuild wut you had overwritten then just return false.
_________________
|
|
| Back to top |
|
 |
Dark Gigabyte Advanced Cheater
Reputation: 0
Joined: 13 Feb 2008 Posts: 72
|
Posted: Thu Jul 10, 2008 12:06 pm Post subject: |
|
|
Try putting something like this using FixMemEx
or you can use virtual protect I think
put this under your includes:
| Code: | static const FARPROC VPX = (FARPROC)((DWORD)GetProcAddress(GetModuleHandleA("kernel32.dll"), "VirtualProtectEx")+5);
#define JMP(frm, to) (int)(((int)to - (int)frm) - 5);
_declspec(naked) BOOL WINAPI FixMemEx(HANDLE hProcess, LPVOID lpAddress, SIZE_T dwSize, DWORD flNewProtect, PDWORD lpflOldProtect)
{
_asm
{
mov edi,edi
push ebp
mov ebp,esp
jmp VPX
}
} |
Then right before every part of your code that you insert a hack put:
| Code: | DWORD oldp = 0;
PDWORD oldprot = &oldp;
FixMemEx(GetCurrentProcess(), (void*)0x00401000, 0x3FF000, PAGE_EXECUTE_READWRITE, (DWORD*)oldprot); |
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Thu Jul 10, 2008 12:10 pm Post subject: |
|
|
| Dark Gigabyte wrote: | Try putting something like this using FixMemEx
or you can use virtual protect I think
put this under your includes:
| Code: | static const FARPROC VPX = (FARPROC)((DWORD)GetProcAddress(GetModuleHandleA("kernel32.dll"), "VirtualProtectEx")+5);
#define JMP(frm, to) (int)(((int)to - (int)frm) - 5);
_declspec(naked) BOOL WINAPI FixMemEx(HANDLE hProcess, LPVOID lpAddress, SIZE_T dwSize, DWORD flNewProtect, PDWORD lpflOldProtect)
{
_asm
{
mov edi,edi
push ebp
mov ebp,esp
jmp VPX
}
} |
Then right before every part of your code that you insert a hack put:
| Code: | DWORD oldp = 0;
PDWORD oldprot = &oldp;
FixMemEx(GetCurrentProcess(), (void*)0x00401000, 0x3FF000, PAGE_EXECUTE_READWRITE, (DWORD*)oldprot); |
|
...You obviously don't know what your talking about nor have read the thread...
FixMemEx is VirtualProtectEx.
JMP is defined there because...?? obviously copied and pasted.
We weren't even talking about hacks here...
Also that code snippet is extremely redundant.
u dont need to define a PDWORD just have the last parameter referenced (&)
_________________
|
|
| Back to top |
|
 |
jackyyll Expert Cheater
Reputation: 0
Joined: 28 Jan 2008 Posts: 143 Location: here
|
Posted: Thu Jul 10, 2008 12:48 pm Post subject: |
|
|
| I see. So, how can i find the API's in the games memory if the enumerate DLL's isn't working in CE? Is there another way that i can find them?
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
Posted: Thu Jul 10, 2008 12:58 pm Post subject: |
|
|
| jackyyll wrote: | | I see. So, how can i find the API's in the games memory if the enumerate DLL's isn't working in CE? Is there another way that i can find them? |
If the game doesn't use LoadLibrary/GetProcAddress at runtime for everything, you can look at the import table of the game executable with a tool like PEiD. (http://peid.has.it/)
_________________
- Retired. |
|
| Back to top |
|
 |
jackyyll Expert Cheater
Reputation: 0
Joined: 28 Jan 2008 Posts: 143 Location: here
|
Posted: Thu Jul 10, 2008 1:26 pm Post subject: |
|
|
| Using PEiD, i open the Task Viewer in it, and the game's process doesn't show up. If i open the executable, there are only two imports kernel32.dll and comctl32.dll. Is this because the game is packed with themida?
|
|
| Back to top |
|
 |
|