LightbulbHow to start into Game Hacking

Posts 61–75 of 108 · Page 5 of 8
Quote Originally Posted by MW2TopTenWORLD View Post
That didn´t fixed it....
The fact that you didn't have it in double quotes in the first place shows you don't have much programming experience...

Post your code, AND THE ERROR MESSAGE, and maybe someone will help you...or don't, idc.

 
edit

Your cout's: Why do you know how to include double-quotes in a string, but don't know to put quotes around the string argument? weird.
Quote Originally Posted by abuckau907 View Post
The fact that you didn't have it in double quotes in the first place shows you don't have much programming experience...

Post your code, AND THE ERROR MESSAGE, and maybe someone will help you...or don't, idc.

 
edit

Your cout's: Why do you know how to include double-quotes in a string, but don't know to put quotes around the string argument? weird.
I actually fixed it... but now I have another problem...



Code:
#include <iostream>
#include <windows.h>
#include <string>
#include <cstdio>




using namespace std;

int main()
{
	system("color 0A");
	cout << "Call of Duty : Modern Warfare 2 Steam Tool - Made by MW2TopTenWORLD!\n" << endl;
	cout << "Research made for Steam version of the game \"1.2.208\"\n" << endl;
	cout << "Research by : MW2TopTenWORLD\n" << endl;
	cout << "There will be no updates to this program! This will only be a stats tool!!\n" << endl;
	LPCWSTR ProcessName222 = L"Modern Warfare 2";
	
	HWND hwnd = FindWindow(0, ProcessName222);
	if (hwnd == 0)
	{
		cout << "Call of Duty : Modern Warfare 2 was NOT Found!! Make sure the game is opened before opening this tool...\nThe tool will exit so you can Open the game...";
		std::getchar();
	}
	else
	{
		DWORD process_ID;
		GetWindowThreadProcessId(hwnd, &process_ID);
		HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, process_ID);
		cout << "Call of Duty : Modern Warfare 2 Was FOUND!... Welcome to my tool..." << endl;
		system("Pause");
		int Option;
		cout << "Pick what you want to mod...\nType 1 for XP\nType 2 for Score\nType 3 for Wins\nType 4 for Losses\nType 5 for Ties\nType 6 for Win Streak\nType 7 for Kills\nType 8 for Headshots\nType 9 for Assists\nType 10 for Killstreak\nType 11 for Deaths\nType 12 for Prestige\nType 13 for INSANE STATS!\n";
		cout << "Type what you want : ";
		
		cin >> Option;
		cin.ignore();
		if (Option > 13)
		{
			cout << "There is no option higher than 13.... Dumbass!" << endl;
		}
		else
		{
			if (Option == 1){
				cout << "What do you want to set your XP as?" << endl;
				cout << "Type what XP you want : ";
				int XP;
				cin >> XP;
				cin.ignore();
				
				DWORD newdatasize = sizeof(XP);
				if (WriteProcessMemory(hProcess, (LPVOID)0x01B2C89C, &XP, newdatasize, NULL))
				{
					cout << "The XP Has been sucessfully written as : " + XP << endl;
				}
				else
				{
					cout << "An error has ocurred and the XP could not be written!!" << endl;
				}
				CloseHandle(hProcess);
				
			}
		}
		cin.get();

	}
	return 0;
}

HANDLE WINAPI GetCurrentProcess(void);

DWORD WINAPI GetCurrentProcessId(void);

BOOL WINAPI WriteProcessMemory(
	_In_   HANDLE hProcess,
	_In_   LPVOID lpBaseAddress,
	_In_   LPCVOID lpBuffer,
	_In_   SIZE_T nSize,
	_Out_  SIZE_T *lpNumberOfBytesWritten
	);

HANDLE WINAPI OpenProcess(
	_In_  DWORD dwDesiredAccess,
	_In_  BOOL bInheritHandle,
	_In_  DWORD dwProcessId
	);

BOOL IsProcessRunning(DWORD pid)
{
	HANDLE process = OpenProcess(SYNCHRONIZE, FALSE, pid);
	DWORD ret = WaitForSingleObject(process, 0);
	CloseHandle(process);
	return ret == WAIT_TIMEOUT;
}
...I had to create LPCWSTR "variable"...

