| View previous topic :: View next topic |
| Author |
Message |
Henley Grandmaster Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 671
|
Posted: Sat Feb 09, 2008 7:05 pm Post subject: [HELP C#]PID |
|
|
I need help with getting the process ID for MapleStory. I know how to get when I load maple, but after gameguard is loaded, MapleStory's process becomes hidden and the process ID isn't running anymore.
I wanna know what happened the process ID, did it change?
If it did change, is there a way i could find the new process ID?
|
|
| Back to top |
|
 |
Overload Master Cheater
Reputation: 0
Joined: 08 Feb 2008 Posts: 293
|
Posted: Sat Feb 09, 2008 7:21 pm Post subject: |
|
|
I don't get what you are saying. You want to do what with MapleStory pID?
If you want to display it in a list, then it would be something like:
| Code: | Process[] maple = Process.GetProcessByName("MapleStory");
listBox1.Items.Add(maple);
|
I'm pretty sure that will work
|
|
| Back to top |
|
 |
Henley Grandmaster Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 671
|
Posted: Sat Feb 09, 2008 7:26 pm Post subject: |
|
|
I run ms and get PID.
Gameguard begins to load and the PID is no longer running.
I wanna know what happened to the PID.
|
|
| Back to top |
|
 |
Heartless I post too much
Reputation: 0
Joined: 03 Dec 2006 Posts: 2436
|
Posted: Sat Feb 09, 2008 7:31 pm Post subject: |
|
|
I'm not 100% sure, but I think GameGuard hides Maple Story's PID and everything else.
_________________
What dosen't kill you, usually does the second time. |
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Sat Feb 09, 2008 7:50 pm Post subject: |
|
|
FindWindow using MapleStoryClass
using the handle get the proc ID
that's how i got the pid for one of my projects. I lost the source when i formatted so i can't post it. It's not confusing though.
_________________
|
|
| Back to top |
|
 |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Sat Feb 09, 2008 8:16 pm Post subject: |
|
|
| blankrider wrote: | FindWindow using MapleStoryClass
using the handle get the proc ID
that's how i got the pid for one of my projects. I lost the source when i formatted so i can't post it. It's not confusing though. |
I had to re-read that many times to understand it.
Basically, call the FindWindow api, using the parameters
| Code: |
"MapleStoryClass", null
|
I think, then that'll return an IntPtr as a handle to Maple. Not sure why you would want the proc ID when you need a handle to do most things. Anyways, though, just call GetWindowThreadProcessID with
Assuming that hWnd is what FindWindow returned, and procid is an int.
Here are the decls
| Code: |
//using System.Runtime.InteropServices;
[DllImport("user32.dll")]
public static extern IntPtr FindWindow( string classname, string windowname);
[DllImport("user32.dll")]
public static extern int GetWindowThreadProcessId(IntPtr hWnd, out int pid);
|
_________________
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Sat Feb 09, 2008 9:34 pm Post subject: |
|
|
FindWindow using the MapleStoryClass, do you get that?
That returns a handle, using this handle use GetWindowThreadProcessID
I was in a rush, but i see you wrote him out a code. Make him think at least a little?
_________________
|
|
| Back to top |
|
 |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Sat Feb 09, 2008 9:37 pm Post subject: |
|
|
| blankrider wrote: | FindWindow using the MapleStoryClass, do you get that?
That returns a handle, using this handle use GetWindowThreadProcessID |
Yeah, but it was hard to grasp at first. =P
| blankrider wrote: | | I was in a rush, but i see you wrote him out a code. Make him think at least a little? |
=P
I had to Google for something pretty obscure to figure out which API to use to get the PID from the handle.
Also, Dll Imports are a huge pain in the ass. Thought I'd just throw him a bone.
_________________
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Sat Feb 09, 2008 9:54 pm Post subject: |
|
|
oh yea, thats just a decl. I thought you gave him whole code at first.
MSDN IS MY BEST FRIEND ^_^_^_^
_________________
|
|
| Back to top |
|
 |
Henley Grandmaster Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 671
|
Posted: Sat Feb 09, 2008 10:01 pm Post subject: |
|
|
D: I think theres a problem
I'm using FindWindow with MapleStoryClass,but whenever maple loads, the proc id is 0.
Here's my code:
| Code: | string ClassName = "MapleStoryClass";
//string WindowName = "MapleStory";
IntPtr hWnd = FindWindow(ClassName, null);
if (hWnd != IntPtr.Zero)
{
UInt32 ProcID;
GetWindowThreadProcessId(hWnd, out ProcID);
processlbl.Text = Convert.ToString(ProcID);//using a label to show pid
} |
Am i doing something wrong?
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Sat Feb 09, 2008 10:09 pm Post subject: |
|
|
string ClassName = "MapleStoryClass";
//string WindowName = "MapleStory";
IntPtr hWnd = FindWindow(ClassName, null);
if (hWnd != IntPtr.Zero)
{
UInt32 ProcID;
GetWindowThreadProcessId(hWnd, out ProcID);
processlbl.Text = Convert.ToString(ProcID);//using a label to show pid
}
if(hWnd == IntPtr.Zero)
{
processlbl.Text = "Failed";
}
Try that and tell me if it says failed.
_________________
|
|
| Back to top |
|
 |
Henley Grandmaster Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 671
|
Posted: Sat Feb 09, 2008 10:14 pm Post subject: |
|
|
| Nope. 0
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Sat Feb 09, 2008 10:15 pm Post subject: |
|
|
Try it with a process like Notepad.exe
Use Notepad as the windowname and null as a classname. See if you still get 0. If you do, then its in GG, if not then its the code. Idk why that code would be wrong though o.o
_________________
|
|
| Back to top |
|
 |
Overload Master Cheater
Reputation: 0
Joined: 08 Feb 2008 Posts: 293
|
Posted: Sat Feb 09, 2008 10:19 pm Post subject: |
|
|
| hmm, i cant' really see anything wrong with this code. It must be GG that is screwing you over.
|
|
| Back to top |
|
 |
Henley Grandmaster Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 671
|
Posted: Sat Feb 09, 2008 10:20 pm Post subject: |
|
|
| I think you mean Untitled - Notepad as window name. Anyways, i got a pid for notepad.
|
|
| Back to top |
|
 |
|