fix compilation in 32-bit. Add a bugfix for wine symbol enum giving me data I don't need
This commit is contained in:
parent
6c5f242b83
commit
1875641ef1
@ -4870,7 +4870,7 @@ begin
|
||||
|
||||
'N': //N*
|
||||
begin
|
||||
if (length(tokens)=2) and ((tokens[0]='NOP') and (length(tokens[1])>=1) and (tokens[1][1] in ['a'..'f','A'..'F','0'..'9'])) then //NOP HEXVALUE
|
||||
if (processhandler.SystemArchitecture=archX86) and (length(tokens)=2) and ((tokens[0]='NOP') and (length(tokens[1])>=1) and (tokens[1][1] in ['a'..'f','A'..'F','0'..'9'])) then //NOP HEXVALUE
|
||||
begin
|
||||
try
|
||||
j:=HexStrToInt(tokens[1]);
|
||||
|
@ -103,7 +103,7 @@ begin
|
||||
begin
|
||||
xmmreg:=lua_tointeger(L, -1);
|
||||
if (debuggerthread<>nil) and (debuggerthread.CurrentThread<>nil) then
|
||||
c:=ptruint(@debuggerthread.CurrentThread.context.{$ifdef cpu64}FltSave.XmmRegisters{$else}ext.XMMRegisters.LegacyXMM{$endif}[xmmreg]);
|
||||
c:=ptruint(@debuggerthread.CurrentThread.context.{$ifdef cpu64}FltSave.{$else}ext.{$endif}XmmRegisters[xmmreg]);
|
||||
end;
|
||||
|
||||
lua_pop(L, lua_gettop(L));
|
||||
|
@ -1060,7 +1060,7 @@ begin
|
||||
lua_pushstring(L,'XMM'+inttostr(i));
|
||||
|
||||
{$ifdef cpu32}
|
||||
CreateByteTableFromPointer(luavm, @context^.ext.XMMRegisters.LegacyXMM[i], 16);
|
||||
CreateByteTableFromPointer(luavm, @context^.ext.XMMRegisters[i], 16);
|
||||
{$else}
|
||||
CreateByteTableFromPointer(luavm, @context^.FltSave.XmmRegisters[i], 16);
|
||||
{$endif}
|
||||
@ -1195,7 +1195,7 @@ begin
|
||||
if (i>=8) and (not processhandler.is64Bit) then break;
|
||||
|
||||
{$ifdef cpu32}
|
||||
CreateByteTableFromPointer(luavm, @context^.ext.XMMRegisters.LegacyXMM[i], 16);
|
||||
CreateByteTableFromPointer(luavm, @context^.ext.XMMRegisters[i], 16);
|
||||
{$else}
|
||||
CreateByteTableFromPointer(luavm, @context^.FltSave.XmmRegisters[i], 16);
|
||||
{$endif}
|
||||
@ -1357,7 +1357,7 @@ begin
|
||||
begin
|
||||
t:=lua_gettop(LuaVM);
|
||||
{$ifdef cpu32}
|
||||
readBytesFromTable(luavm, t, @context.ext.XMMRegisters.LegacyXMM[i], 16);
|
||||
readBytesFromTable(luavm, t, @context.ext.XMMRegisters[i], 16);
|
||||
{$else}
|
||||
readBytesFromTable(luavm, t, @context.FltSave.XmmRegisters[i], 16);
|
||||
{$endif}
|
||||
|
@ -63,16 +63,18 @@ TModuleEntry32 = MODULEENTRY32;
|
||||
{$ifdef cpu32}
|
||||
const
|
||||
CONTEXT_EXTENDED_REGISTERS = (CONTEXT_i386 or $00000020);
|
||||
|
||||
type
|
||||
M128A = record
|
||||
Low: ULONGLONG;
|
||||
High: LONGLONG;
|
||||
end;
|
||||
_M128A = M128A;
|
||||
TM128A = M128A;
|
||||
PM128A = TM128A;
|
||||
|
||||
{$endif}
|
||||
|
||||
{$ifdef cpu64}
|
||||
const
|
||||
CONTEXT_EXTENDED_REGISTERS = 0;
|
||||
|
||||
// CONTEXT_XSTATE = (CONTEXT_AMD64 or $00100040);
|
||||
CONTEXT_XSTATE = (CONTEXT_AMD64 or $00000040);
|
||||
|
||||
|
||||
type
|
||||
XMM_SAVE_AREA32 = record
|
||||
ControlWord: WORD;
|
||||
@ -96,6 +98,16 @@ type
|
||||
TXmmSaveArea = XMM_SAVE_AREA32;
|
||||
PXmmSaveArea = ^TXmmSaveArea;
|
||||
|
||||
{$ifdef cpu64}
|
||||
const
|
||||
CONTEXT_EXTENDED_REGISTERS = 0;
|
||||
|
||||
// CONTEXT_XSTATE = (CONTEXT_AMD64 or $00100040);
|
||||
CONTEXT_XSTATE = (CONTEXT_AMD64 or $00000040);
|
||||
|
||||
|
||||
|
||||
|
||||
const
|
||||
LEGACY_SAVE_AREA_LENGTH = sizeof(XMM_SAVE_AREA32);
|
||||
|
||||
@ -298,13 +310,6 @@ type
|
||||
end;
|
||||
|
||||
{$ifndef darwin} //defined in macport.pas
|
||||
{$ifdef cpu32}
|
||||
type
|
||||
M128A = record
|
||||
Low: ULONGLONG;
|
||||
High: LONGLONG;
|
||||
end;
|
||||
{$endif}
|
||||
TARM64CONTEXT=record
|
||||
regs: TARM64CONTEXT_REGISTERS;
|
||||
SP: QWORD;
|
||||
@ -450,7 +455,7 @@ type
|
||||
Esp: DWORD;
|
||||
SegSs: DWORD;
|
||||
|
||||
ext: TExtendedRegisters;
|
||||
ext: TXmmSaveArea;
|
||||
end;
|
||||
{$ifdef cpu64}
|
||||
CONTEXT32=_CONTEXT32;
|
||||
|
@ -209,7 +209,7 @@ begin
|
||||
total[length(total)-1]:=1; //value
|
||||
|
||||
setlength(values,length(values)+1);
|
||||
values[length(values)-1]:=pptruint(@c^.{$ifdef cpu64}FltSave.XmmRegisters[xregnr]{$else}ext.XMMRegisters.LongXMM[xregnr]{$endif})^;
|
||||
values[length(values)-1]:=pptruint(@c^.{$ifdef cpu64}FltSave.XmmRegisters[xregnr]{$else}ext.XMMRegisters[xregnr]{$endif})^;
|
||||
|
||||
exit;
|
||||
end
|
||||
|
@ -49,7 +49,7 @@ end;
|
||||
|
||||
implementation
|
||||
|
||||
uses DisassemblerArm, ProcessHandlerUnit, DisassemblerARM32, DisAssemblerARM64;
|
||||
uses DisassemblerArm, ProcessHandlerUnit, DisassemblerARM32, DisAssemblerARM64, disassemblerArm32Thumb;
|
||||
|
||||
resourcestring
|
||||
rsTheValue = 'The value ';
|
||||
@ -1192,6 +1192,8 @@ var
|
||||
oldlength: integer;
|
||||
d32: TArm32Instructionset;
|
||||
d64: TArm64Instructionset;
|
||||
dThumb: TThumbInstructionset;
|
||||
len: integer;
|
||||
begin
|
||||
result:=false;
|
||||
|
||||
@ -1209,15 +1211,37 @@ begin
|
||||
end
|
||||
else
|
||||
begin
|
||||
try
|
||||
r:=d32.assemble(address, instruction);
|
||||
setlength(bytes,4);
|
||||
pdword(@bytes[0])^:=r;
|
||||
exit(true);
|
||||
except
|
||||
if (address and 1) = 1 then
|
||||
begin
|
||||
try
|
||||
dThumb.assemble(address, instruction);
|
||||
|
||||
bytes:=dthumb.LastDisassembleData.Bytes;
|
||||
{setlength(bytes,len);
|
||||
if len=2 then
|
||||
pword(@bytes[0])^:=r
|
||||
else
|
||||
pdword(@bytes[0])^:=r; }
|
||||
|
||||
exit(true);
|
||||
|
||||
except
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
try
|
||||
r:=d32.assemble(address, instruction);
|
||||
setlength(bytes,4);
|
||||
pdword(@bytes[0])^:=r;
|
||||
exit(true);
|
||||
except
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
if (address and 1) = 1 then exit(FalsE); //no thumb supported yet
|
||||
|
||||
r:=$ffffffff;
|
||||
setlength(bytes,0);
|
||||
|
||||
|
@ -499,6 +499,10 @@
|
||||
</Optimizations>
|
||||
</CodeGeneration>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<DebugInfoType Value="dsDwarf2Set"/>
|
||||
<UseExternalDbgSyms Value="True"/>
|
||||
</Debugging>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
@ -525,7 +529,7 @@
|
||||
-dCUSTOMFLOAT
|
||||
-dXDEBUG
|
||||
-dNESTEDSTRUCTURES"/>
|
||||
<OtherDefines Count="10">
|
||||
<OtherDefines Count="13">
|
||||
<Define0 Value="NOTMULTITHREADED"/>
|
||||
<Define1 Value="benchmarkps"/>
|
||||
<Define2 Value="cemain"/>
|
||||
@ -536,6 +540,9 @@
|
||||
<Define7 Value="XDEBUG"/>
|
||||
<Define8 Value="memleaksearch"/>
|
||||
<Define9 Value="checkassembleralphabet"/>
|
||||
<Define10 Value="memorymapped"/>
|
||||
<Define11 Value="privatebuild"/>
|
||||
<Define12 Value="DBVMFORAMDISWORKING"/>
|
||||
</OtherDefines>
|
||||
</Other>
|
||||
</CompilerOptions>
|
||||
@ -661,7 +668,7 @@
|
||||
<PackageName Value="LCL"/>
|
||||
</Item8>
|
||||
</RequiredPackages>
|
||||
<Units Count="415">
|
||||
<Units Count="416">
|
||||
<Unit0>
|
||||
<Filename Value="cheatengine.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
@ -1604,6 +1611,7 @@
|
||||
<Unit171>
|
||||
<Filename Value="luabrush.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="LuaBrush"/>
|
||||
</Unit171>
|
||||
<Unit172>
|
||||
<Filename Value="LuaPicture.pas"/>
|
||||
@ -2852,6 +2860,11 @@
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="frmAnchorEditor"/>
|
||||
</Unit414>
|
||||
<Unit415>
|
||||
<Filename Value="disassemblerarm32thumb.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="disassemblerArm32Thumb"/>
|
||||
</Unit415>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
|
@ -120,7 +120,7 @@ uses
|
||||
autoassemblercode, CSharpCompiler, newhintwindow, memrecDataStructures,
|
||||
LuaCECustomButton, DBVMDebuggerInterface, frmCR3SwitcherUnit, tcclib,
|
||||
sourcecodehandler, frmSourceDisplayUnit, disassemblerarm64, contexthandler,
|
||||
DisAssemblerARM32, frmAnchorEditor;
|
||||
DisAssemblerARM32, frmAnchorEditor, disassemblerArm32Thumb;
|
||||
|
||||
{$R cheatengine.res}
|
||||
{$IFDEF windows}
|
||||
@ -320,7 +320,6 @@ begin
|
||||
end;
|
||||
|
||||
if istrainer then
|
||||
application.Scaled:=true;
|
||||
|
||||
if not istrainer then
|
||||
begin
|
||||
|
@ -148,7 +148,7 @@ const X86_32Context_specialized: array of TContextElement_register=(
|
||||
(entrytype:0; name:'DS'; size:2; displayType: 0; ContextOffset: integer(@PCONTEXT32(nil)^.SegDs); BitStart:0),
|
||||
(entrytype:0; name:'ES'; size:2; displayType: 0; ContextOffset: integer(@PCONTEXT32(nil)^.SegEs); BitStart:0),
|
||||
(entrytype:0; name:'FS'; size:2; displayType: 0; ContextOffset: integer(@PCONTEXT32(nil)^.SegFs); BitStart:0),
|
||||
(entrytype:0; name:'GS'; size:2; displayType: 0; ContextOffset: integer(@PCONTEXT32(nil)^.SegGs); BitStart:0),
|
||||
(entrytype:0; name:'GS'; size:2; displayType: 0; ContextOffset: integer(@PCONTEXT32(nil)^.SegGs); BitStart:0)
|
||||
);
|
||||
{$endif}
|
||||
|
||||
@ -611,7 +611,7 @@ begin
|
||||
for i:=0 to 7 do
|
||||
begin
|
||||
e.name:='XMM'+inttostr(i);
|
||||
e.ContextOffset:=integer(@PCONTEXT32(nil)^.Ext.XmmRegisters.LegacyXMM[i]);
|
||||
e.ContextOffset:=integer(@PCONTEXT32(nil)^.Ext.XmmRegisters[i]);
|
||||
end;
|
||||
|
||||
ContextInfo_X86_32.setFloatingPointRegisters(@X86_32Context_fpu);
|
||||
@ -619,10 +619,11 @@ begin
|
||||
e.entrytype:=0;
|
||||
e.size:=10;
|
||||
e.displayType:=0;
|
||||
setlength(X86_32Context_fpu2,8);
|
||||
|
||||
for i:=0 to 7 do
|
||||
begin
|
||||
e.name:='FP('+inttostr(i)+')'
|
||||
e.name:='FP('+inttostr(i)+')';
|
||||
e.ContextOffset:=integer(@PCONTEXT32(nil)^.FloatSave.RegisterArea[i*10]);
|
||||
X86_32Context_fpu2[i]:=e;
|
||||
end;
|
||||
|
@ -3,7 +3,7 @@ unit dbvmPhysicalMemoryHandler;
|
||||
{$MODE Delphi}
|
||||
|
||||
{
|
||||
implement replaced handlers for ReadProcssMemory and WriteProcessMemory so it
|
||||
implement replaced handlers for ReadProcessMemory and WriteProcessMemory so it
|
||||
reads/writes to the physical memory instead
|
||||
}
|
||||
|
||||
|
@ -601,7 +601,7 @@ begin
|
||||
{$ifdef cpu64}
|
||||
copymemory(@context^.FltSave.FloatRegisters[i], n,10);
|
||||
{$else}
|
||||
copymemory(@context^.ext.FPURegisters[i], n,10);
|
||||
copymemory(@context^.ext.FloatRegisters[i], n,10);
|
||||
copymemory(@context^.FloatSave.RegisterArea[10*i], n,10);
|
||||
{$endif}
|
||||
end;
|
||||
@ -625,7 +625,7 @@ begin
|
||||
{$ifdef cpu64}
|
||||
PXMMFIELDS(@context^.FltSave.XmmRegisters[i])^[j]:=PXMMFIELDS(ptruint(@bp.changereg.new_XMM0)+16*i)^[j];
|
||||
{$else}
|
||||
PXMMFIELDS(@context^.ext.XMMRegisters.LegacyXMM[j])^[j]:=bp.changereg.new_XMM0[j];
|
||||
PXMMFIELDS(@context^.ext.XMMRegisters[j])^[j]:=bp.changereg.new_XMM0[j];
|
||||
{$endif}
|
||||
end;
|
||||
end;
|
||||
|
@ -5,7 +5,7 @@ unit DisAssemblerARM32;
|
||||
{$WARN 3177 off : Some fields coming after "$1" were not initialized}
|
||||
interface
|
||||
|
||||
//lasty update at :a5.5
|
||||
//last update at :a7
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LastDisassembleData;
|
||||
|
@ -5068,7 +5068,7 @@ begin
|
||||
{$else}
|
||||
x:=0;
|
||||
|
||||
if readprocessmemory(processhandle, pointer(address-1), @opcode, sizeof(opcode), x) then
|
||||
if readprocessmemory(processhandle, pointer(address and $fffffffe), @opcode, sizeof(opcode), x) then
|
||||
puint16(@LastDisassembleData.Bytes[0])^:=opcode;
|
||||
{$endif}
|
||||
|
||||
|
@ -1,16 +1,24 @@
|
||||
add a memrec.OnValueChanged and memrec.OnValueChangedByUser
|
||||
cejvmti alloc can alloc outside the 2GB andf then passing pointers fails (https://forum.cheatengine.org/viewtopic.php?p=5780375#5780375)
|
||||
ctrl+space to sync disasembler with hexview is broken
|
||||
|
||||
add lua command use getFileSize() when a file is open for hexediting
|
||||
frmregisters seems to have the wrong values
|
||||
autoassemble execute seems to do a full symbollist enum ?
|
||||
assembling in thuimbmode seems to not negate the extra bit
|
||||
thumb might not be correct
|
||||
|
||||
add option for big endian pointer support
|
||||
|
||||
|
||||
tcc: not all code is debugable/visible(see script at https://pastebin.com/MZGaJ0Su )
|
||||
|
||||
break and trace compare gives access violation (unreprocducable)
|
||||
fix/rewrite thumb disAssembler
|
||||
|
||||
find out what writes dialog is too small on high dpi
|
||||
refix the dark mode highlighting issue on the addresslist
|
||||
|
||||
{$luacode sync} parameter
|
||||
{$luacode newluastate} parameter
|
||||
|
||||
|
||||
|
||||
luacode for mac
|
||||
luacode for ceserver (create a socket in the target which connects to ceserver, and ceserver connects to ce)
|
||||
|
||||
lua editor AND aa editor: when inside a string, the {$asm} inside the string disables lua mode. Boith the parser and AA need to deal with that
|
||||
|
||||
@ -18,8 +26,6 @@ add symbol path configuration
|
||||
structure spider: dpi fixes (default window size and base address edit fields)
|
||||
structure spider: doubleclick on column 2 value should make you go there
|
||||
|
||||
formeditor: include a new anchor editor
|
||||
|
||||
mac/aarch64: show S registers (similar to xmm)
|
||||
mac:pointerscan sort by offset
|
||||
mac: memview/disassembler updates in a seperate thread and only render when done
|
||||
|
@ -90,7 +90,7 @@ type
|
||||
|
||||
public
|
||||
{ Public declarations }
|
||||
procedure SetContextPointer(context: PContext; _stack: PByte; stacksize: integer);
|
||||
procedure SetContextPointer(newcontext: PContext; _stack: PByte; stacksize: integer);
|
||||
end;
|
||||
|
||||
{%endregion TRegisters }
|
||||
@ -103,7 +103,7 @@ resourcestring
|
||||
rsLabelRegisterHint = 'DoubleClick: Browse this memory region.' + LineEnding + 'Right Mouse Click: Register Value will be copied to Clipboard and Context Menu will open.';
|
||||
rsNoDescription = 'No Description';
|
||||
|
||||
procedure TRegisters.SetContextPointer(context: PContext; _stack: PByte; stacksize: integer);
|
||||
procedure TRegisters.SetContextPointer(newcontext: PContext; _stack: PByte; stacksize: integer);
|
||||
var
|
||||
pre,f: string;
|
||||
sizeNeeded: integer;
|
||||
@ -118,7 +118,7 @@ var
|
||||
begin
|
||||
oldContextHandler:=contexthandler;
|
||||
|
||||
self.context:=context;
|
||||
self.context:=newcontext;
|
||||
contexthandler:=getBestContextHandler;
|
||||
|
||||
|
||||
|
@ -951,7 +951,7 @@ begin
|
||||
{$ifdef cpu64}
|
||||
different:=CompareMem(@compareinfo.c.FltSave.XmmRegisters[0], @thisinfo.c.FltSave.XmmRegisters[0], xmmcount*sizeof(M128A));
|
||||
{$else}
|
||||
different:=CompareMem(@compareinfo.c.ext.XMMRegisters.LegacyXMM[0], @thisinfo.c.ext.XMMRegisters.LegacyXMM[0], xmmcount*sizeof(TJclXMMRegister));
|
||||
different:=CompareMem(@compareinfo.c.ext.XMMRegisters[0], @thisinfo.c.ext.XMMRegisters[0], xmmcount*sizeof(M128A));
|
||||
{$endif}
|
||||
|
||||
if not different then
|
||||
|
@ -168,6 +168,7 @@ begin
|
||||
c:=getConnection;
|
||||
if c<>nil then
|
||||
begin
|
||||
{$ifdef cpu64}
|
||||
if processhandler.is64Bit then
|
||||
begin
|
||||
context.contextsize:=sizeof(TNetworkX86_64Context)+8;
|
||||
@ -204,6 +205,7 @@ begin
|
||||
context.contextx86_64.fp:=lpcontext.FltSave;
|
||||
end
|
||||
else
|
||||
{$endif}
|
||||
begin
|
||||
context.contextsize:=sizeof(TNetworkX86_64Context)+8;
|
||||
context.contexttype:=0; // x86
|
||||
@ -224,7 +226,7 @@ begin
|
||||
context.contextx86.eflags:=lpcontext.EFlags;
|
||||
context.contextx86.esp:=lpcontext.{$ifdef cpu64}rsp{$else}esp{$endif};
|
||||
context.contextx86.ss:=lpcontext.segss;
|
||||
context.contextx86.fp:=lpcontext.FltSave;
|
||||
context.contextx86.fp:=lpcontext.{$ifdef cpu64}FltSave{$else}ext{$endif};
|
||||
end;
|
||||
|
||||
|
||||
@ -313,7 +315,7 @@ begin
|
||||
lpcontext.EFlags:=context^.contextx86.eflags;
|
||||
lpcontext.{$ifdef cpu64}rsp{$else}esp{$endif}:=context^.contextx86.esp;
|
||||
lpcontext.segss:=context^.contextx86.ss;
|
||||
lpcontext.FltSave:=context^.contextx86.fp;
|
||||
lpcontext.{$ifdef cpu64}FltSave{$else}ext{$endif}:=context^.contextx86.fp;
|
||||
end;
|
||||
end; //you should use GetThreadContextArm
|
||||
finally
|
||||
|
@ -1372,6 +1372,9 @@ begin
|
||||
|
||||
s:=pchar(@pSymInfo.Name);
|
||||
|
||||
{ if uppercase(s).StartsWith('GETTICK') then
|
||||
OutputDebugString('ES: symbol:'+s); }
|
||||
|
||||
self.processThreadEvents;
|
||||
|
||||
|
||||
@ -1381,8 +1384,10 @@ begin
|
||||
if self.currentModuleIsNotStandard then
|
||||
s:='_'+s;
|
||||
|
||||
if TSymTagEnum(pSymInfo.Tag)=SymTagFunction then
|
||||
if (TSymTagEnum(pSymInfo.Tag)=SymTagFunction) then
|
||||
begin
|
||||
if self.pdbonly=false then exit(true); //hello wine, no thank you
|
||||
|
||||
extraSymbolData:=TExtraSymbolData.create;
|
||||
self.symbollist.AddExtraSymbolData(extraSymbolData);
|
||||
|
||||
@ -4998,7 +5003,7 @@ begin
|
||||
//get the register value, and because this is an address specifier, use the full 32-bits
|
||||
if tokens[i][1] in ['x','X','y','Y'] then //xmm/ymm
|
||||
begin
|
||||
tokens[i]:=inttohex(ApplyTokenType(pptruint(@context^.{$ifdef cpu64}FltSave.XmmRegisters[regnr]{$else}ext.XMMRegisters.LongXMM[regnr]{$endif})^),8);
|
||||
tokens[i]:=inttohex(ApplyTokenType(pptruint(@context^.{$ifdef cpu64}FltSave.XmmRegisters[regnr]{$else}ext.XMMRegisters[regnr]{$endif})^),8);
|
||||
continue;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user