But now I have another problem.. in here "if (WriteProcessMemory(hProcess, (LPVOID)0x01B2C89C, &XP, newdatasize, NULL))
{
cout << "The XP Has been sucessfully written as : " + XP << endl;
}
else
{
cout << "An error has ocurred and the XP could not be written!!" << endl;
}"

The messages (cout´s) aren´t appearing.. the XP Changes but none a error or success message appears...

Also it was more of a distraction other than a "lack" of programming experience, because I think i am experienced enough to know that strings need quotes (irony because everyone knows that)

btw it is not an error its a "bug" when running the app the messages dont appear
Quote Originally Posted by MW2TopTenWORLD View Post
I actually fixed it... but now I have another problem...



Code:
#include <iostream>
#include <windows.h>
#include <string>
#include <cstdio>




using namespace std;

int main()
{
	system("color 0A");
	cout << "Call of Duty : Modern Warfare 2 Steam Tool - Made by MW2TopTenWORLD!\n" << endl;
	cout << "Research made for Steam version of the game \"1.2.208\"\n" << endl;
	cout << "Research by : MW2TopTenWORLD\n" << endl;
	cout << "There will be no updates to this program! This will only be a stats tool!!\n" << endl;
	LPCWSTR ProcessName222 = L"Modern Warfare 2";
	
	HWND hwnd = FindWindow(0, ProcessName222);
	if (hwnd == 0)
	{
		cout << "Call of Duty : Modern Warfare 2 was NOT Found!! Make sure the game is opened before opening this tool...\nThe tool will exit so you can Open the game...";
		std::getchar();
	}
	else
	{
		DWORD process_ID;
		GetWindowThreadProcessId(hwnd, &process_ID);
		HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, process_ID);
		cout << "Call of Duty : Modern Warfare 2 Was FOUND!... Welcome to my tool..." << endl;
		system("Pause");
		int Option;
		cout << "Pick what you want to mod...\nType 1 for XP\nType 2 for Score\nType 3 for Wins\nType 4 for Losses\nType 5 for Ties\nType 6 for Win Streak\nType 7 for Kills\nType 8 for Headshots\nType 9 for Assists\nType 10 for Killstreak\nType 11 for Deaths\nType 12 for Prestige\nType 13 for INSANE STATS!\n";
		cout << "Type what you want : ";
		
		cin >> Option;
		cin.ignore();
		if (Option > 13)
		{
			cout << "There is no option higher than 13.... Dumbass!" << endl;
		}
		else
		{
			if (Option == 1){
				cout << "What do you want to set your XP as?" << endl;
				cout << "Type what XP you want : ";
				int XP;
				cin >> XP;
				cin.ignore();
				
				DWORD newdatasize = sizeof(XP);
				if (WriteProcessMemory(hProcess, (LPVOID)0x01B2C89C, &XP, newdatasize, NULL))
				{
					cout << "The XP Has been sucessfully written as : " + XP << endl;
				}
				else
				{
					cout << "An error has ocurred and the XP could not be written!!" << endl;
				}
				CloseHandle(hProcess);
				
			}
		}
		cin.get();

	}
	return 0;
}

HANDLE WINAPI GetCurrentProcess(void);

DWORD WINAPI GetCurrentProcessId(void);

BOOL WINAPI WriteProcessMemory(
	_In_   HANDLE hProcess,
	_In_   LPVOID lpBaseAddress,
	_In_   LPCVOID lpBuffer,
	_In_   SIZE_T nSize,
	_Out_  SIZE_T *lpNumberOfBytesWritten
	);

HANDLE WINAPI OpenProcess(
	_In_  DWORD dwDesiredAccess,
	_In_  BOOL bInheritHandle,
	_In_  DWORD dwProcessId
	);

BOOL IsProcessRunning(DWORD pid)
{
	HANDLE process = OpenProcess(SYNCHRONIZE, FALSE, pid);
	DWORD ret = WaitForSingleObject(process, 0);
	CloseHandle(process);
	return ret == WAIT_TIMEOUT;
}
...I had to create LPCWSTR "variable"...

But now I have another problem.. in here "if (WriteProcessMemory(hProcess, (LPVOID)0x01B2C89C, &XP, newdatasize, NULL))
{
cout << "The XP Has been sucessfully written as : " + XP << endl;
}
else
{
cout << "An error has ocurred and the XP could not be written!!" << endl;
}"

