|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
CityOfTheIris Newbie cheater Reputation: 0
Joined: 18 Sep 2016 Posts: 16
|
Posted: Tue Jan 24, 2017 2:48 am Post subject: [C++] Write a value to 4Bytes |
|
|
Code: |
// FramelimiterASI.cpp : Defines the exported functions for the DLL application.
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
DWORD WINAPI LoopFunction( LPVOID lpParam )
{
Sleep(10000);
HANDLE gta3 = GetCurrentProcess();
BYTE Peds = {1431787091};
WriteProcessMemory(gta3,(void*)(0x04F4AB0),&Peds,1,0);
Sleep(200);
return 0;
}
BOOL WINAPI DllMain(HINSTANCE hModule, DWORD dwAttached, LPVOID lpvReserved)
{
if (dwAttached == DLL_PROCESS_ATTACH) {
CreateThread(NULL,0,&LoopFunction,NULL,0,NULL);
}
return 1;
}
|
I want to set 4bytes (CE address from gta 3) in C++, but this only adds bytes and crashes my game
http://imgur.com/a/4UlyR
it just doesnt set to the value of what i want
how ?
|
|
Back to top |
|
|
atom0s Moderator Reputation: 198
Joined: 25 Jan 2006 Posts: 8516 Location: 127.0.0.1
|
Posted: Tue Jan 24, 2017 2:00 pm Post subject: |
|
|
Since you are injected, don't use WriteProcessMemory, it is a waste of resources and pointless. You can do direct casting to the data instead.
Code: | *(DWORD*)(0x04F4AB0) = 1431787091; |
Multiple parts of your code are wrong as well, you should probably go back and learn what you are doing first.
_________________
- Retired. |
|
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
|
|