Skip to content

Commit

Permalink
fix rip relative issue
Browse files Browse the repository at this point in the history
  • Loading branch information
cheat-engine committed Jun 5, 2018
1 parent 9c6aa5c commit 10004d4
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions Cheat Engine/disassembler.pas
Original file line number Diff line number Diff line change
Expand Up @@ -11171,7 +11171,6 @@ function TDisassembler.disassemble(var offset: ptrUint; var description: string)
end;

7: begin
//and
lastdisassembledata.opcode:='cmp';
lastdisassembledata.parameters:=modrm(memory,prefix2,1,2,last,8);
lastdisassembledata.parametervaluetype:=dvtvalue;
Expand Down Expand Up @@ -15131,7 +15130,7 @@ function TDisassembler.disassemble(var offset: ptrUint; var description: string)
if riprelative then
begin
//add the current offset to the code between []
LastDisassembleData.modrmValue:=offset+ptrint(LastDisassembleData.modrmValue); //sign extended increase
LastDisassembleData.modrmValue:=offset+ptrint(integer(LastDisassembleData.modrmValue)); //sign extended increase

i:=pos('[',LastDisassembleData.parameters);
j:=PosEx(']',LastDisassembleData.parameters,i);
Expand Down Expand Up @@ -15528,12 +15527,12 @@ function tdisassembler.DecodeLastParametersToString: string;
if (LastDisassembleData.modrmValueType=dvtAddress) or (LastDisassembleData.parameterValueType<>dvtNone) then
begin
a:=false;
if LastDisassembleData.modrmValueType=dvtAddress then
value:=LastDisassembleData.modrmValue

if LastDisassembleData.parameterValueType<>dvtNone then
value:=LastDisassembleData.parameterValue
else
begin
value:=LastDisassembleData.parameterValue;
end;
if LastDisassembleData.modrmValueType<>dvtNone then
value:=LastDisassembleData.modrmValue;

if isAddress(value) then
begin
Expand Down

0 comments on commit 10004d4

Please sign in to comment.