Skip to content

Commit

Permalink
some compilation warning fixes and committing some stuff I haven't co…
Browse files Browse the repository at this point in the history
…mmitted yet
  • Loading branch information
cheat-engine committed Mar 25, 2021
1 parent 10918b6 commit cf37ab8
Show file tree
Hide file tree
Showing 17 changed files with 155 additions and 75 deletions.
2 changes: 2 additions & 0 deletions Cheat Engine/FoundCodeUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -829,12 +829,14 @@ procedure TFoundCodedialog.moreinfo;
{$IFDEF windows}
if CurrentDebuggerInterface is TDBVMDebugInterface then
begin
{$ifdef cpu64}
if coderecord.context.P2Home<>0 then
begin
d:=TCR3Disassembler.Create;
TCR3Disassembler(d).CR3:=coderecord.context.P2Home;
end
else
{$endif}
d:=TDisassembler.Create;
end
else
Expand Down
15 changes: 14 additions & 1 deletion Cheat Engine/LuaHandler.pas
Original file line number Diff line number Diff line change
Expand Up @@ -8417,6 +8417,18 @@ function getTickCount_lua(L: PLua_State): integer; cdecl;
function lua_rdtsc(L: PLua_State): integer; cdecl;
var v: qword;
begin
{$ifdef cpu32}
asm
push edx
push edi
rdtsc
lea edi,v
mov [edi],eax
mov [edi+4],edx
pop edi
pop edx
end;
{$else}
asm
push rdx
rdtsc
Expand All @@ -8428,6 +8440,7 @@ function lua_rdtsc(L: PLua_State): integer; cdecl;

mov v,rax
end;
{$endif}

lua_pushinteger(L,v);
result:=1;
Expand Down Expand Up @@ -14565,7 +14578,7 @@ function lua_getNextReadablePageCR3(L: Plua_State): integer; cdecl;
var
cr3: qword;
address: qword;
newaddress: qword;
newaddress: ptruint;
begin
result:=0;
if lua_gettop(L)>=2 then
Expand Down
10 changes: 6 additions & 4 deletions Cheat Engine/MainUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -7682,8 +7682,9 @@ procedure TMainForm.Findoutwhataccessesthisaddress1Click(Sender: TObject);
address := addresslist.selectedRecord.GetRealAddress
else
if res = mrYes then
address := symhandler.getAddressFromName(
addresslist.selectedRecord.interpretableaddress)
begin
addresslist.selectedRecord.parseAddressString(addresslist.selectedRecord.interpretableaddress, address);
end
else
exit;
end;
Expand Down Expand Up @@ -7720,8 +7721,9 @@ procedure TMainForm.Setbreakpoint1Click(Sender: TObject);
address := addresslist.selectedRecord.GetRealAddress
else
if res = mrYes then
address := symhandler.getAddressFromName(
addresslist.selectedRecord.interpretableaddress)
begin
addresslist.selectedRecord.parseAddressString(addresslist.selectedRecord.interpretableaddress, address);
end
else
exit;
end;
Expand Down
2 changes: 1 addition & 1 deletion Cheat Engine/MainUnit2.pas
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ procedure initcetitle;



const beta=' beta 1'; //empty this for a release
const beta=' beta 2'; //empty this for a release

var
CEnorm:string;
Expand Down
16 changes: 11 additions & 5 deletions Cheat Engine/MemoryBrowserFormUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3157,14 +3157,20 @@ procedure TMemoryBrowser.Gotoaddress1Click(Sender: TObject);
if(canceled)then
exit;

oldAddress:=disassemblerview.SelectedAddress;
try
disassemblerview.SelectedAddress:=symhandler.getaddressfromname(newaddress);
oldAddress:=disassemblerview.SelectedAddress;
try
disassemblerview.SelectedAddress:=symhandler.getaddressfromname(newaddress);
except
disassemblerview.SelectedAddress:=getaddress(newaddress);
end;

backlist.Push(pointer(oldAddress));