The messages (cout´s) aren´t appearing.. the XP Changes but none a error or success message appears...

Also it was more of a distraction other than a "lack" of programming experience, because I think i am experienced enough to know that strings need quotes (irony because everyone knows that)

btw it is not an error its a "bug" when running the app the messages dont appear

btw, "That didn´t fixed it...." doesn't tell me s***.
(and you *don't* have to create the lpcwstring variable ..you could just pass in the string literal L"your_title_here")

edit: it's corrupting the stack somehow
it's something to do w/ how you define the OpenProcess() and WriteProcessMemory() functions below int main()...
I don't understand why you're re-declaring them..you're including Windows.h, which has them.
Something is un-balancing the stack, ie. your function expects parameters to be a certain size, and you call the function passing in a different size.
If they're supposed to be prototypes, why aren't they above int main() ? Commenting out the declarations for OpenProcess() and WriteProcessMemory() compiles / no bugs / shows the cout's correctly. I think it has something to do w/ the difference between the WriteProcessMemory() nSize parameter being DWORD vs. SIZE_T? I think the compiler will automatically side/up-cast the dword parameter to a size_t, but not sure - Apparently not. (?) Oddly enough, after I got it working, I uncommented the 2 function declarations and it still works. I modified your code as little as possible to make it work w/ 'calculator'
Code:
#include <iostream>
#include <Windows.h>
#include <string>
#include <cstdio>




using namespace std;

int main()
{
	system("color 0A");
	LPCWSTR ProcessName222 = L"Calculator";
	HWND hwnd = FindWindowW(0, ProcessName222);
	if (hwnd == 0)
	{
		cout << "Call of Duty : Modern Warfare 2 was NOT Found!! Make sure the game is opened before opening this tool...\nThe tool will exit so you can Open the game...";
		std::getchar();
	}
	else
	{
		DWORD process_ID;
		GetWindowThreadProcessId(hwnd, &process_ID);
		HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, process_ID);
		cout << ProcessName222 << " FOUND!... Welcome to my tool..." << endl;
		system("Pause");
		int Option;
		cout << "Pick what you want to mod...\nType 1 for XP\nType 2 for Score\nType 3 for Wins\nType 4 for Losses\nType 5 for Ties\nType 6 for Win Streak\nType 7 for Kills\nType 8 for Headshots\nType 9 for Assists\nType 10 for Killstreak\nType 11 for Deaths\nType 12 for Prestige\nType 13 for INSANE STATS!\n";
		cout << "Type what you want : ";
		
		cin >> Option;
		cin.ignore();
		if (Option > 13)
		{
			cout << "There is no option higher than 13.... Dumbass!" << endl;
		}
		else
		{
			if (Option == 1){
				cout << "What do you want to set your XP at?" << endl;
				cout << "Type what XP you want : ";
				int XP;
				cin >> XP;
				cin.ignore();
				
				DWORD newdatasize = sizeof(XP);
				cout <<"About to call WPM()...\n\n" << endl;
				cout <<"sizeof(SIZE_T) = " << sizeof(SIZE_T) << "\n";
				cout <<"sizeof(void*) = " << sizeof(void*) << "\n";
				cout <<"sizeof(DWORD) = " << sizeof(DWORD) << "\n";
				cout <<"sizeof(XP-int) = " << sizeof(XP) << "\n" << endl;
				if (WriteProcessMemory(hProcess, (LPVOID)0x004D815C, &XP, newdatasize, NULL))
				{
					cout << "The XP Has been sucessfully written as : " << XP << endl;
				}
				else
				{
					cout << "An error has ocurred and the XP could not be written!!" << endl;
				}
				CloseHandle(hProcess);
			}
		}
		cin.get();
	}
	return 0;
}

HANDLE WINAPI GetCurrentProcess(void);

DWORD WINAPI GetCurrentProcessId(void);

BOOL  WINAPI WriteProcessMemory(
	_In_   HANDLE hProcess,
	_In_   LPVOID lpBaseAddress,
	_In_   LPCVOID lpBuffer,
	_In_   SIZE_T nSize,
	_Out_  SIZE_T *lpNumberOfBytesWritten
	);
	
