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 


Process id

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

Joined: 13 Mar 2007
Posts: 894
Location: Canada

PostPosted: Tue Mar 27, 2007 8:04 pm    Post subject: Process id Reply with quote

For the past few days I been learning API's and I have a problem trying to get MapleStory PID using:
Code:
GetWindowThreadProcessId
I know that gameguard acts like a root kit by hiding MapleStory. Therefor that API doesn't. I tried
Code:
#include <iostream>
#include <windows.h>

using namespace std; 

int main(int argc, char* argv)
{

DWORD gamepid=0;
HWND gamehwnd;
HANDLE gamehandle;

cout<<"Locating Maple Story...\n";
cout.flush();

do {
gamehwnd=FindWindow("MapleStoryClass","MapleStory");
} while(gamehwnd==0);
cout<<"Maple Story detected in memory!\n";
cout.flush();

GetWindowThreadProcessId(gamehwnd,&gamepid);
gamehandle=OpenProcess(PROCESS_ALL_ACCESS,false,gamepid);

if(gamehandle==0) {
cout<<"Error: Cannot open process\n";
cout.flush();
getchar();
return -1;
}
}


Even when MapleStory is still in Task manager > Processes it does't work. So can anyone point me to something?
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Tue Mar 27, 2007 8:09 pm    Post subject: Reply with quote

When gameguard is stripped, that code works fine.

also, here is your code... improved! Smile

Code:

#include <windows.h>

HANDLE std;
DWORD CWrite(LPSTR lpszMessage);

int main()
{
   DWORD pid; HWND gw; HANDLE hw;
   std = GetStdHandle(-11);
   
   CWrite("Locating MapleStory...\n");
   gw = FindWindow("MapleStoryClass", "MapleStory");
   if (!gw) {
      CWrite("Can't find Window\n");
      return GetLastError();
   }   else {
      CWrite("Found window...\n");
   }
   
   GetWindowThreadProcessId(gw, &pid);
   hw = OpenProcess(PROCESS_ALL_ACCESS, 0, pid);
   if (!hw) {
      CWrite("Could not open Process\n");
      return GetLastError();
   }   else {
      CWrite("Opened Process.\n");
   }
   
   CloseHandle(hw);
   CloseHandle(gw);
   CloseHandle(std);
   return 0;
}

DWORD CWrite(LPSTR lpszMessage)
{
   DWORD ass = 0;
   WriteFile(std, lpszMessage, lstrlen(lpszMessage), &ass, NULL);
   return ass;
}

_________________


Last edited by appalsap on Tue Mar 27, 2007 8:19 pm; edited 2 times in total
Back to top
View user's profile Send private message
UnLmtD
Grandmaster Cheater
Reputation: 0

Joined: 13 Mar 2007
Posts: 894
Location: Canada

PostPosted: Tue Mar 27, 2007 8:17 pm    Post subject: Reply with quote

So if I can disable gameguard from hiding maplestory it will work?
Back to top
View user's profile Send private message
ravicus
Master Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 464

PostPosted: Tue Mar 27, 2007 8:18 pm    Post subject: Reply with quote

Lol, have fun killing gameguard.
_________________
Back to top
View user's profile Send private message
UnLmtD
Grandmaster Cheater
Reputation: 0

Joined: 13 Mar 2007
Posts: 894
Location: Canada

PostPosted: Tue Mar 27, 2007 8:19 pm    Post subject: Reply with quote

ravicus wrote:
Lol, have fun killing gameguard.


Did I say anything about "killing gameguard"?

Thanks appalsap


Last edited by UnLmtD on Tue Mar 27, 2007 8:21 pm; edited 1 time in total
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Tue Mar 27, 2007 8:21 pm    Post subject: Reply with quote

zomgiownyou wrote:
So if I can disable gameguard from hiding maplestory it will work?


well no, your computer will lock up because you will have RESOURCE LEAKS since you don't CLOSE your HANDLES

_________________
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