Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

How to split more than one file type from a single file?

Featured Replies

  • Author
  • Localization

reh, posted Mon Feb 24, 2020 7:11 am (54210)


I have a file that is about 2G in size and there are several concatenated files.

Code:
findloc OFFSET string "MDL4"
do
    goto OFFSET
    get DUMMY long
    findloc NEXT_OFFSET string "MDL4" 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 != ""


With this script, the file is divided by the desired type, but it looks for only one type of file and the other types are concatenated together with the extracted files.

Is it possible to extract all types of files separately or to ensure that the script does not include the other types in the extracted files?

Each file type is separated by empty bytes. I will attach an example of a file extracted by the script, where it is possible to find the other file types (MDL4, MTX, MOT).

I thank you for your help!
  • Author
  • Localization

Acewell, posted Mon Feb 24, 2020 9:45 am (54213)


reh wrote:
Is it possible to extract all types of files separately or to ensure that the script does not include the other types in the extracted files?

if you want just the mdl files without the other appended files use this:
Code:
findloc OFFSET string "MDL4"
do
    goto OFFSET
    goto 8 0 seek_cur
    get SIZE long
    findloc NEXT_OFFSET string "MDL4" 0 ""
    log "" OFFSET SIZE
    math OFFSET = NEXT_OFFSET
while NEXT_OFFSET != ""

:D
  • Author
  • Localization

reh, posted Mon Feb 24, 2020 5:47 pm (54224)


Acewell wrote:
reh wrote:
Is it possible to extract all types of files separately or to ensure that the script does not include the other types in the extracted files?

if you want just the mdl files without the other appended files use this:
Code:
findloc OFFSET string "MDL4"
do
    goto OFFSET
    goto 8 0 seek_cur
    get SIZE long
    findloc NEXT_OFFSET string "MDL4" 0 ""
    log "" OFFSET SIZE
    math OFFSET = NEXT_OFFSET
while NEXT_OFFSET != ""

:D


Thank you so much Acewell !!
Another question, how do I delete all the bytes that look like:\ x0F \ x00 \ x00 \ x00 \ xFF \ xFF \ xFF \ xFF \ x00 \ x00 \ x00 \ x00 \ x01 \ x00 \ x00 \ x00 end \ x0F \ x00 \ x00 \ x00 \ xFF \ xFF \ xFF \ xFF \ x01 \ x00 \ x00 \ x00 \ x01 \ x00 \ x00 \ x00 in the file?
  • Author
  • Localization

aluigi, posted Tue Mar 03, 2020 3:21 pm (54397)


You can try Encryption replace for that job, in theory it should work:
Code:
get SIZE asize
encryption replace "\x0F\x00\x00\x00\xFF\xFF\xFF\xFF\x00\x00\x00\x00\x01\x00\x00\x00" ""
log "output.dat" 0 SIZE
And then doing the same with the other sequence of bytes.
  • Author
  • Localization

reh, posted Sat Mar 07, 2020 5:44 am (54475)


aluigi wrote:
You can try Encryption replace for that job, in theory it should work:
Code:
get SIZE asize
encryption replace "\x0F\x00\x00\x00\xFF\xFF\xFF\xFF\x00\x00\x00\x00\x01\x00\x00\x00" ""
log "output.dat" 0 SIZE
And then doing the same with the other sequence of bytes.


Thank you, it worked very well.
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.