HANDLE WINAPI  OpenProcess(
	_In_  DWORD dwDesiredAccess,
	_In_  BOOL bInheritHandle,
	_In_  DWORD dwProcessId
	);
	
BOOL IsProcessRunning(DWORD pid)
{
	HANDLE process = OpenProcess(SYNCHRONIZE, FALSE, pid);
	DWORD ret = WaitForSingleObject(process, 0);
	CloseHandle(process);
	return ret == WAIT_TIMEOUT;
}
-I'd erase the function declarations and let Windows.h take care of it. After erasing them and re-compiling I get this
32bit/64bit
Quote Originally Posted by abuckau907 View Post
btw, "That didn´t fixed it...." doesn't tell me s***.
(and you *don't* have to create the lpcwstring variable ..you could just pass in the string literal L"your_title_here")

edit: it's corrupting the stack somehow
it's something to do w/ how you define the OpenProcess() and WriteProcessMemory() functions below int main()...
I don't understand why you're re-declaring them..you're including Windows.h, which has them.
Something is un-balancing the stack, ie. your function expects parameters to be a certain size, and you call the function passing in a different size.
If they're supposed to be prototypes, why aren't they above int main() ? Commenting out the declarations for OpenProcess() and WriteProcessMemory() compiles / no bugs / shows the cout's correctly. I think it has something to do w/ the difference between the WriteProcessMemory() nSize parameter being DWORD vs. SIZE_T? Oddly enough, after I got it working, I uncommented the 2 function declarations and it still works. I modified your code as little as possible to make it work w/ 'calculator'
Code:
#include <iostream>
#include <Windows.h>
#include <string>
#include <cstdio>




using namespace std;

int main()
{
	system("color 0A");
	LPCWSTR ProcessName222 = L"Calculator";
	HWND hwnd = FindWindowW(0, ProcessName222);
	if (hwnd == 0)
	{
		cout << "Call of Duty : Modern Warfare 2 was NOT Found!! Make sure the game is opened before opening this tool...\nThe tool will exit so you can Open the game...";
		std::getchar();
	}
	else
	{
		DWORD process_ID;
		GetWindowThreadProcessId(hwnd, &process_ID);
		HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, process_ID);
		cout << ProcessName222 << " FOUND!... Welcome to my tool..." << endl;
		system("Pause");
		int Option;
		cout << "Pick what you want to mod...\nType 1 for XP\nType 2 for Score\nType 3 for Wins\nType 4 for Losses\nType 5 for Ties\nType 6 for Win Streak\nType 7 for Kills\nType 8 for Headshots\nType 9 for Assists\nType 10 for Killstreak\nType 11 for Deaths\nType 12 for Prestige\nType 13 for INSANE STATS!\n";
		cout << "Type what you want : ";
		
		cin >> Option;
		cin.ignore();
		if (Option > 13)
		{
			cout << "There is no option higher than 13.... Dumbass!" << endl;
		}
		else
		{
			if (Option == 1){
				cout << "What do you want to set your XP at?" << endl;
				cout << "Type what XP you want : ";
				int XP;
				cin >> XP;
				cin.ignore();
				
				DWORD newdatasize = sizeof(XP);
				cout <<"About to call WPM()...\n\n" << endl;
				cout <<"sizeof(SIZE_T) = " << sizeof(SIZE_T) << "\n";
				cout <<"sizeof(void*) = " << sizeof(void*) << "\n";
				cout <<"sizeof(DWORD) = " << sizeof(DWORD) << "\n";
				cout <<"sizeof(XP-int) = " << sizeof(XP) << "\n" << endl;
				if (WriteProcessMemory(hProcess, (LPVOID)0x004D815C, &XP, newdatasize, NULL))
				{
					cout << "The XP Has been sucessfully written as : " << XP << endl;
				}
				else
				{
					cout << "An error has ocurred and the XP could not be written!!" << endl;
				}
				CloseHandle(hProcess);
			}
		}
		cin.get();
	}
	return 0;
}

HANDLE WINAPI GetCurrentProcess(void);

DWORD WINAPI GetCurrentProcessId(void);

BOOL  WINAPI WriteProcessMemory(
	_In_   HANDLE hProcess,
	_In_   LPVOID lpBaseAddress,
	_In_   LPCVOID lpBuffer,
	_In_   SIZE_T nSize,
	_Out_  SIZE_T *lpNumberOfBytesWritten
	);
	
