Solved Cheatengine to C++

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat
Status
Not open for further replies.

angelo007

Newbie
Full Member
Aug 11, 2012
13
252
0
i want to convert my AutoAssembler Script to C++ to use in my trainer how can i do that?
 

angelo007

Newbie
Full Member
Aug 11, 2012
13
252
0
for example this : [ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,2048) //2kb should be enough
label(returnhere)
label(originalcode)
label(exit)

newmem: //this is allocated memory, you have read,write,execute access
//place your code here
mov [esi+24],(float)99999
originalcode:
NOP

exit:
jmp returnhere

"x2.exe"+29387C:
jmp newmem
nop
returnhere:




[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
"x2.exe"+29387C:
fstp dword ptr [esi+24]
lea edx,[ecx+ecx]
//Alt: db D9 5E 24 8D 14 09
 

c5

Kim Kong Trasher
Dank Tier VIP
Dank Tier Donator
Jul 19, 2012
1,188
12,638
76
When you browse the memory region with CE for example, on the left hand side right next to the 'Address'es is a column 'Bytes'. Now, sorry but I don't have more time, I'll be back later, try to figure it out :p It's nothing complicated. Look at the address and the bytes for it before patching, write bytes down, patch the address, look at the bytes again, notice - they changed, now you make a trainer which uses writeprocessmemory to write those bytes onto those addresses :D Oh hell I sound ... phhh I hope you get it ;) :D
 

BlackPitchPL

Coder
Full Member
Nobleman
May 24, 2012
166
783
1
and you do it by this :p :
C++:
#pragma once

class cPatch
{
private:
	DWORD  ADR;
	BYTE	OFF_BYTES[255];
	BYTE  ON_BYTES[255];
	int		SIZE;
	enum	PATCHSTATUS
	{
		NORMAL,
		PATCHED,
	};
	int		STATUS;

	void*	memcpy_s(void* pvAddress, const void* pvBuffer, size_t stLen);
public:
	cPatch(DWORD pAdr,BYTE* pByte,int pSize);
	void Patch();
	void Restore();
};
and cpp to use it
C++:
#include "cPatch.h"


 
void* cPatch::memcpy_s(void *pvAddress, const void *pvBuffer, size_t stLen)
{
	MEMORY_BASIC_INFORMATION mbi;
	VirtualQuery( ( void* )pvAddress, &mbi, sizeof( mbi ) );
	VirtualProtect( mbi.BaseAddress, mbi.RegionSize, PAGE_EXECUTE_READWRITE, &mbi.Protect );
	void* pvRetn = memcpy( ( void* )pvAddress, ( void* )pvBuffer, stLen );
	VirtualProtect( mbi.BaseAddress, mbi.RegionSize, mbi.Protect, &mbi.Protect );
	FlushInstructionCache( GetCurrentProcess( ), ( void* )pvAddress, stLen );
	return pvRetn;
}
                         
cPatch::cPatch(DWORD pAdr,BYTE* pByte,int pSize)
{
	STATUS	=	NORMAL;
	SIZE	=	pSize;
	ADR		=	pAdr;
	
	for(int i = 0; i < pSize; i++)
	{
		OFF_BYTES[i]	=	0x00;
		ON_BYTES[i]		=	pByte[i];
	}
}
 
void cPatch::Patch()
{
	if( STATUS==NORMAL )
	{
		BYTE *pOFF_BYTES = (BYTE*)ADR;
		for( int i = 0; i < SIZE; i++ )
		{
			OFF_BYTES[i] = pOFF_BYTES[i];
		}
		memcpy_s((void*)ADR,(const void*)ON_BYTES,SIZE);
		STATUS=PATCHED;
	}
}
void cPatch::Restore()
{
	if(STATUS==PATCHED)
	{
		memcpy_s((void*)ADR,(const void*)OFF_BYTES,SIZE);
		STATUS=NORMAL;
	}
}
That's all you only need to define ur addy to change and define what to change like cPatch uammo (ADR_UAMMO,(BYTE* )" \x90\x90\x90\x90\x90\x90",6 ) ;
 
Status
Not open for further replies.
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods League of Legends Accounts