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 with breakpoint, game crashing

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

Joined: 19 Sep 2011
Posts: 16

PostPosted: Wed Jan 25, 2012 8:59 am    Post subject: help with breakpoint, game crashing Reply with quote

i'm newbie and, i need make a program for change EAX at breakpoint in a adress, i tryied to code, but the game always crash.

see:


Code:

procedure TForm1.Button3Click(Sender: TObject);
var
  TE32:TThreadEntry32;
  snap,tid:THandle;
  cont:TCONTEXT;
begin
  H := FindWindow(nil, 'Pinball 3D para Windows - Space Cadet');
  ThID := GetWindowThreadProcessId(H, @PID);
  PH := OpenProcess(PROCESS_ALL_ACCESS,FALSE,PID);
  snap:=CreateToolHelp32SnapShot(TH32CS_SNAPTHREAD,0);
  TE32.dwSize:=Sizeof(TThreadEntry32);
  Thread32First(snap,TE32);
  repeat
    if TE32.th32OwnerProcessID=PID then begin
      tid:=OpenThread(THREAD_ALL_ACCESS,false,TE32.th32ThreadID);
      SuspendThread(tid);
      GetThreadContext(tid,cont);
      cont.ContextFlags:=CONTEXT_FULL;
      Form1.ListBox1.Items.Add(inttostr(cont.dr0));
      cont.Dr0:=$00498348;
      cont.Dr6:=0;
      cont.Dr0:=$3;
      SetThreadContext(tid,cont);
      ResumeThread(tid);
    end;
  until Thread32Next(snap,TE32)=false;
    CloseHandle(snap);
    CloseHandle(tid);
end;
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 474

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

PostPosted: Wed Jan 25, 2012 1:24 pm    Post subject: Reply with quote

Where do you handle the breakpoint and change the register ? If you do not handle it, the game will crash

If windows debugger api: You need to use DebugActiveProcess and write a debug handler loop

If injected dll: You need to register an exception handler that deals with the exception the breakpoint causes

_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
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