HANDLE WINAPI  OpenProcess(
	_In_  DWORD dwDesiredAccess,
	_In_  BOOL bInheritHandle,
	_In_  DWORD dwProcessId
	);
	
BOOL IsProcessRunning(DWORD pid)
{
	HANDLE process = OpenProcess(SYNCHRONIZE, FALSE, pid);
	DWORD ret = WaitForSingleObject(process, 0);
	CloseHandle(process);
	return ret == WAIT_TIMEOUT;
}
-I'd erase the function declarations and let Windows.h take care of it.

Thank you .. I made the messages appear by removing the "+ XP" because apparently it was << XP (the + XP i did it because of C# lol) however thanks for the Erase the function declaration tip!
lol I was just about to say. I changed it in my version : p I thought the string class might handle that correctly, but wasn't sure. Glad you found it.

edit: Not sure why i was stuck on the sizeof() thing...usually it's the culprit for unbalanced stack (?). So apparently the + operator for the string class is trying to convert 'XP' to a string ..I thought it would simply convert the 4 bytes into it's string-numeric representation as a string(in C#, "XP.ToString()"). Apparently it's reading nn number of bytes, starting at the &XP, and continuing until it encounters a 0 byte.
try HWND hwnd = FindWindow(NULL, "window caption");

Should be NULL I believe.

* sorry didn't see you had all ready got an answer.
Quote Originally Posted by eXflux View Post
try HWND hwnd = FindWindow(NULL, "window caption");

Should be NULL I believe.

* sorry didn't see you had all ready got an answer.
NULL is a #define for 0. Pre-compiler replaces any/every occurance of 'NULL' with '0'.
If I had the source code for a game, how could I use it to my advantage to hack?

I'm sorry if this is a noob question.
SORRY FOR MY ENGLISH!!


i complete my C language
Q1: Is there any large difference between C language and C++ language???
Q2: what if i start Java now??
Q3: should i have to learn C++ even if i know C?
Q4: can you give code for editing any process for program C
i want to play with pointer of minesweeper and solitaire
Quote Originally Posted by wildkillerr View Post
SORRY FOR MY ENGLISH!!


i complete my C language
Q1: Is there any large difference between C language and C++ language???
Q2: what if i start Java now??
Q3: should i have to learn C++ even if i know C?
Q4: can you give code for editing any process for program C
i want to play with pointer of minesweeper and solitaire
1. Yes. Cpp has every feature of c. And a lot more. C is "a subset" of cpp. Cpp contains the entire definition of c.
2. Youll know java soon? Its a good language to start in, and many of the 'concepts' will be universal to other programming languages.
3. No. Depends on the hack and how much code you want to write from scratch. If you already know c, learning cpp is entirely possible.
4. Sry no, I dont have.
Me too.
Quote Originally Posted by abuckau907 View Post
1. Yes. Cpp has every feature of c. And a lot more. C is "a subset" of cpp. Cpp contains the entire definition of c.
2. Youll know java soon? Its a good language to start in, and many of the 'concepts' will be universal to other programming languages.
3. No. Depends on the hack and how much code you want to write from scratch. If you already know c, learning cpp is entirely possible.
4. Sry no, I dont have.
Me too.
Thanks,
but i want hack simple games...
either i will loss my interest in hacking
that's why i want to hack any thing...
This thread was made on my bday leel
Thank you, this is very useful.
Thank you in advance.
I've got several questions.

I am ready to learn Windows System now.I want to know which sections below is necessary ,which is not necessary but suggested,which is completely useless to hack.

1.Using the Windows File System and Character I/O
2.Advanced File and Directory Processing,and the Registry
3.Exception Handling
4.Memory Management,Memory-Mapped Files.and Dlls
5.Process Management
6.Threads and scheduling
7.Thread Synchronization
8.Locking ,Performance and NT6 Enhancements
9.Advanced Thread Synchronization
10.Interprocess Communication
11.Network Program with Windows Sockets
12.Windows Services
13.Asynchronous Input/Output and Completion Ports
14.Securing Windows Objests
Thank you sir! I found this very informative, and I think it will greatly help me in my coming months as I try to get into scripting/coding/programming/hacking .
Posts 61–75 of 108 · Page 5 of 8

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?