Skip to content

Commit

Permalink
rename some menuitems in the memorybrowser and add a startcondition f…
Browse files Browse the repository at this point in the history
…ield to the tracer
  • Loading branch information
cheat-engine committed Apr 27, 2018
1 parent 02a17ea commit 69c8210
Show file tree
Hide file tree
Showing 8 changed files with 111 additions and 75 deletions.
30 changes: 15 additions & 15 deletions Cheat Engine/MemoryBrowserFormUnit.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -1306,43 +1306,43 @@ object MemoryBrowser: TMemoryBrowser
end
object Debug1: TMenuItem
Caption = 'Debug'
object Run1: TMenuItem
object miDebugRun: TMenuItem
Caption = 'Run'
Enabled = False
ShortCut = 120
OnClick = Run1Click
OnClick = miDebugRunClick
end
object Step1: TMenuItem
object miDebugStep: TMenuItem
Caption = 'Step'
Enabled = False
ShortCut = 118
OnClick = Step1Click
OnClick = miDebugStepClick
end
object StepOver1: TMenuItem
object miDebugStepOver: TMenuItem
Caption = 'Step Over'
Enabled = False
ShortCut = 119
OnClick = StepOver1Click
OnClick = miDebugStepOverClick
end
object Executetillreturn1: TMenuItem
object miDebugExecuteTillReturn: TMenuItem
Caption = 'Execute till return'
Enabled = False
ShortCut = 8311
OnClick = Executetillreturn1Click
OnClick = miDebugExecuteTillReturnClick
end
object Runtill1: TMenuItem
object miDebugRunTill: TMenuItem
Caption = 'Run till...'
Enabled = False
ShortCut = 115
OnClick = Runtill1Click
OnClick = miDebugRunTillClick
end
object miSetAddress: TMenuItem
object miDebugSetAddress: TMenuItem
Caption = 'Set Address'
Enabled = False
ShortCut = 16499
OnClick = miSetAddressClick
OnClick = miDebugSetAddressClick
end
object Setbreakpoint1: TMenuItem
object miDebugToggleBreakpoint: TMenuItem
Caption = 'Toggle breakpoint'
ShortCut = 116
OnClick = miTogglebreakpointClick
Expand All @@ -1359,9 +1359,9 @@ object MemoryBrowser: TMemoryBrowser
object N16: TMenuItem
Caption = '-'
end
object Break1: TMenuItem
object miDebugBreak: TMenuItem
Caption = 'Break'
OnClick = Break1Click
OnClick = miDebugBreakClick
end
end
object Extra1: TMenuItem
Expand Down
16 changes: 8 additions & 8 deletions Cheat Engine/MemoryBrowserFormUnit.lrt
Original file line number Diff line number Diff line change
Expand Up @@ -173,17 +173,17 @@ TMEMORYBROWSER.MIBINUTILS.CAPTION=BinUtils
TMEMORYBROWSER.MIBINUTILSSELECT.CAPTION=None
TMEMORYBROWSER.MITEXTPREFERENCES.CAPTION=Preferences
TMEMORYBROWSER.DEBUG1.CAPTION=Debug
TMEMORYBROWSER.RUN1.CAPTION=Run
TMEMORYBROWSER.STEP1.CAPTION=Step
TMEMORYBROWSER.STEPOVER1.CAPTION=Step Over
TMEMORYBROWSER.EXECUTETILLRETURN1.CAPTION=Execute till return
TMEMORYBROWSER.RUNTILL1.CAPTION=Run till...
TMEMORYBROWSER.MISETADDRESS.CAPTION=Set Address
TMEMORYBROWSER.SETBREAKPOINT1.CAPTION=Toggle breakpoint
TMEMORYBROWSER.MIDEBUGRUN.CAPTION=Run
TMEMORYBROWSER.MIDEBUGSTEP.CAPTION=Step
TMEMORYBROWSER.MIDEBUGSTEPOVER.CAPTION=Step Over
TMEMORYBROWSER.MIDEBUGEXECUTETILLRETURN.CAPTION=Execute till return
TMEMORYBROWSER.MIDEBUGRUNTILL.CAPTION=Run till...
TMEMORYBROWSER.MIDEBUGSETADDRESS.CAPTION=Set Address
TMEMORYBROWSER.MIDEBUGTOGGLEBREAKPOINT.CAPTION=Toggle breakpoint
TMEMORYBROWSER.N3.CAPTION=-
TMEMORYBROWSER.CONTINUEANDDETACHDEBUGGER1.CAPTION=Continue and detach debugger
TMEMORYBROWSER.N16.CAPTION=-
TMEMORYBROWSER.BREAK1.CAPTION=Break
TMEMORYBROWSER.MIDEBUGBREAK.CAPTION=Break
TMEMORYBROWSER.EXTRA1.CAPTION=Tools
TMEMORYBROWSER.RESERVEMEMORY1.CAPTION=Allocate Memory
TMEMORYBROWSER.SCANFORCODECAVES1.CAPTION=Scan for code caves
Expand Down
72 changes: 41 additions & 31 deletions Cheat Engine/MemoryBrowserFormUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ TMemoryBrowser = class(TForm)
miHVFollow: TMenuItem;
miAddRef: TMenuItem;
miTextEncodingUTF8: TMenuItem;
miSetAddress: TMenuItem;
miDebugSetAddress: TMenuItem;
miGNUAssembler: TMenuItem;
miBinutilsSelect: TMenuItem;
miBinUtils: TMenuItem;
Expand Down Expand Up @@ -161,10 +161,10 @@ TMemoryBrowser = class(TForm)
File1: TMenuItem;
Loadsymbolfile1: TMenuItem;
Debug1: TMenuItem;
Step1: TMenuItem;
StepOver1: TMenuItem;
Runtill1: TMenuItem;
Setbreakpoint1: TMenuItem;
miDebugStep: TMenuItem;
miDebugStepOver: TMenuItem;
miDebugRunTill: TMenuItem;
miDebugToggleBreakpoint: TMenuItem;
View1: TMenuItem;
Stacktrace1: TMenuItem;
ScrollBox1: TScrollBox;
Expand All @@ -174,11 +174,11 @@ TMemoryBrowser = class(TForm)
Shape2: TShape;
Label16: TLabel;
Shape3: TShape;
Run1: TMenuItem;
miDebugRun: TMenuItem;
Threadlist1: TMenuItem;
Assemble1: TMenuItem;
N3: TMenuItem;
Break1: TMenuItem;
miDebugBreak: TMenuItem;
Extra1: TMenuItem;
Reservememory1: TMenuItem;
Savedisassemledoutput1: TMenuItem;
Expand Down Expand Up @@ -272,7 +272,7 @@ TMemoryBrowser = class(TForm)
Referencedstrings1: TMenuItem;
N18: TMenuItem;
stacktrace2: TMenuItem;
Executetillreturn1: TMenuItem;
miDebugExecuteTillReturn: TMenuItem;
zflabel: TLabel;
procedure FormActivate(Sender: TObject);
procedure GotoBookmarkClick(Sender: TObject);
Expand All @@ -291,7 +291,7 @@ TMemoryBrowser = class(TForm)
procedure miAddRefClick(Sender: TObject);
procedure miHVBackClick(Sender: TObject);
procedure miHVFollowClick(Sender: TObject);
procedure miSetAddressClick(Sender: TObject);
procedure miDebugSetAddressClick(Sender: TObject);
procedure miGNUAssemblerClick(Sender: TObject);
procedure miBinutilsSelectClick(Sender: TObject);
procedure miShowRelativeClick(Sender: TObject);
Expand Down Expand Up @@ -356,10 +356,10 @@ TMemoryBrowser = class(TForm)
procedure ScrollBar2Scroll(Sender: TObject; ScrollCode: TScrollCode;
var ScrollPos: Integer);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Run1Click(Sender: TObject);
procedure Step1Click(Sender: TObject);
procedure StepOver1Click(Sender: TObject);
procedure Runtill1Click(Sender: TObject);
procedure miDebugRunClick(Sender: TObject);
procedure miDebugStepClick(Sender: TObject);
procedure miDebugStepOverClick(Sender: TObject);
procedure miDebugRunTillClick(Sender: TObject);
procedure Stacktrace1Click(Sender: TObject);
procedure Threadlist1Click(Sender: TObject);
procedure Assemble1Click(Sender: TObject);
Expand All @@ -368,7 +368,7 @@ TMemoryBrowser = class(TForm)
procedure HexEditKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure EAXLabelDblClick(Sender: TObject);
procedure Break1Click(Sender: TObject);
procedure miDebugBreakClick(Sender: TObject);
procedure Reservememory1Click(Sender: TObject);
procedure Savememoryregion1Click(Sender: TObject);
procedure Loadmemolryregion1Click(Sender: TObject);
Expand Down Expand Up @@ -439,7 +439,7 @@ TMemoryBrowser = class(TForm)
procedure Nonsystemmodulesonly1Click(Sender: TObject);
procedure Referencedstrings1Click(Sender: TObject);
procedure stacktrace2Click(Sender: TObject);
procedure Executetillreturn1Click(Sender: TObject);
procedure miDebugExecuteTillReturnClick(Sender: TObject);
procedure lvStacktraceDataData(Sender: TObject; Item: TListItem);
procedure lvStacktraceDataDblClick(Sender: TObject);
private
Expand Down Expand Up @@ -579,6 +579,15 @@ TMemoryBrowser = class(TForm)
procedure miStopDifferenceClick(Sender: TObject);
procedure Scrollboxscroll(sender: TObject);
procedure AddToDisassemblerBackList(address: pointer);
published
//support for old scripts that reference these
property Run1: TMenuItem read miDebugRun;
property Step1: TMenuItem read miDebugStep;
property StepOver1: TMenuItem read miDebugStepOver;
property Executetillreturn1: TMenuItem read miDebugExecuteTillReturn;
property RunTill1: TMenuItem read miDebugRunTill;
property miSetAddress: TMenuItem read miDebugSetAddress;
property Setbreakpoint1: TMenuItem read miDebugToggleBreakpoint;
end;

