From a0d0b7c88ed62d3e4fda6eee08556179c2abb923 Mon Sep 17 00:00:00 2001 From: Dark Byte Date: Tue, 7 Feb 2023 10:10:11 +0100 Subject: [PATCH 1/2] fix uppercase string check while it could be lowercase now --- Cheat Engine/parsers.pas | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/Cheat Engine/parsers.pas b/Cheat Engine/parsers.pas index 14deb1e5c6..7174e3e2e3 100755 --- a/Cheat Engine/parsers.pas +++ b/Cheat Engine/parsers.pas @@ -395,6 +395,8 @@ function ConvertHexStrToRealStr(const s: string): string; f: single; d: double; err: boolean; + + su: string; begin if s='' then exit(''); @@ -455,9 +457,10 @@ function ConvertHexStrToRealStr(const s: string): string; '(' : begin - if copy(s,1,5)='(INT)' then + su:=uppercase(s); + if copy(su,1,5)='(INT)' then begin - t:=copy(s,6); + t:=copy(su,6); try q:=StrToQWordEx(t); result:='$'+inttohex(q,8); @@ -466,27 +469,27 @@ function ConvertHexStrToRealStr(const s: string): string; end; end; - if copy(s,1,8)='(DOUBLE)' then + if copy(su,1,8)='(DOUBLE)' then begin - t:=copy(s,9); + t:=copy(su,9); val(t, d,j); if j=0 then begin result:='$'+inttohex(PINT64(@d)^,8); - if s[1]='-' then + if su[1]='-' then result:='-'+result; - if s[1]='+' then + if su[1]='+' then result:='+'+result; exit; end; end; - if copy(s,1,11)='(DOUBLE32L)' then + if copy(su,1,11)='(DOUBLE32L)' then begin - t:=copy(s,12); + t:=copy(su,12); val(t, d,j); if j=0 then begin @@ -496,9 +499,9 @@ function ConvertHexStrToRealStr(const s: string): string; end; end; - if copy(s,1,11)='(DOUBLE32H)' then + if copy(su,1,11)='(DOUBLE32H)' then begin - t:=copy(s,12); + t:=copy(su,12); val(t, d,j); if j=0 then begin @@ -508,18 +511,18 @@ function ConvertHexStrToRealStr(const s: string): string; end; end; - if copy(s,1,7)='(FLOAT)' then + if copy(su,1,7)='(FLOAT)' then begin - t:=copy(s,8); + t:=copy(su,8); val(t, f,j); if j=0 then begin result:='$'+inttohex(pdword(@f)^,8); - if s[1]='-' then + if su[1]='-' then result:='-'+result; - if s[1]='+' then + if su[1]='+' then result:='+'+result; exit; From 6c589c4de76a70341d06bb0ca293f79517f9af73 Mon Sep 17 00:00:00 2001 From: Dark Byte Date: Tue, 7 Feb 2023 10:29:13 +0100 Subject: [PATCH 2/2] fix parsing ranged scans that have a P(pick) command in there as well --- Cheat Engine/groupscancommandparser.pas | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Cheat Engine/groupscancommandparser.pas b/Cheat Engine/groupscancommandparser.pas index 65c6578e9a..b95baec3f2 100755 --- a/Cheat Engine/groupscancommandparser.pas +++ b/Cheat Engine/groupscancommandparser.pas @@ -271,7 +271,7 @@ procedure TGroupscanCommandParser.parseToken(s: string); elements[j].uservalue:=value; - if length(command)>=nextchar then + while length(command)>=nextchar do begin case command[nextchar] of 'P': elements[j].picked:=true; //elements marked picked will be added when doubleclicked in the addresslist @@ -291,6 +291,8 @@ procedure TGroupscanCommandParser.parseToken(s: string); else raise exception.create(rsGSCPInvalidGroupscanCommand); end; + + inc(nextchar); end;