PDA

View Full Version : Can't get warrock.exe, hProcess is always 0, using Borland Cbuilder 2008



purple
04-12-2008, 05:19 AM
i think my topic says everything.
OpenProcess() always returns 0, i cant hack warrock anymore. is there any special thing that changed?? pls help, dont know what to do.
i heard cbuilder 6, the older one, is able to get the correct value of OpenProcess(). but wtf is version 08 doing? perhaps somebody knows...

:pctoss

ganglyman21
04-12-2008, 05:33 AM
Would help if you posted the code you are using to try and attach it.

purple
04-12-2008, 08:27 AM
have a look:
====================================
First Method:
====================================
HWND hWnd = FindWindow(0, "WarRock");
GetWindowThreadProcessId(hWnd, &proc_id);
hProcess = OpenProcess(PROCESS_ALL_ACCESS|PROCESS_VM_OPERATIO N|PROCESS_VM_READ|PROCESS_VM_WRITE|PROCESS_QUERY_I NFORMATION, FALSE, proc_id);
====================================
Second method:
====================================
int Memory(char *szProcess)
{
HANDLE hProcessSnap;
PROCESSENTRY32 pe32;
DWORD dwPriorityClass;

hProcessSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );

if( hProcessSnap == INVALID_HANDLE_VALUE )
{
return( 0 );
}

pe32.dwSize = sizeof( PROCESSENTRY32 );

if( !Process32First( hProcessSnap, &pe32 ) )
{
CloseHandle( hProcessSnap );
return( 0 );
}

do {
if(!strcmp(pe32.szExeFile,szProcess))
{
hProcess = OpenProcess(PROCESS_ALL_ACCESS|PROCESS_VM_OPERATIO N|PROCESS_VM_READ|PROCESS_VM_WRITE|PROCESS_QUERY_I NFORMATION, false, pe32.th32ProcessID);
return ( 2 );
}
} while( Process32Next(hProcessSnap,&pe32) );
CloseHandle( hProcessSnap );
return( 1 );
}
=============================
second method returns 2, so u can say this function finds the process....

ganglyman21
04-12-2008, 12:04 PM
have a look:
====================================
First Method:
====================================
HWND hWnd = FindWindow(0, "WarRock");
GetWindowThreadProcessId(hWnd, &proc_id);
hProcess = OpenProcess(PROCESS_ALL_ACCESS|PROCESS_VM_OPERATIO N|PROCESS_VM_READ|PROCESS_VM_WRITE|PROCESS_QUERY_I NFORMATION, FALSE, proc_id);



Are you declaring this as a function?

i.e.



void memory()
{
HWND hWnd = FindWindow(0, "WarRock");
GetWindowThreadProcessId(hWnd, &proc_id);
hProcess = OpenProcess(PROCESS_ALL_ACCESS|PROCESS_VM_OPERATIO N|PROCESS_VM_READ|PROCESS_VM_WRITE|PROCESS_QUERY_I NFORMATION, FALSE, proc_id);
}


Cos I got that working with no problems. So I'm not quite sure where you're going wrong lol.

virus7799
04-12-2008, 09:36 PM
My advice is drop Borland and go to Visual C++.

purple
04-13-2008, 02:13 AM
okay thx for answers... but:
i know how to code c++ so my function is declared ;-) it works to get every other process, like icq.exe.
it just wont work with warrock.exe Killa2

and i also tried it with vc++.... doesnt work. wtf is wrong there? i never heard of such a problem^^

Firesnipe
04-13-2008, 11:07 AM
Yea go to C++
It might be hard to go from Pascal to C++
But it's worth it

virus7799
04-13-2008, 02:57 PM
okay thx for answers... but:
i know how to code c++ so my function is declared ;-) it works to get every other process, like icq.exe.
it just wont work with warrock.exe Killa2

and i also tried it with vc++.... doesnt work. wtf is wrong there? i never heard of such a problem^^

Wait, so your telling me you can't get WarRock process when you compile your hack with Visual C++?
Are you running Vista?

purple
04-14-2008, 10:25 AM
okay, tested it all out. my solution:

making warrock hacks on....

- vista: use borland c++ builder 2008
- xp: use borland c++ builder 6

vc++ works. dont know what i made before...

thx all!

Fragment
04-29-2008, 08:58 PM
Here's a better solution.

In Borland, whenever you declare a variable inside a function, it is limited to that function. I would recommend going to Unit1.H and going to where it says PUBLIC:
And declaring your variables such as hProcess there.

That way it will not be restricted to one function only.

purple
06-14-2008, 03:48 AM
i tested it again. i dont get it working to declare my variables public. i wanted to bind them into my .cpp file with extern, but this doesnt work. how to do?

but the hProcess is also 0 in the function. so i think its not a problem of declaring my variables...