var
Expand Down Expand Up @@ -1170,7 +1179,7 @@ procedure TMemoryBrowser.MenuItem27Click(Sender: TObject);



procedure TMemoryBrowser.miSetAddressClick(Sender: TObject);
procedure TMemoryBrowser.miDebugSetAddressClick(Sender: TObject);
begin
if (debuggerthread<>nil) and (debuggerthread.isWaitingToContinue) then
begin
Expand Down Expand Up @@ -1973,6 +1982,7 @@ procedure TMemoryBrowser.FormCreate(Sender: TObject);
c: tcolor;
begin


MemoryBrowsers.Add(self);

bookmarks[0].setMi:=miSetBookmark0;
Expand Down Expand Up @@ -2540,7 +2550,7 @@ procedure TMemoryBrowser.FormClose(Sender: TObject;
else
begin
//do stuff for the main debugger
if (debuggerthread<>nil) and (run1.enabled) then run1.click; //run if it was paused
if (debuggerthread<>nil) and (miDebugRun.enabled) then miDebugRun.click; //run if it was paused


if frmFloatingPointPanel<>nil then
Expand All @@ -2551,7 +2561,7 @@ procedure TMemoryBrowser.FormClose(Sender: TObject;
end;
end;

procedure TMemoryBrowser.Run1Click(Sender: TObject);
procedure TMemoryBrowser.miDebugRunClick(Sender: TObject);
begin
begin
if debuggerthread<>nil then
Expand All @@ -2565,7 +2575,7 @@ procedure TMemoryBrowser.Run1Click(Sender: TObject);
end;
end;

procedure TMemoryBrowser.Step1Click(Sender: TObject);
procedure TMemoryBrowser.miDebugStepClick(Sender: TObject);
begin
begin
if debuggerthread<>nil then
Expand All @@ -2577,7 +2587,7 @@ procedure TMemoryBrowser.Step1Click(Sender: TObject);
end;
end;

procedure TMemoryBrowser.StepOver1Click(Sender: TObject);
procedure TMemoryBrowser.miDebugStepOverClick(Sender: TObject);
var x: ptrUint;
i,j: integer;
s,s1,s2,temp:string;
Expand All @@ -2589,7 +2599,7 @@ procedure TMemoryBrowser.StepOver1Click(Sender: TObject);
caption:=rsMemoryViewerRunning;
end;

procedure TMemoryBrowser.Runtill1Click(Sender: TObject);
procedure TMemoryBrowser.miDebugRunTillClick(Sender: TObject);
var x: ptrUint;
i: integer;
temp:string;
Expand Down Expand Up @@ -2980,7 +2990,7 @@ procedure TMemoryBrowser.EAXLabelDblClick(Sender: TObject);

end;

procedure TMemoryBrowser.Break1Click(Sender: TObject);
procedure TMemoryBrowser.miDebugBreakClick(Sender: TObject);
//var threadhandle: thandle;
var
threadlist: TList;
Expand Down Expand Up @@ -3697,7 +3707,7 @@ procedure TMemoryBrowser.Newwindow1Click(Sender: TObject);
//registerview.Visible:=false;
//splitter2.Visible:=false;
sbShowFloats.Visible:=false;
Setbreakpoint1.visible:=false;
miDebugToggleBreakpoint.visible:=false;

caption:=caption+'* ('+inttostr(mbchildcount)+')';

Expand Down Expand Up @@ -4231,15 +4241,15 @@ function TMemoryBrowser.GetReturnaddress: ptrUint;
end;
end;

procedure TMemoryBrowser.Executetillreturn1Click(Sender: TObject);
procedure TMemoryBrowser.miDebugExecuteTillReturnClick(Sender: TObject);
var x: ptrUint;
begin
begin
x:=getreturnaddress;
if x>0 then
begin
disassemblerview.SelectedAddress:=x;
Runtill1.Click;
miDebugRunTill.Click;
end else beep; //not possible
end;
end;
Expand Down Expand Up @@ -4649,13 +4659,13 @@ procedure TMemoryBrowser.UpdateDebugContext(threadhandle: THandle; threadid: dwo

scrollbox1.OnResize(scrollbox1);

run1.Enabled:=true;
step1.Enabled:=true;
stepover1.Enabled:=true;
runtill1.Enabled:=true;
miSetAddress.enabled:=true;
miDebugRun.Enabled:=true;
miDebugStep.Enabled:=true;
miDebugStepOver.Enabled:=true;
miDebugRunTill.Enabled:=true;
miDebugSetAddress.enabled:=true;
stacktrace1.Enabled:=true;
Executetillreturn1.Enabled:=true;
miDebugExecuteTillReturn.Enabled:=true;

if threadid<>0 then
caption:=Format(rsMemoryViewerCurrentlyDebuggingThread, [inttohex(threadid, 1)]);
Expand Down
Loading

0 comments on commit 69c8210

Please sign in to comment.