except
disassemblerview.SelectedAddress:=getaddress(newaddress);
on e:exception do
MessageDlg(e.Message,mtError,[mbok],0);
end;

backlist.Push(pointer(oldAddress));
end;

procedure TMemoryBrowser.Search1Click(Sender: TObject);
Expand Down
1 change: 1 addition & 0 deletions Cheat Engine/SynHighlighterAA.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1326,6 +1326,7 @@ procedure TSynAASyn.BraceOpenProc;
(uppercase(fLine[3]) = 'U') and
(uppercase(fLine[4]) = 'A') then
begin
braceend:=length(fline);
if (fLine[5] = '}') then
begin
changeHighlighter:=chlLua;
Expand Down
76 changes: 41 additions & 35 deletions Cheat Engine/addresslist.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1135,53 +1135,59 @@ procedure Taddresslist.MultiEdit(memrec: TMemoryrecord);

frmMemrecCombobox: TfrmMemrecCombobox;
begin
if memrec.DropDownCount=0 then
begin
value:=AnsiToUtf8(memrec.value);
try
if memrec.DropDownCount=0 then
begin
value:=AnsiToUtf8(memrec.value);


if memrec.VarType=vtString then
canceled:=not MultilineInputQuery(rsChangeValue, rsWhatValueToChangeThisTo, value)
else
canceled:=not InputQuery(rsChangeValue, rsWhatValueToChangeThisTo, value);
if memrec.VarType=vtString then
canceled:=not MultilineInputQuery(rsChangeValue, rsWhatValueToChangeThisTo, value)
else
canceled:=not InputQuery(rsChangeValue, rsWhatValueToChangeThisTo, value);


value:=TrimRight(Utf8ToAnsi(value));
end
else
begin
frmMemrecCombobox:=TfrmMemrecCombobox.Create(memrec);
canceled:=frmMemrecCombobox.showmodal<>mrok;
value:=TrimRight(Utf8ToAnsi(value));
end
else
begin
frmMemrecCombobox:=TfrmMemrecCombobox.Create(memrec);
canceled:=frmMemrecCombobox.showmodal<>mrok;

if memrec.DropDownReadOnly and memrec.DropDownDescriptionOnly and memrec.DisplayAsDropDownListItem and (frmMemrecCombobox.value='*') then
canceled:=true;
if memrec.DropDownReadOnly and memrec.DropDownDescriptionOnly and memrec.DisplayAsDropDownListItem and (frmMemrecCombobox.value='*') then
canceled:=true;

if not canceled then
value:=utf8toansi(frmMemrecCombobox.value);
if not canceled then
value:=utf8toansi(frmMemrecCombobox.value);

frmMemrecCombobox.free;
end;
frmMemrecCombobox.free;
end;

if not canceled then
begin
if not canceled then
begin


allError:=true;
someError:=false;
for i:=0 to count-1 do
if memrecitems[i].isSelected then
begin
try
memrecitems[i].SetValue(value);
memrecitems[i].treenode.update;
allError:=false;
except
someError:=true;
allError:=true;
someError:=false;
for i:=0 to count-1 do
if memrecitems[i].isSelected then
begin
try
memrecitems[i].SetValue(value);
memrecitems[i].treenode.update;
allError:=false;
except
someError:=true;
end;
end;
end;

if AllError then raise exception.create(Format(rsTheValueCouldNotBeParsed, [value]));
if SomeError then raise exception.create(Format(rsNotAllValueTypesCouldHandleTheValue, [value]));
if AllError then raise exception.create(Format(rsTheValueCouldNotBeParsed, [value]));
if SomeError then raise exception.create(Format(rsNotAllValueTypesCouldHandleTheValue, [value]));
end;

except
on e:Exception do
MessageDlg(e.message,mtError,[mbok],0);
end;
end;

