 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
ginocapo How do I cheat?
Reputation: 0
Joined: 01 Mar 2012 Posts: 6
|
Posted: Thu Mar 01, 2012 3:22 pm Post subject: [HELP]C++ Writting memory address |
|
|
Hello. Im making a game trainer, but i get lost in a part. I wanna "Write" a memory address which is "Text" type, and i dunno how to do this, i tried 500 ways, but neither work.
Im using Dev C++, and here is my code:
DWORD MyChar = char("im Cheater !!");
WriteProcessMemory(hOpen, Addr, &MyChar, 1, 0);
I even tried :
char MyChar[70] = "im Cheater!!";
hOpen is an already open process, war3.exe.
if you can help me on Write an "Text" memory value, i would be gratefull.
Thanks.
|
|
| Back to top |
|
 |
sherwood Newbie cheater
Reputation: 0
Joined: 06 Feb 2012 Posts: 11
|
Posted: Thu Mar 01, 2012 3:33 pm Post subject: |
|
|
MSVC code
| Code: |
#include <windows.h>
#include <tlhelp32.h>
#include <conio.h>
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
bool Address1(const char * ProcessName, LPVOID MemoryAddress, const char * NewValue, int size);
int main()
{
printf("Welcome to....\n\n");
if(Address1("GAMENAME.exe", (void*) 0x02507CA8, "txt", 3));
printf("Patched without errors.\n");
else
printf("Something went wrong!\n");
system("pause");
return 0;
}
bool Address1(const char * ProcessName, LPVOID MemoryAddress, const char * NewValue, 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_VM_READ | PROCESS_VM_WRITE | PROCESS_VM_OPERATION, FALSE, pe32.th32ProcessID);
break;
}
}
while(Process32Next(hProcessSnap, &pe32));
CloseHandle( hProcessSnap );
if(hProcess != NULL)
{
WriteProcessMemory(hProcess, MemoryAddress, NewValue, size, NULL);
CloseHandle(hProcess);
return true;
}
return false;
}
|
|
|
| Back to top |
|
 |
ginocapo How do I cheat?
Reputation: 0
Joined: 01 Mar 2012 Posts: 6
|
Posted: Fri Mar 02, 2012 3:33 pm Post subject: ty |
|
|
| THX!! thanks so much, your code works fine !!
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|