ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Sun Feb 26, 2017 10:04 am

All times are UTC




Post new topic  Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Sat Jun 06, 2015 7:32 am 

Joined: Sun Aug 24, 2014 5:26 pm
Posts: 184
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


Top
   
PostPosted: Sun Jun 07, 2015 1:26 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 5526
The Slog command is still to be designed:
viewtopic.php?p=4944#p4944


Top
   
PostPosted: Sun Jun 07, 2015 1:52 pm 

Joined: Sun Aug 24, 2014 5:26 pm
Posts: 184
that would be really usefull. And does this includes converting of hex numbers to string in memory files?


Top
   
PostPosted: Sun Jun 07, 2015 1:57 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 5526
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


Top
   
PostPosted: Sun Jun 07, 2015 3:24 pm 

Joined: Sun Aug 24, 2014 5:26 pm
Posts: 184
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?


Top
   
PostPosted: Sun Jun 07, 2015 3:45 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 5526
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


Top
   
PostPosted: Sun Jun 07, 2015 6:01 pm 

Joined: Sun Aug 24, 2014 5:26 pm
Posts: 184
Thanks, i'll try that layter.

PS
Return "thanks" button, please =)


Top
   
PostPosted: Mon Jun 08, 2015 4:20 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 5526
When the "Thanks for posts" mod will be stable, probably after phpbb 3.1.5.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 8 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited