haha... I know nothing about DLL injection.
I can code you a server-sided wbe page to beat the life out of any others (PHP, etc), but, "real" programming... well.. im just now getting into that.
Just a simple function some of you would probably find useful. Loops until the WarRock window is found, and returns the process ID when it finds the Window. I use a threaded version, but it's more specific than this code, but this should be an easy starting point for your trainer and/or injector.
Simple example usage:Code:DWORD WaitForWarrock() { DWORD dwPID = -1; // Return value, intialized to -1 for error checking. HWND hWarrockWnd = NULL; // Warrock window handle, initialized to NULL for error checking. bool bFound = false; // Boolean toggle, pretty self explanatory. while (!bFound) { if ((hWarrockWnd = FindWindow("WarRock", "WarRock")) != NULL) { // We've found Warrock's main window, now let's try to get the PID. if (GetWindowThreadProcessId(hWarrockWnd, &dwPID)) { // Check the dwPID value, just to be sure. if (dwPID > 0) { // Yep, we found it, let's break out of this loop. bFound = true; } } } Sleep(50); // To avoid being a complete CPU whore, I know this is dirty, but it works just fine. } return dwPID; // Return the process ID to the caller. }
Enjoy. Thinking about posting my simple DLL injection code, if anybody doesn't know how to to do it (tons of resources around the web) let me know, and I'll post it.Code:DWORD dwWarrockPID = WaitForWarrock();
haha... I know nothing about DLL injection.
I can code you a server-sided wbe page to beat the life out of any others (PHP, etc), but, "real" programming... well.. im just now getting into that.
If you were wanting to check if WarRock was running, you would use the same approach, however, instead of using a while loop you should instead write a function that returns a handle to the process. It is likely you are using WPM to write to memory, so the handle will come in use. This function should return NULL and display a MessageBox notifying the user that WarRock is not running. The function should be used when clicking on a button or activating a hack by shortcut. The function also solves the problems of having the game closed or crashed by letting the user know
Mind the formatting, VBulletin doesn't love /t's =<HANDLE getProcess()
{
DWORD ProcId = NULL;
HWND gWind = NULL;
HANDLE hProc = NULL;
if (FindWindow(NULL,"Error"))
return NULL;
gWind = FindWindow("Warrock", NULL);
if (!gWind)
{
MessageBox(g_hWnd, "Could not WARROCK in the process list.", "Error - MPGH.net", MB_OK | MB_ICONERROR);
return NULL;
}
else
{
GetWindowThreadProcessId(gWind, &ProcId);
if (!ProcId)
{
MessageBox(g_hWnd, "Could not get the process id.", "Error - MPGH.net", MB_OK | MB_ICONERROR);
return NULL;
}
else
{
hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, ProcId);
if (!hProc)
{
MessageBox(g_hWnd, "Could not open process.", "Error - MPGH.net", MB_OK | MB_ICONERROR);
return NULL;
}
else
{
//MPGH.net's Dave84311 is so l33t.
return hProc;
}
}
}
}
THE EYE OF AN ADMINISTRATOR IS UPON YOU. ANY WRONG YOU DO IM GONNA SEE, WHEN YOU'RE ON MPGH, LOOK BEHIND YOU, 'CAUSE THATS WHERE IM GONNA BE
"First they ignore you. Then they laugh at you. Then they fight you. Then you lose.” - Dave84311
HAVING VIRTUAL DETOX
Well, just decided to write a nice C++ static library for general-use hacking.
Just off the top of my head, I've decided on these basic features first:
Thread and process manipulation
Structured memory manipulation
PE file format manipulation and parsing
IAT, EAT, and Detour hooking
AppInit_Dlls and CreateRemoteThread DLL Injection
Any thoughts?
Well, I like the language itself of C#, but the .NET runtime is an atrocity. C# expands on alot of modern OOP elements, but lacks alot of the power and control of C++. Besides, would you really want to distribute an executable that can be disassembled that closely to the original source code, even with obfuscation? All C# (well, all .NET, actually) code is eventually compiled into MSIL format, not pure machine code. The .NET runtime employs JIT (Just-In-Time) compilation to machine code, which means it only compiles actual machine code when the executable is ran, but that doesn't change the actual executable itself, the MSIL is still there, and with the right tools, you get almost source-level representation. In this world of hackers and crackers, my friend, that is a bad thing.
However, C# is a wonderful introduction to the concepts you'll employ in C++.
Every language has their pros and cons, and many people view those pros and cons differently. The true programmer knows how to choose the appropriate tool for the job.
Ah, ok. Thanks for the explanation! Never knew that!
So, Visual Basic 6 does the same thing with compiling, right?
I can write trainers using C++, and just now figured out Visual Basic (easy as crap). I prefer the C++ syntax... brackets, parenthesis, etc... PHP is like that.
Only thing about C++ is GUIs are annoying to do... at least from what I see. Haven't seen how to do hotkeys, either...
Visual Basic 6 doesn't do the same thing, though Visual Basic .NET does (as do all other .NET languages, that's what makes them .NET). However, Visual Basic stores form data and such in an intermediate format, so Visual Basic is quite easy to disassemble and decompile, you won't get the same source-level recognition as a .NET language, but with minor x86 assembly knowledge, it's just as easy to figure out what's going on.
You see all these VB6 trainers going around with username/password logins? Find a copy of VB Decompiler Pro. Change a single line of code, and voila, it's cracked.
And yes, C/C++ syntax is very much like PHP (actually the other way around, but we won't get into semantics).
C++ GUI shit isn't easy to do, I'll admit that. I use WTL (Windows Template Library) but it's an advanced subject, and not really suggested for beginners.
As far as hotkeys go, look up the GetAsyncKeyState() function on MSDN. Ideally, you want to run a big while loop in a seperate thread with your GetAsyncKeyState() calls, to make sure you don't miss any keypresses.
C# is one nasty language. Its another VB.net which there is no need for.
THE EYE OF AN ADMINISTRATOR IS UPON YOU. ANY WRONG YOU DO IM GONNA SEE, WHEN YOU'RE ON MPGH, LOOK BEHIND YOU, 'CAUSE THATS WHERE IM GONNA BE
"First they ignore you. Then they laugh at you. Then they fight you. Then you lose.” - Dave84311
HAVING VIRTUAL DETOX
Actually Dave, don't fault the language itself. Fault the implementation. Check out Mono, it's far better than the .NET variant of C#.
Its hard for me to say, but its too OOP
THE EYE OF AN ADMINISTRATOR IS UPON YOU. ANY WRONG YOU DO IM GONNA SEE, WHEN YOU'RE ON MPGH, LOOK BEHIND YOU, 'CAUSE THATS WHERE IM GONNA BE
"First they ignore you. Then they laugh at you. Then they fight you. Then you lose.” - Dave84311
HAVING VIRTUAL DETOX
Erroneous, and blasphemy.
:P