2017-12-17 11:14 CET

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000176Cheat Enginepublic2012-11-27 21:30
Reporterjgoemat 
Assigned ToDark Byte 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Summary0000176: DW,DD and DQ write first value always when multiple entered
Description"DD 1 2 3 4" will actually write "00000001 00000001 00000001 00000001" instead of using 2, 3 and 4.
Additional InformationAssemblerunit.pas uses 'parameter1' instead of tokens[i] in the loop. This enables it to use labels and other CE things like (float)5.7 and default to hex, so I added a 'getChangedToken' function that calls gettokentype() like happens to set parameter1 and replaced those calls

- adddword(bytes,strtoint(parameter1));
+ adddword(bytes,strtoint(getChangedToken(tokens[i])));
TagsNo tags attached.
Attached Files
  • patch file icon fix_dw_dd_dq.patch (2,781 bytes) 2012-08-18 00:45 -
    From fafbd0b07b2ebe663721ee488b65add621d25221 Mon Sep 17 00:00:00 2001
    From: Jason Goemaat <[email protected]>
    Date: Fri, 17 Aug 2012 16:26:43 -0500
    Subject: [PATCH 1/2] Fixed dw, dd, dq
    
    ---
     Cheat Engine/Assemblerunit.pas |    6 +++---
     1 file changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/Cheat Engine/Assemblerunit.pas b/Cheat Engine/Assemblerunit.pas
    index d3b3ff6..e496b35 100644
    --- a/Cheat Engine/Assemblerunit.pas	
    +++ b/Cheat Engine/Assemblerunit.pas	
    @@ -3320,7 +3320,7 @@ begin
       if tokens[0]='DW' then
       begin
         for i:=1 to nroftokens-1 do
    -      addword(bytes,strtoint(parameter1));
    +      addword(bytes,strtoint(tokens[i]));
         result:=true;
         exit;
       end;
    @@ -3328,7 +3328,7 @@ begin
       if tokens[0]='DD' then
       begin
         for i:=1 to nroftokens-1 do
    -      adddword(bytes,strtoint(parameter1));
    +      adddword(bytes,strtoint(tokens[i]));
         result:=true;
         exit;
       end;
    @@ -3336,7 +3336,7 @@ begin
       if tokens[0]='DQ' then
       begin
         for i:=1 to nroftokens-1 do
    -      addqword(bytes,StrToQWordEx(parameter1));
    +      addqword(bytes,StrToQWordEx(tokens[i]));
         result:=true;
         exit;
       end;  
    -- 
    1.7.10.msysgit.1
    
    
    From ebaeec2a87225142e2c30a6ab54660ec17b5b3d2 Mon Sep 17 00:00:00 2001
    From: Jason Goemaat <[email protected]>
    Date: Fri, 17 Aug 2012 16:52:28 -0500
    Subject: [PATCH 2/2] FixDWDDDQ
    
    ---
     Cheat Engine/Assemblerunit.pas |   17 +++++++++++++----
     1 file changed, 13 insertions(+), 4 deletions(-)
    
    diff --git a/Cheat Engine/Assemblerunit.pas b/Cheat Engine/Assemblerunit.pas
    index e496b35..c84a30e 100644
    --- a/Cheat Engine/Assemblerunit.pas	
    +++ b/Cheat Engine/Assemblerunit.pas	
    @@ -2006,6 +2006,15 @@ begin
     
     end;
     
    +function getChangedToken(token:string): string;
    +var temp:string;
    +  ttype:TTokenType;
    +begin
    +  temp:=token;
    +  ttype:=gettokentype(temp,'');
    +  getChangedToken:=temp
    +end;
    +
     function gettokentype(var token:string;token2: string): TTokenType;
     var i,err: integer;
         temp:string;
    @@ -3320,7 +3329,7 @@ begin
       if tokens[0]='DW' then
       begin
         for i:=1 to nroftokens-1 do
    -      addword(bytes,strtoint(tokens[i]));
    +      addword(bytes,strtoint(getChangedToken(tokens[i])));
         result:=true;
         exit;
       end;
    @@ -3328,15 +3337,15 @@ begin
       if tokens[0]='DD' then
       begin
         for i:=1 to nroftokens-1 do
    -      adddword(bytes,strtoint(tokens[i]));
    +      adddword(bytes,strtoint(getChangedToken(tokens[i])));
         result:=true;
    -    exit;
    +    exit
       end;
     
       if tokens[0]='DQ' then
       begin
         for i:=1 to nroftokens-1 do
    -      addqword(bytes,StrToQWordEx(tokens[i]));
    +      addqword(bytes,StrToQWordEx(getChangedToken(tokens[i])));
         result:=true;
         exit;
       end;  
    -- 
    1.7.10.msysgit.1
    
    
    patch file icon fix_dw_dd_dq.patch (2,781 bytes) 2012-08-18 00:45 +

-Relationships
+Relationships

-Notes

~0000378

Dark Byte (developer)

fixed in the svn (HexStrToInt)
+Notes

-Issue History
Date Modified Username Field Change
2012-08-18 00:45 jgoemat New Issue
2012-08-18 00:45 jgoemat File Added: fix_dw_dd_dq.patch
2012-08-21 02:04 Dark Byte Status new => confirmed
2012-11-27 21:30 Dark Byte Note Added: 0000378
2012-11-27 21:30 Dark Byte Status confirmed => resolved
2012-11-27 21:30 Dark Byte Resolution open => fixed
2012-11-27 21:30 Dark Byte Assigned To => Dark Byte
+Issue History