Hi!
I have a different question to ask here!
Since this is the best forum i know of, i guess this is the right place, anyway lets get down to business.
Im a noob with JNA.
So im hacking an old game.
Heres the thing, i normally use cheat engine. But now i want to make my own program to automate the hacking process.Just for fun and learning but i might distribute it and so, i got worried about a few things that we always do :
A) How can i be sure i opened the right process?
The Game opens another exe file.
According to tasklist, the window name should be there but all tjhe programs i used to check it, shows that this process have no window name.
So i went for the window class name. And for my bad luck, its called “wkernel”.
I can load it normally but… first how can i be sure theres not another window class name called wkernel?
Second, if it happens , would it cause a BSOD on a user pc?
Code :
public static void main(String[] args) {
HWND hwnd = User32.INSTANCE.FindWindow("wKernel", "");
if (hwnd == null) {
System.out.println("Process is not running");
} else {
System.out.println("Process is running");
Pointer p = hwnd.getPointer();
System.out.println("" + p.toString());
IntByReference pid = new IntByReference(0);
User32.INSTANCE.GetWindowThreadProcessId(hwnd, pid);
int pidA = pid.getValue();
System.out.println("PID :" + pidA);
}
}
WinLister Program says in columns ( * First column, which is the window name is blank) :
Yes Minimized (160, 27) 001A05B2 wKernel Yes No No No 000015E8 00000D74 C:\PROGRA~2\LUCASA~1\THEPHA~1\WMAIN.EXE
Ah it also says Handle 001A05B2
But i guess that changes , right?
Also im not sure what that offset from the Pointer is… anyone knows it?
Thanks!
PS : Im getting into more of the JNA.
Oh boy.