findloc OFFSET binary "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
do
goto OFFSET
get DUMMY long
findloc NEXT_OFFSET binary "\x00\x07\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77" 0 ""
if NEXT_OFFSET == ""
get SIZE asize
else
math SIZE = NEXT_OFFSET
endif
math SIZE += OFFSET
log "" OFFSET SIZE
math OFFSET = NEXT_OFFSET
while NEXT_OFFSET != ""
Problem is first extracted file is fine because start with \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 Pattern And End With "\x00\x07\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77"
Like This
but 2nd and another files doesnt extracted correctly because start with "\x00\x07\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77\x77" and with Nothing
Like This
Original script is designed for splitting by headers only (when you only search next header). If you need to consider both header and footer, you need to adjust the script accordingly:
spiritovod wrote:Original script is designed for splitting by headers only (when you only search next header). If you need to consider both header and footer, you need to adjust the script accordingly:
do
findloc A_OFFSET binary "\x70\x51\x45\x53\x00\x00\x00\x01" 0 ""
goto A_OFFSET
get A_SIZE LONG
findloc B_OFFSET binary "\x00\xFF\x2F" 0 ""
goto B_OFFSET
get B_SIZE LONG
math B_OFFSET + 4
math B_SIZE = B_OFFSET
math A_SIZE = A_OFFSET
math B_SIZE - A_SIZE
log "" NAME B_SIZE
math A_OFFSET = B_OFFSET
goto A_OFFSET
While NotEOF <> 0
@Dark Frost: If you need to only change patterns for header or footer, just change 16 to the footer size (in bytes) and it will work. Otherwise, in case of more complex modifications, I suggest to look into quickbms documention for better understanding of what you're doing.
spiritovod wrote:@Dark Frost: If you need to only change patterns for header or footer, just change 16 to the footer size (in bytes) and it will work. Otherwise, in case of more complex modifications, I suggest to look into quickbms documention for better understanding of what you're doing.