| View previous topic :: View next topic |
| Author |
Message |
assaf84 Expert Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 238
|
Posted: Sat Aug 18, 2007 10:56 am Post subject: [Help please..] Getting GG's HANDLE from maple's process |
|
|
Well, that's about the only thing that I need..
I'm making a dll that will be injected to maple, and I want to put there the CRC bypass for GG and maple. The only problem is that I can't get GG's HANDLE from FindWindow.
I don't have a lot of ideas how to get it.. I can make another dll that will be injected into GG, but I really prefer that it'll be just 1 dll for maple.
Does anyone know how I can get it?
Thanks a lot... |
|
| Back to top |
|
 |
UnLmtD Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 894 Location: Canada
|
Posted: Sat Aug 18, 2007 11:09 am Post subject: |
|
|
FindWindow retrieves a handle to the window, not the process. To get a handle of a process, use OpenProcess. _________________
|
|
| Back to top |
|
 |
assaf84 Expert Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 238
|
Posted: Sat Aug 18, 2007 11:27 am Post subject: |
|
|
Ahh.. Thanks!
I searched it in MSDN, and I see that I need the process ID.. Um... Sorry for all the questions, but how do I get it..? |
|
| Back to top |
|
 |
UnLmtD Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 894 Location: Canada
|
Posted: Sat Aug 18, 2007 11:38 am Post subject: |
|
|
There's many ways of obtaining a process ID, you may want to search for one that suites your needs. Anyway, this is a function that Flyte posted a long time ago.
| Code: | DWORD GetProcessID(char* strProcessName)
{
HANDLE hProcessSnap;
PROCESSENTRY32 pe32;
hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if(hProcessSnap == INVALID_HANDLE_VALUE)
return FALSE;
else
{
pe32.dwSize = sizeof(PROCESSENTRY32);
if(Process32First(hProcessSnap, &pe32) == 0)
{
CloseHandle(hProcessSnap);
return FALSE;
}
else
{
do
{
if(stricmp(pe32.szExeFile, strProcessName) == 0)
{
CloseHandle(hProcessSnap);
return pe32.th32ProcessID;
}
} while(Process32Next(hProcessSnap, &pe32));
}
}
CloseHandle(hProcessSnap);
return FALSE;
} |
_________________
|
|
| Back to top |
|
 |
assaf84 Expert Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 238
|
Posted: Sat Aug 18, 2007 11:46 am Post subject: |
|
|
Thanks a lot UnLmtD.. +rep for you
Do u think that I can get GG's handle this way? I mean, is this:
| Code: | | hGG = (HANDLE)GetProcessID("GameMon.des"); |
will do? |
|
| Back to top |
|
 |
UnLmtD Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 894 Location: Canada
|
Posted: Sat Aug 18, 2007 11:49 am Post subject: |
|
|
When I needed MapleStory PID, I did the fallowing
| Code: | | DWORD pID = GetProcessID("MapleStory.exe"); |
pID was holding the process ID, I bet you can do the same with gamemon.des _________________
|
|
| Back to top |
|
 |
sponge I'm a spammer
Reputation: 1
Joined: 07 Nov 2006 Posts: 6009
|
Posted: Sat Aug 18, 2007 12:05 pm Post subject: |
|
|
| UnLmtD wrote: | | FindWindow retrieves a handle to the window, not the process. To get a handle of a process, use OpenProcess. |
OpenProcess = hooked. _________________
|
|
| Back to top |
|
 |
UnLmtD Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 894 Location: Canada
|
Posted: Sat Aug 18, 2007 12:09 pm Post subject: |
|
|
| sponge wrote: | | UnLmtD wrote: | | FindWindow retrieves a handle to the window, not the process. To get a handle of a process, use OpenProcess. |
OpenProcess = hooked. |
He can use OpenProcess while it's not hooking yet, and save the handle for later use. _________________
|
|
| Back to top |
|
 |
