ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Thu Jan 21, 2021 12:53 am

All times are UTC




Post new topic  Reply to topic  [ 14 posts ] 
Author Message
 Post subject: where to Start QuickBMS
PostPosted: Sun Nov 08, 2020 1:32 pm 

Joined: Sun Nov 08, 2020 1:07 pm
Posts: 26
Hi, I'm new in whole game modding scene
from thing I read, QuickBMS is a powerful tool for extract and reimport file to game archives, so I want to start learning it
but I have some question before anything
1. what is best place to learn QuickBMS scripting (I mean any good document?) (I'm a little familiar with c++)
2. I know I can use QuickBMS reimport feature for import exported file back to archive, but if I want to use reimport i have to deal with size limit (my edited file need to be smaller or equal to original file) so I want to know its possible to create a script to import file to archive without size limit? (I mean not using reimport and instead write a separate script to import the files with bigger size to archive)
I'd appreciate it if someone answers my questions.

best regard.


Top
   
PostPosted: Sun Nov 08, 2020 3:59 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11886
For the documentation about the scripting language:
http://aluigi.org/papers/quickbms.txt

Then it's good to take a look at the many examples available on this forum, just download the samples files provided by the users and the relative script linked in each topic.

There are two topics in the Tutorial section that help a lot:
viewtopic.php?f=4&t=72
viewtopic.php?f=4&t=34

Do you already know how to identify fields in formats?
I mean, do you have practice with hex editor and figuring out structures?
quickbms with the -0 -V options is a huge help for that work.

Regarding the reimporting, use reimport2.bat and everything is ok.
reimport.bat: just injection of the new file without any other change
reimport2.bat: injection/appending of the new file with changing of the offset and size fields.


Top
   
PostPosted: Sun Nov 08, 2020 5:51 pm 

Joined: Sun Nov 08, 2020 1:07 pm
Posts: 26
aluigi wrote:
For the documentation about the scripting language:
http://aluigi.org/papers/quickbms.txt

Then it's good to take a look at the many examples available on this forum, just download the samples files provided by the users and the relative script linked in each topic.

There are two topics in the Tutorial section that help a lot:
viewtopic.php?f=4&t=72
viewtopic.php?f=4&t=34

Do you already know how to identify fields in formats?
I mean, do you have practice with hex editor and figuring out structures?
quickbms with the -0 -V options is a huge help for that work.

Regarding the reimporting, use reimport2.bat and everything is ok.
reimport.bat: just injection of the new file without any other change
reimport2.bat: injection/appending of the new file with changing of the offset and size fields.


Thanks for reply and Good information
about knowing hex editing, I used to work with it a little in past but not for reversing files, so I don't have good knowledge about reversing files and figuring out structures.
You know any Good tutorial or Document about it?
and one other thing, there is any tutorial to find out a archive use what type of compression method?


Top
   
PostPosted: Mon Nov 09, 2020 5:35 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11886
Try taking a look at the Tutorials section.


Top
   
PostPosted: Mon Nov 09, 2020 7:51 pm 

Joined: Sat Aug 09, 2014 2:34 pm
Posts: 1132
Check Mr.Mouse youtube channel with video tutorials and explanations

https://www.youtube.com/watch?v=ysh35jP ... GrVNJ2kS2f


Top
   
PostPosted: Mon Nov 09, 2020 8:16 pm 

Joined: Sun Nov 08, 2020 1:07 pm
Posts: 26
thanks ekay and aluigi
Now i know everything im need for start working with quickBMS


Top
   
PostPosted: Thu Nov 26, 2020 4:44 pm 

Joined: Sun Nov 08, 2020 1:07 pm
Posts: 26
I have another question and I think this topic is right place to ask it (btw sorry for asking to many question)
I have two file, one is my main file and script work with it most of times
other file is just a simple file store size of first file with some other information

what I want to do is first export all files from main archive (I don't have any problem in export)
after that when I try to import them back I need to
open Both first and second file
first (before re-import) get size of original first file and store it in some variable, and then import files back to archive, after all file imported to archive get new file size again
then open other file, search for original file size and replace it with new file size

anyone can give me some script that open 2 file with same name and different ext, and do stuff with it? so I can learn from it
and how can I get size of a file in QuickBMS?


thanks

--edit--
two other thing come into my main
1- there is anyway to know script run with re-import mode? like some kind of Booleans?
Code:
if REIMPORTMODE
   # do stuff when only in re-import mode
endif

its handy when you want to do some stuff only in re-import mode
2- how can I get file name of opened file in script? I want to name exported file based on the original archive name


Top
   
PostPosted: Thu Nov 26, 2020 5:29 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11886
open FDDE "extension1"
open FDDE "extension2" 1

get NUM long # from file with extension1
get NUM long 1 # from file with extension 2


Top
   
PostPosted: Thu Nov 26, 2020 5:32 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11886
1) there will be a new command in the next version of quickbms but it will be used to used to set the reimport mode.
I can check if I can add some global variables returning the current reimport mode, like QUICKBMS_REIMPORT.

2)
get NAME filename


