Programming related discussions related to game research
Shokoniraya
Posts: 416 Joined: Sat Sep 15, 2018 5:22 am
Post
by Shokoniraya » Fri Mar 08, 2019 6:32 pm
i dont know its a problem or not, but i will tell you anyway, aluigi
Code: Select all
print "TEST1" findloc OBJE binary "\x4F\x42\x4A\x45" print "%OBJE%" print "TEST2"
you can see a file with name
inw and a bat file to do it, but if i remove OBJE in offset 22 in
inw file with hex, then rest of script can be start to print other part! (its happen just if binary cant find with findloc)
atom0s
Posts: 250 Joined: Sat Dec 27, 2014 8:49 pm
Post
by atom0s » Fri Mar 08, 2019 7:40 pm
Not sure what your issue is, looks to work fine for me. Prints: TEST1 22 TEST2 If I remove the pattern, it prints: TEST1 Looks to work fine.
aluigi
Site Admin
Posts: 12984 Joined: Wed Jul 30, 2014 9:32 pm
Post
by aluigi » Fri Mar 08, 2019 11:19 pm
Just to stay safe I think that it's ever better to use variable names that don't match the constant value, even if it's a binary value. @Shokoniraya Try calling the OBJE variable as TEST and check if you still have the problem.
Shokoniraya
Posts: 416 Joined: Sat Sep 15, 2018 5:22 am
Post
by Shokoniraya » Sat Mar 09, 2019 12:11 am
nothing changed and still has problem
aluigi
Site Admin
Posts: 12984 Joined: Wed Jul 30, 2014 9:32 pm
Post
by aluigi » Sat Mar 09, 2019 12:26 am
I don't see any problem, everything works perfectly. Remember that findloc terminates quickbms by default if the pattern is not found. Are you sure you don't need to use the following? findloc OBJE binary "\x4F\x42\x4A\x45" 0 "NOT FOUND"
Shokoniraya
Posts: 416 Joined: Sat Sep 15, 2018 5:22 am
Post
by Shokoniraya » Mon Mar 18, 2019 4:37 pm
And I want to ask something is there any way to find a binary with a unknow byte? Like this: "\xFF\xFF\XFF\x??\xFE" because \x?? has a different value in every files and how can i solve that?
aluigi
Site Admin
Posts: 12984 Joined: Wed Jul 30, 2014 9:32 pm
Post
by aluigi » Mon Mar 18, 2019 7:23 pm
Unfortunately doesn't exist a jolly character for findloc
Shokoniraya
Posts: 416 Joined: Sat Sep 15, 2018 5:22 am
Post
by Shokoniraya » Wed Mar 20, 2019 2:36 pm
solved with findloc OBJE binary "" 0 "" looks like quickbms has problem with string NAME p in -s option and that is why my script not working
aluigi
Site Admin
Posts: 12984 Joined: Wed Jul 30, 2014 9:32 pm
Post
by aluigi » Tue Mar 26, 2019 2:45 pm
There is not "string NAME p" in your posts. Are you sure you used it correctly?
Shokoniraya
Posts: 416 Joined: Sat Sep 15, 2018 5:22 am
Post
by Shokoniraya » Sun Mar 31, 2019 9:29 am
aluigi wrote: There is not "string NAME p" in your posts. Are you sure you used it correctly?
No, findloc problem solved with
"" 0 "" so,
string NAME p has problem in
-s option, that's a new problem
aluigi
Site Admin
Posts: 12984 Joined: Wed Jul 30, 2014 9:32 pm
Post
by aluigi » Sun Mar 31, 2019 12:58 pm
Show me how you used the -s option, full command.
Shokoniraya
Posts: 416 Joined: Sat Sep 15, 2018 5:22 am
Post
by Shokoniraya » Tue Apr 02, 2019 9:09 am
aluigi wrote: Show me how you used the -s option, full command.
Code: Select all
quickbms.exe -s "get SIZE asize ; get NAMER basename ; string NAME p \"%s%s\" \"FILE_\" NAMER ; log NAME 0 SIZE" "" MY_FILE.7z pause
file name will turning to
s but
string NAME + YOUR_STRING will works fine
so i can use same as above line and just check it and you will see (tested on quickbms 9.2.0)
and can you test -s option on huge scripts? (long scripts, a script with a lot on line (huge), sorry more my limited grammer)
i think there is another problem with huge scripts, can you test it? or its because
string NAME p ?
aluigi
Site Admin
Posts: 12984 Joined: Wed Jul 30, 2014 9:32 pm
Post
by aluigi » Tue Apr 02, 2019 3:39 pm
Here it works correctly. I used it on file2.bin and it tried to dump the file FILE_file2
Shokoniraya
Posts: 416 Joined: Sat Sep 15, 2018 5:22 am
Post
by Shokoniraya » Sat Apr 06, 2019 9:53 am
file name will dump as
s Windows:
8.1 QuickBMS version:
9.2.0 i replaced (
" ) to (
\" ) and i replace enter to (
; )
i posted my .bat file and do on Test.7z
Code: Select all
quickbms.exe -s "get SIZE asize ; get NAMER basename ; string NAME p \"%s%s\" \"FILE_\" NAMER ; log NAME 0 SIZE" "" Test.7z
aluigi
Site Admin
Posts: 12984 Joined: Wed Jul 30, 2014 9:32 pm
Post
by aluigi » Sat Apr 06, 2019 11:03 am
The reason is that in .bat files the % char is interpreted. You need to escape it by replacing %s with %%s
Shokoniraya
Posts: 416 Joined: Sat Sep 15, 2018 5:22 am
Post
by Shokoniraya » Sun Apr 07, 2019 11:10 am
aluigi wrote: The reason is that in .bat files the % char is interpreted. You need to escape it by replacing %s with %%s
works fine!
can you tell me other replacing words more than this?
["]
To [\"]
[enter-Char]
To [ ; ]
[%]
To [%%]
is there any other thing to replace?
aluigi
Site Admin
Posts: 12984 Joined: Wed Jul 30, 2014 9:32 pm
Post
by aluigi » Sun Apr 07, 2019 12:28 pm
I think they are almost all the escapes. Both command-line and .bat use |, <, > and & as special separators and redirectors, in that case they require to be "quoted" if part of the argument. On Linux the situation is a bit more complex, with at least ^ and $.