Skip to content

Commit

Permalink
some bugfixes and made a start for ultimap2
Browse files Browse the repository at this point in the history
  • Loading branch information
cheat-engine committed Jul 5, 2016
1 parent cce494f commit 9dbd5da
Show file tree
Hide file tree
Showing 20 changed files with 1,662 additions and 821 deletions.
9 changes: 7 additions & 2 deletions Cheat Engine/MainUnit.lfm
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
object MainForm: TMainForm
Tag = 2
Left = 1108
Left = 562
Height = 557
Hint = ' '
Top = 365
Top = 190
Width = 577
HelpContext = 3
HorzScrollBar.Visible = False
Expand Down Expand Up @@ -1603,6 +1603,11 @@ object MainForm: TMainForm
ShortCut = 16450
OnClick = Browsethismemoryregion1Click
end
object miDisassemble: TMenuItem
Caption = 'Disassemble this memory region'
ShortCut = 16452
OnClick = miDisassembleClick
end
object miShowAsSigned: TMenuItem
Caption = 'Show as signed'
OnClick = miShowAsSignedClick
Expand Down
1 change: 1 addition & 0 deletions Cheat Engine/MainUnit.lrt
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ TMAINFORM.VALUE1.CAPTION=Value
TMAINFORM.MIUNDOVALUE.CAPTION=Undo last edit
TMAINFORM.SMARTEDITADDRESSES1.CAPTION=Smart edit address(es)
TMAINFORM.BROWSETHISMEMORYREGION1.CAPTION=Browse this memory region
TMAINFORM.MIDISASSEMBLE.CAPTION=Disassemble this memory region
TMAINFORM.MISHOWASSIGNED.CAPTION=Show as signed
TMAINFORM.SHOWASHEXADECIMAL1.CAPTION=Show as hexadecimal
TMAINFORM.MIZEROTERMINATE.CAPTION=Zero-Terminate string
Expand Down
20 changes: 18 additions & 2 deletions Cheat Engine/MainUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ TMainForm = class(TForm)
cbFloatSimple: TCheckBox;
cbPauseWhileScanning: TCheckBox;
cbWritable: TCheckBox;
CheckBox1: TCheckBox;
ColorDialog1: TColorDialog;
CreateGroup: TMenuItem;
edtAlignment: TEdit;
Expand All @@ -224,6 +225,7 @@ TMainForm = class(TForm)
MenuItem1: TMenuItem;
MenuItem10: TMenuItem;
MenuItem11: TMenuItem;
miDisassemble: TMenuItem;
miBindDeactivation: TMenuItem;
miScanDirtyOnly: TMenuItem;
miScanPagedOnly: TMenuItem;
Expand Down Expand Up @@ -458,6 +460,7 @@ TMainForm = class(TForm)
procedure Label57Click(Sender: TObject);
procedure lblcompareToSavedScanClick(Sender: TObject);
procedure miBindDeactivationClick(Sender: TObject);
procedure miDisassembleClick(Sender: TObject);
procedure miScanDirtyOnlyClick(Sender: TObject);
procedure miCompressionClick(Sender: TObject);
procedure miGeneratePointermapClick(Sender: TObject);
Expand Down Expand Up @@ -3591,6 +3594,15 @@ procedure TMainForm.miBindDeactivationClick(Sender: TObject);
end;
end;

procedure TMainForm.miDisassembleClick(Sender: TObject);
begin
if addresslist.selectedrecord <> nil then
begin
memorybrowser.disassemblerview.SelectedAddress := addresslist.selectedrecord.GetRealAddress;
memorybrowser.Show;
end;
end;



procedure TMainForm.miHideChildrenClick(Sender: TObject);
Expand Down Expand Up @@ -6172,6 +6184,8 @@ procedure TMainForm.PopupMenu2Popup(Sender: TObject);
Smarteditaddresses1.visible := (addresslist.selectedrecord <> nil) and (not addresslist.selectedRecord.isGroupHeader);

BrowseThisMemoryRegion1.Visible :=(addresslist.selectedRecord <> nil) and (not addresslist.selectedRecord.isGroupHeader) and (not (addresslist.selectedRecord.vartype = vtAutoAssembler));
miDisassemble.Visible:=Browsethismemoryregion1.Visible;

ShowAsHexadecimal1.Visible :=
(addresslist.selectedRecord <> nil) and (addresslist.selectedRecord.VarType in
[vtByte, vtWord, vtDword, vtQword, vtSingle, vtDouble, vtCustom, vtByteArray]) and
Expand Down Expand Up @@ -8102,13 +8116,15 @@ procedure TMainForm.d3dclicktest(overlayid: integer; x, y: integer);

procedure TMainForm.Label3Click(Sender: TObject);
begin
dbk_disableUltimap2();
ultimap2_disable;
end;


procedure TMainForm.Label59Click(Sender: TObject);
var ranges: TPRangeDynArray;
begin
dbk_ultimap2(processid, 16*1024*1024);
setlength(ranges,0);
ultimap2(processid, 16*1024*1024, 'd:\bla',ranges);
end;