assaf84 Expert Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 238
|
Posted: Sat Aug 18, 2007 12:10 pm Post subject: |
|
|
But I'm using it inside Maple's process..
edit:
| UnLmtD wrote: | | sponge wrote: | | UnLmtD wrote: | | FindWindow retrieves a handle to the window, not the process. To get a handle of a process, use OpenProcess. |
OpenProcess = hooked. |
He can use OpenProcess while it's not hooking yet, and save the handle for later use. |
You mean like using it inside some function, and after I get the handle I would NOP it all or something? XD |
|
| Back to top |
|
 |
UnLmtD Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 894 Location: Canada
|
Posted: Sat Aug 18, 2007 12:17 pm Post subject: |
|
|
| Quote: | | You mean like using it inside some function, and after I get the handle I would NOP it all or something? XD |
No, when you open MapleStory, GameGuard is launched. But it doesn't do it's SDT hooks right away (Not sure when it does userland hooks), it needs to initialize. So you can use that for your advantage. _________________
|
|
| Back to top |
|
 |
assaf84 Expert Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 238
|
Posted: Sat Aug 18, 2007 12:24 pm Post subject: |
|
|
um... I'll try doing it on my own first..
BTW, do I need to include anything for the GetProcessID function you gave?
edit: Solved, I needed Tlhelp32.h in my includes.
Last edited by assaf84 on Sat Aug 18, 2007 12:27 pm; edited 1 time in total |
|
| Back to top |
|
 |
UnLmtD Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 894 Location: Canada
|
Posted: Sat Aug 18, 2007 12:26 pm Post subject: |
|
|
#include <tlhelp32.h> And don't forget to declare the function  _________________
|
|
| Back to top |
|
 |
assaf84 Expert Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 238
|
Posted: Sat Aug 18, 2007 12:45 pm Post subject: |
|
|
Dammit.. It just cant get the process ID! It never pass the:
| Code: | while( !(pID = GetProcessID("GameMon.des")) )
Sleep(100); |
I put a beep before and after, and it gives me only 1 beep. |
|
| Back to top |
|
 |
UnLmtD Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 894 Location: Canada
|
Posted: Sat Aug 18, 2007 1:08 pm Post subject: |
|
|
Umm, I don't know why. I just tried in a console application, it worked well...
| Code: | #include <windows.h>
#include <tlhelp32.h>
#include <stdio.h>
#include <conio.h>
DWORD GetProcessID(char* strProcessName);
HANDLE hProcess;
int main(void)
{
DWORD pID = GetProcessID("GameMon.des");
//hProcess=OpenProcess(PROCESS_ALL_ACCESS ,TRUE,pID);
printf("GameMon.des PID: %d",pID);
_getch();
return 0;
}
DWORD GetProcessID(char* strProcessName) // <----- Thanks to Flyte
{
HANDLE hProcessSnap;
PROCESSENTRY32 pe32;
hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if(hProcessSnap == INVALID_HANDLE_VALUE)
return FALSE;
else
{
pe32.dwSize = sizeof(PROCESSENTRY32);
if(Process32First(hProcessSnap, &pe32) == 0)
{
CloseHandle(hProcessSnap);
return FALSE;
}
else
{
do
{
if(stricmp(pe32.szExeFile, strProcessName) == 0)
{
CloseHandle(hProcessSnap);
return pe32.th32ProcessID;
}
} while(Process32Next(hProcessSnap, &pe32));
}
}
CloseHandle(hProcessSnap);
return FALSE;
} |
_________________
|
|
| Back to top |
|
 |
nog_lorp Grandmaster Cheater
Reputation: 0
Joined: 26 Feb 2006 Posts: 743
|
Posted: Sat Aug 18, 2007 1:14 pm Post subject: |
|
|
Patch MapleStory to store the handle returned by CreateProcess(Ex?) or find the (pointer to the) location where MapleStory stores the handle, then use that.
Also, use DbgPrint or w/e the value of GetLastError, that will give you a hint.
EDIT: My guess is OpenProcess is hooked to always return 0, so loop never breaks out. _________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish |
|
| Back to top |
|
 |
|