Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


how convert DupeX to c++ help

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
sylvanus
Advanced Cheater
Reputation: 0

Joined: 09 May 2006
Posts: 68

PostPosted: Sat Sep 13, 2008 4:15 pm    Post subject: how convert DupeX to c++ help Reply with quote

[enable]
alloc(FindCharacterAddress, 1024) -|
alloc(ListOffset, 4) |
alloc(ESIList, 1024) |
alloc(DupeXVac, 1024) |----> 1) are CODECAVES in c++?
alloc(EDIValue, 4) |
alloc(dupex,64) |but, edivalue , ListOffset = 4 bytes = DWORD variable?
alloc(address,4) -|
registersymbol(address)
registersymbol(FindCharacterAddress) ---> 2) are variables DWORD = address memory??
registersymbol(ListOffset)
label(disablez) ---|
label(on) |
label(vac) |
label(EndSearch) |----> labels in c++ sure?
label(CompareOffset) |
label(StoreESI) |
label(DoNormal) ---| OR UNIQUE CODE CAVE IS "all script complete" ??

FindCharacterAddress: //codecave
mov [esi+114],edi

push eax
push ebx
push ecx
push edx

mov eax,0
mov ebx,ListOffset
mov ecx,ESIList
mov edx,EDIValue

CompareOffset: ------------> (label)
cmp eax,[ebx]
je StoreESI
cmp esi,[ecx+eax*4]
je EndSearch
inc eax
jmp CompareOffset

StoreESI: (label)
mov [ecx+eax*4],esi
inc eax
mov [ebx],eax
mov [edx],edi

EndSearch: -----------------> (label)
pop edx
pop ecx
pop ebx
pop eax
jmp 00741E72


DupeXVac: // CODECAVE
push eax
push ebx
push ecx

mov ebx,[ListOffset]
dec ebx
mov ecx,ESIList
mov eax,[ecx+ebx*4]

cmp esi,eax
je DoNormal
mov edi,[EDIValue]

DoNormal: -----------------> (label)
mov [esi+114],edi
pop eax
pop ebx
pop ecx
jmp 00741E72 //DupeX Addy +6

address:
db 00 00 00 00

00741E6C://Dupex Addy : 89 BE 14 01 00 00 EB ?? 83 7D ?? ?? 74 ?? 8B
jmp dupex --------------> OR START HERE SURE??
nop

dupex:
cmp [address],0
je disablez
cmp [address],1
je on
cmp [address],2
je vac

disablez: -----------------> (label)
mov [esi+00000114],edi
jmp 00741E72 //1 addy under dupex

on: (label)
jmp FindCharacterAddress

vac: ----------------------> (label)
jmp DupeXVac


[disable]
00741E6C:
mov [esi+00000114],edi
dealloc(FindCharacterAddress, 1024)
dealloc(ListOffset)
dealloc(ESIList)
dealloc(DupeXVac)
dealloc(EDIValue)

unregistersymbol(FindCharacterAddress)
unregistersymbol(ListOffset)

Example : is this correct?


DWORD ReturnMe = 0; // ADDRESS OF RETURN

//this are registersymbol ?

DWORD EdiValue = 0
DWORD ListOffset = 0

#define JMP(frm, to) (int)(((int)to - (int)frm) - 5);

static const FARPROC Vprotect = (FARPROC)((DWORD)GetProcAddress(GetModuleHandleA("kernel32.dll"), "VirtualProtectEx")+5);
_declspec(naked) BOOL WINAPI FixMem(HANDLE hProcess, LPVOID lpAddress, SIZE_T dwSize, DWORD flNewProtect, PDWORD lpflOldProtect)
{
_asm
{
mov edi,edi
push ebp
mov ebp,esp
jmp Vprotect
}
}

__declspec(naked) void FindCharacterAddress()
{
__asm
{
pop [ReturnMe]
FindCharacterAddress:
mov [esi+114],edi

push eax
push ebx
push ecx
push edx

mov eax,0
mov ebx,ListOffset
mov ecx,ESIList
mov edx,EDIValue

CompareOffset:
cmp eax,[ebx]
je StoreESI
cmp esi,[ecx+eax*4]
je EndSearch
inc eax
jmp CompareOffset

StoreESI: (label)
mov [ecx+eax*4],esi
inc eax
mov [ebx],eax
mov [edx],edi

EndSearch:
pop edx
pop ecx
pop ebx
pop eax
jmp 00741E72
}
}

__declspec(naked) void DupeXVac()
{
__asm
{
DupeXVac:
push eax
push ebx
push ecx

mov ebx,[ListOffset]
dec ebx
mov ecx,ESIList
mov eax,[ecx+ebx*4]

cmp esi,eax
je DoNormal
mov edi,[EDIValue] // edivalue = dword variable?, or other codecave?

DoNormal:
mov [esi+114],edi
pop eax
pop ebx
pop ecx
jmp 00741E72 //DupeX Addy +6

}
}