procedure ChangeIcon(hModule: HModule; restype: PChar; resname: PChar;
Expand Down
11 changes: 8 additions & 3 deletions Cheat Engine/MemoryBrowserFormUnit.lfm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
object MemoryBrowser: TMemoryBrowser
Left = 867
Left = 879
Height = 587
Top = 247
Top = 259
Width = 716
HelpContext = 12
Caption = 'Memory Viewer'
Expand All @@ -16,7 +16,7 @@ object MemoryBrowser: TMemoryBrowser
OnResize = FormResize
OnShow = FormShow
Position = poScreenCenter
LCLVersion = '1.3'
LCLVersion = '1.6.0.4'
object Splitter1: TSplitter
Cursor = crVSplit
Left = 0
Expand Down Expand Up @@ -1358,6 +1358,11 @@ object MemoryBrowser: TMemoryBrowser
ShortCut = 49237
OnClick = MenuItem14Click
end
object MenuItem26: TMenuItem
Caption = 'Ultimap 2'
ShortCut = 24661
OnClick = MenuItem26Click
end
object MenuItem22: TMenuItem
Caption = 'Watch memory page access'
ShortCut = 24641
Expand Down
1 change: 1 addition & 0 deletions Cheat Engine/MemoryBrowserFormUnit.lrt
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ TMEMORYBROWSER.N12.CAPTION=-
TMEMORYBROWSER.DISSECTDATA1.CAPTION=Pointer scan
TMEMORYBROWSER.MIPOINTERSPIDER.CAPTION=Structure spider
TMEMORYBROWSER.MENUITEM14.CAPTION=Ultimap
TMEMORYBROWSER.MENUITEM26.CAPTION=Ultimap 2
TMEMORYBROWSER.MENUITEM22.CAPTION=Watch memory page access
TMEMORYBROWSER.WATCHMEMORYALLOCATIONS1.CAPTION=Watch memory allocations
TMEMORYBROWSER.FINDSTATICPOINTERS1.CAPTION=Find static addresses
Expand Down
21 changes: 18 additions & 3 deletions Cheat Engine/MemoryBrowserFormUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ TMemoryBrowser = class(TForm)
MenuItem23: TMenuItem;
MenuItem24: TMenuItem;
MenuItem25: TMenuItem;
MenuItem26: TMenuItem;
miGNUAssembler: TMenuItem;
miBinutilsSelect: TMenuItem;
miBinUtils: TMenuItem;
Expand Down Expand Up @@ -272,6 +273,7 @@ TMemoryBrowser = class(TForm)
procedure MenuItem20Click(Sender: TObject);
procedure MenuItem22Click(Sender: TObject);
procedure MenuItem25Click(Sender: TObject);
procedure MenuItem26Click(Sender: TObject);
procedure miGNUAssemblerClick(Sender: TObject);
procedure miBinutilsSelectClick(Sender: TObject);
procedure SetBookmarkClick(Sender: TObject);
Expand Down Expand Up @@ -617,6 +619,7 @@ implementation
frmStringpointerscanUnit,
frmFilePatcherUnit,
frmUltimapUnit,
frmUltimap2Unit,
frmAssemblyScanUnit,
MemoryQuery,
AccessedMemory,
Expand Down Expand Up @@ -1106,6 +1109,14 @@ procedure TMemoryBrowser.MenuItem25Click(Sender: TObject);

end;

procedure TMemoryBrowser.MenuItem26Click(Sender: TObject);
begin
if frmUltimap2=nil then
frmUltimap2:=TfrmUltimap2.create(application);

frmUltimap2.show;
end;

procedure TMemoryBrowser.miGNUAssemblerClick(Sender: TObject);
var gnua: TfrmAutoInject;
begin
Expand Down Expand Up @@ -1358,7 +1369,7 @@ procedure TMemoryBrowser.MenuItem2Click(Sender: TObject);


//look for ret, int3 or nop
if (d.LastDisassembleData.opcode='??') or (d.LastDisassembleData.opcode='ret') or (d.LastDisassembleData.opcode='int 3') or (d.LastDisassembleData.opcode='nop') then
if (d.LastDisassembleData.opcode='??') or (d.LastDisassembleData.opcode='ret') or (d.LastDisassembleData.opcode='int 3') then
begin
start:=a; //start from next instruction
break;
Expand Down Expand Up @@ -1865,8 +1876,12 @@ procedure TMemoryBrowser.Goto1Click(Sender: TObject);
old: ptruint;
begin
panel4.setfocus;
old:=memoryaddress;
newaddress:=inputboxtop(rsGotoAddress, rsFillInTheAddressYouWantToGoTo, IntTohex(memoryaddress, 8), true, canceled, memorybrowserHistory);
// old:=memoryaddress;

old:=hexview.SelectionStart;
if old=0 then old:=memoryaddress;

newaddress:=inputboxtop(rsGotoAddress, rsFillInTheAddressYouWantToGoTo, IntTohex(old, 8), true, canceled, memorybrowserHistory);

hexview.address:=getaddress(newaddress);

Expand Down
2 changes: 2 additions & 0 deletions Cheat Engine/bin/autorun/ultimap2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ function setupToPA(size)
local size=sizePerCPU+extra;
ultimap2.ToPABuffers[i]={}
ultimap2.ToPABuffers[i].Memory=allocateKernelMemory(size)
if (ultimap2.ToPABuffers[i].Memory==0) then error("Failure allocating memory") end

ultimap2.ToPABuffers[i].MemorySize=size
ultimap2.ToPABuffers[i].Layout={}
ultimap2.ToPABuffers[i].ToPAHeaders={}
Expand Down
Loading

0 comments on commit 9dbd5da

Please sign in to comment.