How can i cut 16 bytes from a file with QuickBMS?

Doubts, help and support about QuickBMS and other game research tools
JesWhite
Posts: 47
Joined: Sun Jun 02, 2019 10:40 pm

How can i cut 16 bytes from a file with QuickBMS?

Post by JesWhite »

Image


this script for 4 byte

Code: Select all

get SIZE asize
get NAME basename
math SIZE - 4
string NAME + .ren
log NAME 0x4 SIZE


i found :)

Code: Select all

get SIZE asize
get NAME basename
math SIZE - 16
string NAME + .ren
log NAME 16 SIZE
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: How can i cut 16 bytes from a file with QuickBMS?

Post by aluigi »

Correct, you can also opt for the usage of an OFFSET variable:

Code: Select all

math OFFSET = 16
get SIZE asize
math SIZE - OFFSET
get NAME basename
string NAME + .ren
log NAME OFFSET SIZE
JesWhite
Posts: 47
Joined: Sun Jun 02, 2019 10:40 pm

Re: How can i cut 16 bytes from a file with QuickBMS?

Post by JesWhite »

aluigi wrote:Correct, you can also opt for the usage of an OFFSET variable:

Code: Select all

math OFFSET = 16
get SIZE asize
math SIZE - OFFSET
get NAME basename
string NAME + .ren
log NAME OFFSET SIZE

ty so much.
how can i add some binary ("for example: \x05\xB9\x69\xBC\x1E") front of file from offset 0?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: How can i cut 16 bytes from a file with QuickBMS?

Post by aluigi »

Just add the following to the previous script:

Code: Select all

set MEMORY_FILE binary "\x05\xB9\x69\xBC\x1E"
append -1
log NAME 0 5 MEMORY_FILE
append


In the current beta of quickbms the append mode even works with the put* commands, but they are mainly meant for working memory files so this is just a FYI note :)
JesWhite
Posts: 47
Joined: Sun Jun 02, 2019 10:40 pm

Re: How can i cut 16 bytes from a file with QuickBMS?

Post by JesWhite »

aluigi wrote:Just add the following to the previous script:

Code: Select all

set MEMORY_FILE binary "\x05\xB9\x69\xBC\x1E"
append -1
log NAME 0 5 MEMORY_FILE
append


In the current beta of quickbms the append mode even works with the put* commands, but they are mainly meant for working memory files so this is just a FYI note :)


ty so much.