ZenHAX
http://zenhax.com/

quickbms string saving or string asize
http://zenhax.com/viewtopic.php?f=21&t=1018
Page 1 of 1

Author:  spider91 [ Sat Jun 06, 2015 7:32 am ]
Post subject:  quickbms string saving or string asize

Hi. I've made a script for text files (.strdb) of shadow of mordor and encountered one problem - quickbms can't save strings! (or i just don't know how :mrgreen: ). There is no sizes of fields in .strdb, only offsets and then you read unicode text, but how can i save it? I've bypassed that problem like this

Code:
idstring "SKDB"
get VERSION long
get HEADER_SIZE long
get STRINGS long
get DUMMY long
get TEXT_SIZE long
get DUMMY long
set TOC_SIZE long STRINGS
math TOC_SIZE *= 8
math TOC_SIZE += HEADER_SIZE
for i = 0 < STRINGS
   get NAME_ID long
   string NAME_ID p= "0x%08x" NAME_ID
   string NAME_ID += ".txt"
   get OFFSET long
   math OFFSET *= 2
   math OFFSET += TOC_SIZE
   savepos POS
   goto OFFSET
   FindLoc SIZE STRING "\x00\x00\x00"
   math SIZE -= OFFSET
   math SIZE += 1
   goto POS
   log NAME_ID OFFSET SIZE
next i


but thats not very comfortable way and i need to save each string to another file, cause using memory files will loose string ID. So here we have another problem - how to save ID (long) to memory file like a text? If it's not clear here is an example of what i need.
it must be a text file with lines like this
Code:
ID1=TEXT1
ID2=TEXT2
...

So can you add string saving or string asize (to get sizes an log it like normal file) and converting hex number to string on memory file, aluigi?

Here is a .strdb file
https://mega.nz/#!Uk4C0Dab!zcjFMta5WZ8h ... 5CgrpRXyZs

Author:  aluigi [ Sun Jun 07, 2015 1:26 pm ]
Post subject:  Re: quickbms string saving or string asize

The Slog command is still to be designed:
viewtopic.php?p=4944#p4944

Author:  spider91 [ Sun Jun 07, 2015 1:52 pm ]
Post subject:  Re: quickbms string saving or string asize

that would be really usefull. And does this includes converting of hex numbers to string in memory files?

Author:  aluigi [ Sun Jun 07, 2015 1:57 pm ]
Post subject:  Re: quickbms string saving or string asize

What you mean exactly?
Quickbms already has tons of ways to handle and convert numbers to strings and viceversa, it depends exactly what you want to do.
You can even use String p= to use Printf and doing any operation you desire:
string NAME p "0x%08x.txt" NAME_ID

Author:  spider91 [ Sun Jun 07, 2015 3:24 pm ]
Post subject:  Re: quickbms string saving or string asize

I read ID as long and want to log it to memory file, but like text, cause memory file will be a .txt. Is that possible?

Author:  aluigi [ Sun Jun 07, 2015 3:45 pm ]
Post subject:  Re: quickbms string saving or string asize

I give you a full example that shows how variables are both strings and numbers:
Code:
math VAR = 0x1234
log MEMORY_FILE 0 0
put VAR string MEMORY_FILE # the number in VAR is dumped as a string (decimal)
goto 0
get SIZE asize MEMORY_FILE
log "dump.dat" 0 SIZE MEMORY_FILE

Author:  spider91 [ Sun Jun 07, 2015 6:01 pm ]
Post subject:  Re: quickbms string saving or string asize

Thanks, i'll try that layter.

PS
Return "thanks" button, please =)

Author:  aluigi [ Mon Jun 08, 2015 4:20 pm ]
Post subject:  Re: quickbms string saving or string asize

When the "Thanks for posts" mod will be stable, probably after phpbb 3.1.5.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/