peter4d5 Cheater
Reputation: 0
Joined: 21 Dec 2010 Posts: 37
|
Posted: Thu May 16, 2013 1:06 pm Post subject: [Help] Transate CT to Delphi |
|
|
I try to translate CT Table to delphi unit(dll),when be a script it work well (adapt from recifense's)
but can't compile .pas. Anyone help please.
CE is the best tool for trainer but i want to use this code as a part of d3d hook.
If use as separate dll,delphi can't compiled if refer to pBuffer.
| Code: |
[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,2048) //2kb should be enough
alloc(Data,4096)
label(returnhere)
label(originalcode)
label(exit)
label(Index)
label(pBuffer)
label(IfAlreadySave)
label(SaveAddList)
label(Loop)
label(Loop2)
label(CheckHealth)
registersymbol(Index)
registersymbol(pBuffer)
registersymbol(Data)
newmem: //this is allocated memory, you have read,write,execute access
//place your code here
push ecx
push eax
test esi,esi
jz originalcode
lea ecx,[esi]
mov eax,[Index]
test eax,eax // index=0,first address
jnz IfAlreadySave // index>0,cheak if already save
SaveAddList:
mov eax,[Index]
mov [eax*4+pBuffer],ecx
inc eax
mov [Index],eax
jmp CheckHealth
//check if Already Save
IfAlreadySave:
;
;
;
//---- variable
Index:
dd 0
//---- Data area
Data:
pBuffer:
;
;
;
unregistersymbol(Index)
unregistersymbol(pBuffer)
unregistersymbol(Data)
|
| Code: |
procedure Update_Add;
var BaseAdd,Data : cardinal;
Index : integer;
label originalcode;
label IfAlreadySave;
label SaveAddList;
label CheckHealth;
label pBuffer; <===== error
begin
Data := LocalAlloc(LMEM_ZEROINIT,4096);
Index := LocalAlloc(LMEM_ZEROINIT,4);
asm // correct..?
@Data:
@pBuffer:
end;
while 1=1 do
begin
asm
push ecx
push eax
mov eax,[$004A6850]
mov BaseAdd,eax
test eax,eax
jz @originalcode
// lea ecx,[esi] = mov BaseAdd,[004A6850]
mov ecx,BaseAdd
mov eax,[Index]
test eax,eax // index=0,first address
jnz @IfAlreadySave // index>0,cheak if already save <===== error
@SaveAddList:
mov eax,[Index]
mov [eax*4+pBuffer],ecx <===== error
inc eax
mov [Index],eax
jmp @CheckHealth
@CheckHealth:
;
;
@originalcode:
end
end;
end;
end.
|
_________________
my name is peter4d5 |
|