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 


[Help] Transate CT to Delphi

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

Joined: 21 Dec 2010
Posts: 37

PostPosted: Thu May 16, 2013 1:06 pm    Post subject: [Help] Transate CT to Delphi Reply with quote

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
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