Top
   
PostPosted: Thu Nov 26, 2020 6:08 pm 

Joined: Sun Nov 08, 2020 1:07 pm
Posts: 26
aluigi wrote:
open FDDE "extension1"
open FDDE "extension2" 1

get NUM long # from file with extension1
get NUM long 1 # from file with extension 2


thanks, I also get file size with ASIZE (I don't know why I don't check document before asking)
aluigi wrote:
1) there will be a new command in the next version of quickbms but it will be used to used to set the reimport mode.
I can check if I can add some global variables returning the current reimport mode, like QUICKBMS_REIMPORT.

its will be handy to have global variables to return what mode script running on


Top
   
PostPosted: Tue Dec 01, 2020 6:23 pm 

Joined: Sun Nov 08, 2020 1:07 pm
Posts: 26
Hi, I have some other question
I want to first get 3 byte with
Code:
GET CHAR THREEBYTE

for example its give me this value
08 00 00 -to little-endian-> 00 00 08
two values ​​are stored in this HEX in 1.5 bytes (000008 -> 000 , 008)
how can I get these 1.5 byte value? so I can have 0 and 8
(sorry if I cant explain it right)

-- edit --
I read document and find out about GetBits, so i try it with
Code:
GetBits CHAR_1 12
GetBits CHAR_2 12

for get two 1.5 byte, but problem is its not little endian
I need to first Get 3 byte with
Code:
GET CHAR THREEBYTE

convert it to little endian (80 90 70 -> 70 90 80) and then put it back
so I think it good to use MEMORY_FILE for this job, but I don't know how can I actually do it, anyone can help me?
Code:
SAVEPOS CHARACTER_POSITION
log MEMORY_FILE CHARACTER_POSITION 3
GetBits CHARACTER_POSITION_1 12 MEMORY_FILE
GetBits CHARACTER_POSITION_2 12 MEMORY_FILE


Top
   
PostPosted: Thu Dec 03, 2020 10:07 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11886
getbits is perfecft for that job and the endianess you get is correct (tested and confirmed for decades).
Here I see no problems but it depends by the results you were expecting:
Code:
. 00000000 getbits VAR1       0x00000008 12
. 00000002 getbits VAR2       0x00000000 12
...
. 00000003 getbits VAR1       0x00000080 12
. 00000005 getbits VAR2       0x00000709 12

But if you want to change the endianess just specify it before getbits:
Code:
endian big
getbits VAR1 12
getbits VAR2 12
endian little


Top
   
PostPosted: Thu Dec 03, 2020 5:04 pm 

Joined: Sun Nov 08, 2020 1:07 pm
Posts: 26
aluigi wrote:
getbits is perfecft for that job and the endianess you get is correct (tested and confirmed for decades).
Here I see no problems but it depends by the results you were expecting:
Code:
. 00000000 getbits VAR1       0x00000008 12
. 00000002 getbits VAR2       0x00000000 12
...
. 00000003 getbits VAR1       0x00000080 12
. 00000005 getbits VAR2       0x00000709 12

But if you want to change the endianess just specify it before getbits:
Code:
endian big
getbits VAR1 12
getbits VAR2 12
endian little

thank you for reply, but I still have a problem
as I said, I need to first get 3 byte and convert it to little endian and save it somewhere, and after that get 12 bite from converted 3 byte...
[12 34 56] -> [56 34 12] -> [563],[412]
but I don't know how can I actually do it


Top
   
PostPosted: Thu Dec 03, 2020 9:18 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 11886
Ah ok, so you just need a very simple math operation:
Code:
get VAR threebyte
xmath VAR1 "(VAR >> 12) & ((1 << 12) - 1)"
xmath VAR2 " VAR        & ((1 << 12) - 1)"

print "%VAR1|x% %VAR2|x%"

The AND mask is a lot more easy than how it looks and can be quickly adapted for future operations.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 14 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