Expand Down
3 changes: 2 additions & 1 deletion Cheat Engine/betterControls/newmainmenu.pas
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,10 @@ function TNewMenuItem.DoDrawItem(ACanvas: TCanvas; ARect: TRect; AState: TOwnerD
if ShouldAppsUseDarkMode() and (result=false) then
begin
result:=Parent.Menu is TMainMenu;
oldc:=acanvas.Brush.color;

if result then
begin
oldc:=acanvas.Brush.color;
acanvas.Brush.color:=$313131;

lastvisible:=-1;
Expand Down
7 changes: 6 additions & 1 deletion Cheat Engine/bin/autorun/dotnetinfo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1990,8 +1990,13 @@ function miDotNetInfoClick(sender)
frmDotNetInfo.miBrowseField.OnClick=function(sender) miBrowseFieldClick(frmDotNetInfo, sender) end

frmDotNetInfo.pmFields.OnPopup=function(sender)
frmDotNetInfo.miBrowseField.Visible=frmDotNetInfo.lvFields.Selected and frmDotNetInfo.comboFieldBaseAddress.Text~=''
frmDotNetInfo.miBrowseField.Enabled=frmDotNetInfo.lvFields.Selected and frmDotNetInfo.comboFieldBaseAddress.Text~=''
end

frmDotNetInfo.pmMethods.OnPopup=function(sender)
frmDotNetInfo.miInvokeMethod.Enabled=(frmDotNetInfo.comboFieldBaseAddress.Text~='') and (getAddressSafe(frmDotNetInfo.comboFieldBaseAddress.Text)~=nil)
end

--Init


Expand Down
2 changes: 1 addition & 1 deletion Cheat Engine/bin/autorun/forms/DotNetInfo.frm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<FormData>
<frmDotNetInfo Class="TCEForm" Encoding="Ascii85">y.#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Uh%i,6?TgZUU8A+aKSdYnc5hh;gQ)LP#VMH8kOq_Pjw{9+H]NdYc%}DD-ZUD?io*mb3:%P[7V-eA7Vt:9,jB=[@^HPMll.6Z8thiUgc]AoTTW[G*1?6BHTD)[r@zXKX50@Mj6}@vZ8HnuC}n,ZQX5Bj%}6VXfS}hN?[(qndH1td=LM_Ityl%[0Fp,s//5lFcP8,XX[d8m*V6rrV+PpX{sG-fpns[NN;3=m7.r@KhJ0QXUee2wU)7]2(J#{b)B63N{m_#E7b.b,Ac/CMLfUvvR:!dc^[email protected]?/yjB%WGUlxyGNIM6R01O,/NUQo69d;7zzO9;g$tGq:AZgpLn:5{i2[95d,;SXs3y+t;]d]P_qWciV(Ohmbn5b!!:gEf$)!M)*F$(Zdw$LY(obd}@sI+#Lz-K.6jz]XOcyEfVEyypyhTLcY,Ua.3v:4$L!Qm_JE@/ksb9q0C,t9}I/GahFSyJQU_/X^^P)u^M!q+KUZlIe,TO.%*{GTz:U^:=6AO/]HmV)pTrhS,}zWm{L}M?Th.qnk$Pkh=9=PnD/*Ng.J#{VgWm!#R_twm,+6t(p7/6TC]0Q?X65jS=B;il@g[sjc%T8Cvau{oB#5_@M3</frmDotNetInfo>
</FormData>
11 changes: 11 additions & 0 deletions Cheat Engine/formFoundcodeListExtraUnit.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,17 @@ object FormFoundCodeListExtra: TFormFoundCodeListExtra
ParentFont = False
OnMouseDown = RegisterMouseDown
end
object lblGSBaseKernel: TLabel
Left = 182
Height = 15
Top = 38
Width = 143
Caption = 'GSBase K=XXXXXXXX'
ParentColor = False
ParentFont = False
OnDblClick = RegisterDblClick
OnMouseDown = RegisterMouseDown
end
end
object pmCopy: TPopupMenu
Images = eiImageList
Expand Down
19 changes: 10 additions & 9 deletions Cheat Engine/formsettingsunit.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ object formSettings: TformSettings
OnDestroy = FormDestroy
OnShow = FormShow
Position = poMainFormCenter
LCLVersion = '2.0.10.0'
LCLVersion = '2.0.6.0'
object pnlConfig: TPanel
Left = 0
Height = 571
Expand All @@ -29,7 +29,7 @@ object formSettings: TformSettings
Left = 1
Height = 569
Top = 1
Width = 148
Width = 153
Align = alLeft
HideSelection = False
Indent = 19
Expand All @@ -38,9 +38,10 @@ object formSettings: TformSettings
ScrollBars = ssVertical
ShowRoot = False
TabOrder = 0
ToolTips = False
OnChange = tvMenuSelectionChange
OnCollapsing = tvMenuSelectionCollapsing
Options = [tvoAutoItemHeight, tvoKeepCollapsedNodes, tvoReadOnly, tvoRightClickSelect, tvoShowButtons, tvoShowLines, tvoToolTips]
Options = [tvoAutoItemHeight, tvoKeepCollapsedNodes, tvoReadOnly, tvoRightClickSelect, tvoShowButtons, tvoShowLines]
Items.Data = {
F9FFFFFF02000A000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF010000000000
0000011000000047656E6572616C2053657474696E6773FFFFFFFFFFFFFFFFFF
Expand All @@ -59,10 +60,10 @@ object formSettings: TformSettings
}
end
object pcSetting: TPageControl
Left = 149
Left = 154
Height = 569
Top = 1
Width = 660
Width = 655
ActivePage = Assembler
Align = alClient
TabIndex = 6
Expand Down Expand Up @@ -1361,20 +1362,20 @@ object formSettings: TformSettings
object Assembler: TTabSheet
Caption = 'Debugger Options'
ClientHeight = 541
ClientWidth = 652
ClientWidth = 647
ImageIndex = 5
object ScrollBox3: TScrollBox
Left = 0
Height = 541
Top = 0
Width = 652
HorzScrollBar.Page = 631
Width = 647
HorzScrollBar.Page = 626
HorzScrollBar.Tracking = True
VertScrollBar.Page = 520
VertScrollBar.Tracking = True
Align = alClient
ClientHeight = 520
ClientWidth = 631
ClientWidth = 626
TabOrder = 0
object replacewithnops: TCheckBox
AnchorSideLeft.Control = Label4
Expand Down
7 changes: 4 additions & 3 deletions Cheat Engine/formsettingsunit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1440,10 +1440,9 @@ procedure TformSettings.FormShow(Sender: TObject);
cbVEHRealContextOnThreadCreation.AutoSize:=true;



j:=tvMenuSelection.Width;
for i:=0 to tvMenuSelection.Items.Count-1 do
j:=max(j,tvMenuSelection.Canvas.TextWidth(tvMenuSelection.Items[i].Text)+tvMenuSelection.BorderWidth+tvMenuSelection.Indent*2);
j:=max(j,tvMenuSelection.Canvas.TextWidth(' '+tvMenuSelection.Items[i].Text+' ')+tvMenuSelection.BorderWidth+tvMenuSelection.Indent*2);


tvMenuSelection.Width:=j;
Expand Down Expand Up @@ -1928,12 +1927,14 @@ procedure TformSettings.FormCreate(Sender: TObject);
cbUseWindowsDebugger.visible:=false;
cbKDebug.enabled:=false;
cbKDebug.visible:=false;
cbUseDBVMDebugger.enabled:=false;
cbUseDBVMDebugger.visible:=false;
panel11.visible:=false;

cbUseMacDebugger.checked:=true;

{$else}
cbUseMacDebugger.visible:=false;

{$endif}
end;

Expand Down
1 change: 1 addition & 0 deletions Cheat Engine/frmBreakpointConditionUnit.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ object frmBreakpointCondition: TfrmBreakpointCondition
ClientHeight = 232
ClientWidth = 533
OnCreate = FormCreate
OnDestroy = FormDestroy
OnShow = FormShow
Position = poScreenCenter
LCLVersion = '2.0.6.0'
Expand Down
Loading

0 comments on commit cf37ab8

Please sign in to comment.