Skip to content

Commit

Permalink
change the filter code to aggressive only and use it in some tools
Browse files Browse the repository at this point in the history
  • Loading branch information
cheat-engine committed Jan 10, 2020
1 parent 088f3cd commit ad4e844
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cheat Engine/DissectCodeThread.pas
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,7 @@ procedure TDissectCodeThread.Execute;
try
d.showsymbols:=false;
d.showmodules:=false;
d.aggressivealignment:=true;

while not terminated do
begin
Expand Down
10 changes: 9 additions & 1 deletion Cheat Engine/disassembler.pas
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ TDisassembler=class
fsyntaxhighlighting: boolean;
fOnDisassembleOverride: TDisassembleEvent;
fOnPostDisassemble: TDisassembleEvent;
faggressivealignment: boolean;


modrmposition: TMRPos;
Expand Down Expand Up @@ -174,6 +175,7 @@ TDisassembler=class
property syntaxhighlighting: boolean read fsyntaxhighlighting write setSyntaxHighlighting;
property OnDisassembleOverride: TDisassembleEvent read fOnDisassembleOverride write fOnDisassembleOverride;
property OnPostDisassemble: TDisassembleEvent read fOnPostDisassemble write fOnPostDisassemble;
property aggressivealignment: boolean read faggressivealignment write faggressivealignment;
end;


Expand Down Expand Up @@ -1972,7 +1974,7 @@ function TDisassembler.disassemble(var offset: ptrUint; var description: string)
$00 : begin


if ((((offset) and $f)=0) and (memory[1]<>0) ) or ((memory[1]=$55) and (memory[2]=$89) and (memory[3]=$e5)) then
if (aggressivealignment and (((offset) and $f)=0) and (memory[1]<>0) ) or ((memory[1]=$55) and (memory[2]=$89) and (memory[3]=$e5)) then
begin
description:='Filler';
lastdisassembledata.opcode:='db';
Expand Down Expand Up @@ -15424,10 +15426,14 @@ function previousopcode(address: ptrUint; d: Tdisassembler=nil):ptrUint;
found: boolean;
i: ptrUint;

aggressive: boolean;
begin
if d=nil then
d:=defaultDisassembler;

aggressive:=d.aggressivealignment;
d.aggressivealignment:=true;

x:=previousOpcodeHelp(d, address,80, result);
if x<>address then
begin
Expand Down Expand Up @@ -15462,6 +15468,8 @@ function previousopcode(address: ptrUint; d: Tdisassembler=nil):ptrUint;
end;
end;
end;

d.aggressivealignment:=aggressive;
end;


Expand Down
1 change: 1 addition & 0 deletions Cheat Engine/frmDisassemblyscanunit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ constructor TDisassemblerthread.create(suspended: boolean);
inherited create(suspended);

disassembler:=TDisassembler.Create;
disassembler.aggressivealignment:=true;
end;

destructor TDisassemblerthread.destroy;
Expand Down

0 comments on commit ad4e844

Please sign in to comment.