__declspec(naked) void address()
{
__asm
{
address:
db 00 00 00 00
}
}


// this is call dupex in c++
//00741E6C://Dupex Addy : 89 BE 14 01 00 00 EB ?? 83 7D ?? ?? 74 ?? 8B
//jmp dupex
//nop



__declspec(naked) void dupex()
{
__asm
{

dupex:
cmp [address],0
je disablez
cmp [address],1
je on
cmp [address],2
je vac

disablez:
mov [esi+00000114],edi
jmp 00741E72 //1 addy under dupex

on: (label)
jmp FindCharacterAddress

vac: (label)
jmp DupeXVac

}
}
//call dupex ?
FixMem(GetCurrentProcess(), (void*)DUPEXADDY, 5, PAGE_EXECUTE_READWRITE, (DWORD*)oldprot);
*(BYTE*)DUPEXADDY = 0xE8; // call
*(DWORD*)(DUPEXADDY + 1) = JMP(DUPEXADDY, dupex); // address of my dupexvac
Back to top
View user's profile Send private message
GMZorita
Grandmaster Cheater Supreme
Reputation: 0

Joined: 21 Mar 2007
Posts: 1361

PostPosted: Sat Sep 13, 2008 4:58 pm    Post subject: Reply with quote

Just the codecave didn't tryed but it is supose to work if what you posted is right.
Code:

int address = 0;
int ListOffset = 0;
int ESIList = 0;
int EDIValue = 0;
void __declspec(naked) __stdcall DupeXCave(){

_asm{
mov [esi+114],edi

push eax
push ebx
push ecx
push edx

mov eax,0
mov ebx,ListOffset
mov ecx,ESIList
mov edx,EDIValue

CompareOffset:
cmp eax,[ebx]
je StoreESI
cmp esi,[ecx+eax*4]
je EndSearch
inc eax
jmp CompareOffset

StoreESI:
mov [ecx+eax*4],esi
inc eax
mov [ebx],eax
mov [edx],edi

EndSearch:
pop edx
pop ecx
pop ebx
pop eax
jmp retaddy


DupeXVac:
push eax
push ebx
push ecx

mov ebx,[ListOffset]
dec ebx
mov ecx,ESIList
mov eax,[ecx+ebx*4]

cmp esi,eax
je DoNormal
mov edi,[EDIValue]

DoNormal:
mov [esi+114],edi
pop eax
pop ebx
pop ecx
jmp retaddy
}
}

_________________
Gone
Back to top
View user's profile Send private message
sylvanus
Advanced Cheater
Reputation: 0

Joined: 09 May 2006
Posts: 68

PostPosted: Sat Sep 13, 2008 11:04 pm    Post subject: Reply with quote

thanks zorita, but don't work

original code autoassembler is

Quote:

[enable]
alloc(FindCharacterAddress, 1024)
alloc(ListOffset, 4)
alloc(ESIList, 1024)
alloc(DupeXVac, 1024)
alloc(EDIValue, 4)
alloc(dupex,64)
alloc(address,4)
registersymbol(address)
registersymbol(FindCharacterAddress)
registersymbol(ListOffset)
label(disablez)
label(on)
label(vac)
label(EndSearch)
label(CompareOffset)
label(StoreESI)
label(DoNormal)

FindCharacterAddress:
mov [esi+114],edi

push eax
push ebx
push ecx
push edx

mov eax,0
mov ebx,ListOffset
mov ecx,ESIList
mov edx,EDIValue

CompareOffset:
cmp eax,[ebx]
je StoreESI
cmp esi,[ecx+eax*4]
je EndSearch
inc eax
jmp CompareOffset

StoreESI:
mov [ecx+eax*4],esi
inc eax
mov [ebx],eax
mov [edx],edi

EndSearch:
pop edx
pop ecx
pop ebx
pop eax
jmp 00741E72


DupeXVac:
push eax
push ebx
push ecx

mov ebx,[ListOffset]
dec ebx
mov ecx,ESIList
mov eax,[ecx+ebx*4]

cmp esi,eax
je DoNormal
mov edi,[EDIValue]

DoNormal:
mov [esi+114],edi
pop eax
pop ebx
pop ecx
jmp 00741E72 //DupeX Addy +6

address:
db 00 00 00 00

00741E6C: //Dupex Addy
jmp dupex <--- here start code sure (dupex)??
nop

dupex:
cmp [address],0
je disablez
cmp [address],1
je on
cmp [address],2
je vac

disablez:
mov [esi+00000114],edi
jmp 00741E72 //1 addy under dupex

on:
jmp FindCharacterAddress

vac:
jmp DupeXVac


