Compatibility Issue v0.12.0 - Findloc string variable not working anymore

Doubts, help and support about QuickBMS and other game research tools
zgoro
Posts: 16
Joined: Sat May 02, 2020 12:46 pm

Compatibility Issue v0.12.0 - Findloc string variable not working anymore

Post by zgoro »

Hi guys,

Been having an issue when running my scripts that were working perfectly fine with version v.0.11.0, but stopped working in v.0.12.0.

Basically Findloc command is not reading the string variable anymore:

Code: Select all

Math A = 1
Open FDSE "prova.txt" 100             # an external .txt file with strings:  _1_ , _2_ ...

goto 0x0 100

String VAR P "_%A%_"                  # String to search as VAR
findloc OFFSET string VAR 100 ""      # VAR is not read in v.0.12.0
print "VAR found at %OFFSET|x%"
Last edited by zgoro on Mon Dec 12, 2022 9:18 am, edited 2 times in total.
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: Version v0.12.0 issue - Findloc string variable not working anymore

Post by spiritovod »

@zgoro: I suppose that's how quickbms print works now in latest version (it's adding \n to the end of output, like actual print command). Anyway, it's better to use usual printf like this: [string VAR p "_%d_" A] to avoid possible issues.
zgoro
Posts: 16
Joined: Sat May 02, 2020 12:46 pm

Re: Version v0.12.0 issue - Findloc string variable not working anymore

Post by zgoro »

Still not passed as variable, I'll report this into quickBMS errors topic.
@mods, please feel free to delete this topic, thanks!
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: Compatibility Issue - Findloc string variable not working anymore

Post by spiritovod »

@zgoro: Suggested solution works fine here with latest stable 0.12 version, otherwise I would not recommend it.

Code: Select all

VAR found at 0x0000000000000017
Make sure you are using it correctly, as p and P are different operators and also %d is different from %02d or %04d and should be adjusted accordingly in case of changes in txt pattern, etc.
zgoro
Posts: 16
Joined: Sat May 02, 2020 12:46 pm

Re: Compatibility Issue - Findloc string variable not working anymore

Post by zgoro »

Code: Select all

Math A = 1
Open FDSE "prova.txt" 100             # an external .txt file with strings:  _1_ , _2_ ...

goto 0x0 100

string VAR p "_%d_" A                 # String to search
print "%VAR%"

findloc OFFSET string VAR 100 "" 0      # VAR is not read
print "VAR found at %OFFSET|x%"
Not passing it using QuickBMS 0.12.0:
_1_
VAR found at
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: Compatibility Issue v0.12.0 - Findloc string variable not working anymore

Post by spiritovod »

@zgoro: This is expected, because 0 at the end of findloc means you're limiting offset range to 0-0 here (unless you'll do goto to the end of file and search backwards). If you'll remove that 0 from findloc, it will work properly (and you don't have it in the original version of the script).
zgoro
Posts: 16
Joined: Sat May 02, 2020 12:46 pm

Re: Compatibility Issue v0.12.0 - Findloc string variable not working anymore

Post by zgoro »

Thanks it did work!

Unfortunately this change does affect a large number of scripts made, so I'll definitely stick with the older version for the moment.