Jump to content
Sign in to follow this  

[C++] StarCraft hacking

Recommended Posts

Hello. I've recently begun to mess around with ReadProcessMemory and have an OK grasp of what it does, how it works, etc. I have written programs by myself, for myself to test the functionality of it.

 

I have successfully used it on other applications (games specifically) such as Age of Empires, Age of Empires II, Diablo, etc... When I attempted to use it with StarCraft: Brood War (v1.16), it didn't work. It returned an error code of 6.

 

Here's my code:

#include <iostream> 
#include <windows.h> 

#define OffsetRead (void*)0x00641060

using namespace std;

int main() {

system("TITLE Reader");

BYTE OverwriteNumbers[] = {0x9A, 0x02};
int ReadNumbers = 0;

unsigned long WindowsPID;		 /* Windows Process ID */
unsigned long NumBytesRead;	   /* Number of bytes read - returned by ReadProcessMemory */
char WindowsName[] = "Brood War";	/* The Window Title to get the Window Handle from to convert into a PID */
BYTE BytesToBeRead[50] {0x00};  /* array to hold the read info */

HWND WindowsHandle = FindWindow(0, WindowsName);
if (!FindWindow(0, WindowsName)) { printf("Window %s not found!", WindowsName); cin.get(); exit(0); }

GetWindowThreadProcessId(WindowsHandle, &WindowsPID);  /* Get windows PID from a window handle */
HANDLE WindowsProcessHandle = OpenProcess(PROCESS_ALL_ACCESS, false, WindowsPID);

ReadProcessMemory(WindowsProcessHandle, OffsetRead, &BytesToBeRead, sizeof(BytesToBeRead), &NumBytesRead);

CloseHandle(WindowsProcessHandle);

cin.get();
return 0;
}

 

Is there any reason why it returned an error?

Is there a way to "fix" or get around this issue (if it is unresolveable)?

 

Any and all answers are appreciated. Thanks.

Share this post


Link to post
Share on other sites

Hey, I have no idea how to program anything other than my WiiMote to work on my comp.

Seeing as how inactive the programing section here is I'll pass this along to a few programing/game hacking pals to see if they have any ideas.

In the meantime why not stay and be active on the Ghoztcraft?

Share this post


Link to post
Share on other sites
Hey, I have no idea how to program anything other than my WiiMote to work on my comp.

Seeing as how inactive the programing section here is I'll pass this along to a few programing/game hacking pals to see if they have any ideas.

In the meantime why not stay and be active on the Ghoztcraft?

 

This site loads slow (for whatever reason), which I find quite annoying. It has very inactive users (via programming section), which is one of the only reasons I'd ever use a forum; I don't use forums to socialize.

 

If you have any information regarding my post, please post an answer, or further information on it.

Thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×