[disable]
00741E6C:
mov [esi+00000114],edi
dealloc(FindCharacterAddress, 1024)
dealloc(ListOffset)
dealloc(ESIList)
dealloc(DupeXVac)
dealloc(EDIValue)

unregistersymbol(FindCharacterAddress)
unregistersymbol(ListOffset)


i look SWITCH in

dupex:
cmp [address],0
je disablez
cmp [address],1
je on
cmp [address],2
je vac

i am trying this method
but don't work


Quote:

int address = 0;
int ListOffset = 0;
int ESIList = 0;
int EDIValue = 0;

__declspec(naked) void dupexvac()
{
__asm
{
pop [Regreso]
cmp [address],0
je disablez
cmp [address],1
je on
cmp [address],2
je vac
disablez:
mov [esi+00000114],edi
jmp Retaddy //1 addy under dupex

on:
jmp FindCharacterAddress

vac:
jmp DupeXVac

FindCharacterAddress:
mov [esi+114],edi
push eax
push ebx
push ecx
push edx

mov eax,0
mov ebx,ListOffset
mov ecx,ESIList
mov edx,EDIValue

CompareOffset:
cmp eax,[ebx]
je StoreESI
cmp esi,[ecx+eax*4]
je EndSearch
inc eax
jmp CompareOffset

StoreESI:
mov [ecx+eax*4],esi
inc eax
mov [ebx],eax
mov [edx],edi

EndSearch:
pop edx
pop ecx
pop ebx
pop eax
jmp Retaddy

DupeXVac:
push eax
push ebx
push ecx

mov ebx,[ListOffset]
dec ebx
mov ecx,ESIList
mov eax,[ecx+ebx*4]

cmp esi,eax
je DoNormal
mov edi,[EDIValue]

DoNormal:
mov [esi+114],edi
pop eax
pop ebx
pop ecx
jmp Retaddy //DupeX Addy +6
push [Regreso]
}
}



codecave execute ok, but when i move my charcter, crash!
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sun Sep 14, 2008 11:35 am    Post subject: Reply with quote

i'm not that pro with inline asm but for the codecave dont u need to allocate memory with VirtualAllocEx ? (just wondering) o_o
_________________
Stylo
Back to top
View user's profile Send private message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Sun Sep 14, 2008 1:09 pm    Post subject: Reply with quote

Lol you cant use asm to do that u need to use rpm or the (*Byte)* thingy where u write to bytes.

So... You need to:
Convert eh entire script into bytes
(How I do it is put the crap into ce and copy the bytes from there)

Step 2 move all the bytes into memory
In delphi u use:
$pbytearray1=pointer($startaddr);
$pbytearray1[0]=:$firstbyye;
... etc

C++ idk cause I suck horribly at C++.

Step 3 create a jump into your cc by using a long jump calculation.
Back to top
View user's profile Send private message
GMZorita
Grandmaster Cheater Supreme
Reputation: 0

Joined: 21 Mar 2007
Posts: 1361

PostPosted: Sun Sep 14, 2008 1:21 pm    Post subject: Reply with quote

dnsi0 wrote:
Lol you cant use asm to do that u need to use rpm or the (*Byte)* thingy where u write to bytes.

So... You need to:
Convert eh entire script into bytes
(How I do it is put the crap into ce and copy the bytes from there)

Step 2 move all the bytes into memory
In delphi u use:
$pbytearray1=pointer($startaddr);
$pbytearray1[0]=:$firstbyye;
... etc

C++ idk cause I suck horribly at C++.

Step 3 create a jump into your cc by using a long jump calculation.

Just ignore what dnsi0 said.
Since your using a DLL you wont need to VirtualAllocEx etc...

You make the code cave and make the jump to it, if it is crashing when you move, its prolly something wrong with the script.

Try:
Code:

int address = 0;
int ListOffset = 0;
int ESIList = 0;
int EDIValue = 0;
void __declspec(naked) __stdcall DupeXCave(){

_asm{
mov [esi+0x114],edi

push eax
push ebx
push ecx
push edx

mov eax,0
mov ebx,ListOffset
mov ecx,ESIList
mov edx,EDIValue

CompareOffset:
cmp eax,[ebx]
je StoreESI
cmp esi,[ecx+eax*4]
je EndSearch
inc eax
jmp CompareOffset

StoreESI:
mov [ecx+eax*4],esi
inc eax
mov [ebx],eax
mov [edx],edi

EndSearch:
pop edx
pop ecx
pop ebx
pop eax
jmp retaddy


DupeXVac:
push eax
push ebx
push ecx

mov ebx,[ListOffset]
dec ebx
mov ecx,ESIList
mov eax,[ecx+ebx*4]

cmp esi,eax
je DoNormal
mov edi,[EDIValue]

DoNormal:
mov [esi+0x114],edi
pop eax
pop ebx
pop ecx
jmp retaddy
}
}

_________________
Gone
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites