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 


dear,Dark byte,frmModifyRegistersUnit.pas ?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Source
View previous topic :: View next topic  
Author Message
Anuonuo
Newbie cheater
Reputation: 0

Joined: 23 Jul 2006
Posts: 11

PostPosted: Wed Apr 01, 2009 4:17 pm    Post subject: dear,Dark byte,frmModifyRegistersUnit.pas ? Reply with quote

I am a CE fan, enjoy DELPHI programming language, I think the CE from the original code you extracted frmModifyRegistersUnit.pas this code, make a separate function,However, I encountered much trouble, the main source of the data structure and function of each call is very difficult to extract, you can not easy to explain ~ Do not need to extract those parts of the ~
[/code]
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25788
Location: The netherlands

PostPosted: Wed Apr 01, 2009 4:25 pm    Post subject: Reply with quote

You could look into the plugin exports part of ce's sourcecode and try calling those functions.

ce_ChangeRegistersAtAddress uses a structure you can fill in instead of a long parameter list

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Anuonuo
Newbie cheater
Reputation: 0

Joined: 23 Jul 2006
Posts: 11

PostPosted: Wed Apr 01, 2009 5:17 pm    Post subject: Reply with quote

Me give you a reference, I spent a day when the revised code ~ ~
However, no effect ~ ~
Code:

  if DebuggerThread2=nil then//Direct uses DebuggerThread2
      DebuggerThread2:=TDebugEvents.Create(false);
      //crdebugging.Enter;
      drnr:=-1;
      for i:=0 to 3 do
        if debuggerthread2.breakpoints[i]=0 then   //free to use
        begin
          debuggerthread2.breakpoints[i]:=address;

          ChangeRegOnBP(GetCurrentProcess(),address,i,tempregedit.change_eax,tempregedit.change_ebx,tempregedit.change_ecx,tempregedit.change_edx,tempregedit.change_esi,tempregedit.change_edi,tempregedit.change_ebp,tempregedit.change_esp,tempregedit.change_eip,tempregedit.change_cf,tempregedit.change_pf,tempregedit.change_af,tempregedit.change_zf,tempregedit.change_sf,tempregedit.change_of,
                                            tempregedit.new_eax,tempregedit.new_ebx,tempregedit.new_ecx,tempregedit.new_edx,tempregedit.new_esi,tempregedit.new_edi,tempregedit.new_ebp,tempregedit.new_esp,tempregedit.new_eip,tempregedit.new_cf,tempregedit.new_pf,tempregedit.new_af,tempregedit.new_zf,tempregedit.new_sf,tempregedit.new_of);

          debuggerthread2.breakpointchanges[i]:=tempregedit;
          debuggerthread2.setbreakpoints;
          drnr:=i;
          break;
        end;
end;


destructor TDebugEvents.destroy;
var i: integer;
begin
 CRDebugging.Enter;
  for i:=0 to 3 do
    breakpoints[i]:=0;
    CRDebugging.Leave;
  setbreakpoints;
  Terminate;
  waitfor;
  inherited destroy;
end;
------------------DebuggerThread2-  part2---------
constructor TDebugevents.create(suspended:boolean);
begin
  inherited create(suspended);
  debugregs.ContextFlags:=CONTEXT_DEBUG_REGISTERS;
  CreateSharedmemory('getthread');
  thread:=strtoint(ReadSharedmemory());
  showmessage(inttostr(thread));

end;
{function ToggleBreakpoint(address:dword):boolean;
{$ifndef net}
{procedure setbreakpoints;
var i: integer;
begin

    DRRegs.ContextFlags:=CONTEXT_DEBUG_REGISTERS;
    DRRegs.Dr7:=reg0set or reg1set or reg2set or reg3set;

    DRRegs.Dr0:=0;
    drregs.dr1:=0;
    drregs.dr2:=0;

    for i:=0 to length(breakpoints)-1 do
    begin
      if i=0 then DRRegs.Dr0:=breakpoints[0] else
      if i=1 then DRRegs.Dr1:=breakpoints[1] else
      if i=2 then DRRegs.Dr2:=breakpoints[2];
    end;
      suspendthread(thread);
      setthreadcontext(thread,DRRegs);
      resumethread(thread);

end; }
procedure TDebugevents.setbreakpoints;
var i: integer;
begin
  debugregs.ContextFlags:=CONTEXT_DEBUG_REGISTERS;
  debugregs.Dr7:=reg0set or reg1set or reg2set or reg3set;

  debugregs.Dr0:=breakpoints[0];
  debugregs.dr1:=breakpoints[1];
  debugregs.dr2:=breakpoints[2];
  debugregs.Dr3:=breakpoints[3];

    suspendthread(thread);
    setthreadcontext(thread,debugregs);
    resumethread(thread);

end;
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Source 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