I don't know if it's the fact I'm using VC++ 2008, but I'm getting a different plethora of fucking errors no matter what I use.
This is a nice little piece of shit I found from another website.
Code:
#include <windows.h>
#include <tlhelp32.h>
#include <conio.h>
#include <stdlib.h>
bool ChangeMemVal(const char * ProcessName, LPVOID MemAddress, int NewVal, int size);
void main()
{
printf("=== Pinball Trainer Example. Made by <your name here> ===nn");
if(ChangeMemVal("PINBALL.EXE", (void*) 0xA90C62, 100000000, 4))
printf("The score has been edited successfully.n");
else
printf("An error occured while attempting edit the score.n");
system("PAUSE");
return 0;
}
/* This function modifys a memory address according to its arguments.
Arguments :
ProcessName - the process we want to modify
MemAddress - the memory address we want to modify
NewVal - the value we want to change the memory address to
size - the size of the memory address
Returns :
the success of the edit.
*/
bool ChangeMemVal(const char * ProcessName, LPVOID MemAddress, int NewVal, int size)
{
HANDLE hProcessSnap;
HANDLE hProcess = NULL;
PROCESSENTRY32 pe32;
hProcessSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
pe32.dwSize = sizeof( PROCESSENTRY32 );
Process32First(hProcessSnap, &pe32);
do
{
if(!strcmp(pe32.szExeFile, ProcessName))
{
hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pe32.th32ProcessID);
break;
}
}
while(Process32Next(hProcessSnap, &pe32));
CloseHandle( hProcessSnap );
if(hProcess != NULL)
{
WriteProcessMemory(hProcess, MemAddress, &NewVal, size, NULL); // write the value
CloseHandle(hProcess);
return true;
}
return false;
}
Now, the first error that C++ will be lolling at me for is having two of the same fucking function. I know what a goddamn overload is, but that doesn't help me at all when it is properly constructed but doesn't fucking work. So I'm going to knock out that first line out of the Angry First of God.
The next and last one is what pisses me off. I don't know what Bill and his assblasters were thinking when they decided C++ lacks any ability to convert jack shit to another pile of jack fucking shit, but It's making me want to blow my fucking brains out all of the fucking floor.
UNABLE TO CONVERT WCHAR[260] TO CONST CHAR * LOLOLOLOL FUCK YOU, END USER!
If you can find a solution to this stupid shit I will suck your dick.