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.

bms to pseudo code?

Featured Replies

  • Author
  • Localization

prixone, posted Sun Mar 25, 2018 7:41 pm (33572)


What would be the equivalent pseudo code for this?

Code:
# script for QuickBMS http://quickbms.aluigi.org

quickbmsver "0.7.1"
comtype zlibx

getdstring DUMMY 260
getdstring SIGN 32
math PKG_OLD = -1
get FULLSIZE asize
do
    get INDEX long
    get OFFSET long
    get SECSTART long
    get ZSIZE long
    get SOME_32BIT_CRC longlong
    get FLAGS longlong
    get CREATED longlong
    get ACCESSED longlong
    get MODIFIED longlong
    get SIZE long
    getdstring FILENAME 260
    getdstring PATH 260
    get DUMMY long
    get PKG long
    get DUMMY long
    if PKG != PKG_OLD
        string PKG_NAME p= "pkgd.pkg" PKG
        open FDSE PKG_NAME 1 EXISTS # just for working even if packages are missing...
        math PKG_OLD = PKG
    endif
    string NAME = PATH
    string NAME = FILENAME

    if EXISTS != 0
        if ZSIZE == SIZE
            log NAME OFFSET SIZE 1
        else
            clog NAME OFFSET ZSIZE SIZE 1
        endif
    endif
    savepos CURR
while CURR < FULLSIZE


I mean I get its reading the idx file but I don't see how its extracting or what it should use to extract the file from the above, what would be an actual pseudo code of the whole process?
  • Author
  • Localization

prixone, posted Wed Mar 28, 2018 3:54 pm (33624)


OK, so I figured it out but, ini files seem to be either encrypted/xor'ed or are not compressed like the rest of the files.

What quickbms does with the list of files the script get? Does it run each file against some sort of encryption or packing test and then tries to break it or what?
  • Author
  • Localization

aluigi, posted Thu Mar 29, 2018 2:51 am (33636)


there is no encryption, the files are compressed with a modified version of zlib/deflate that is available only in quickbms
  • Author
  • Localization

prixone, posted Fri Mar 30, 2018 4:06 pm (33675)


aluigi wrote:
there is no encryption, the files are compressed with a modified version of zlib/deflate that is available only in quickbms

I see, thanks for the information, do you know which file should I look into quickbms source to study?

Thanks again.
  • Author
  • Localization

aluigi, posted Mon Apr 02, 2018 11:54 am (33735)


src/compression/tinf.h
src/compression/tinflatex.c
(my modifications are those tagged with ALUIGI)

How the code is used in quickbms, t32 is just a normal 32bit integer:
Code:
            t32 = size;
            size = -1;
            tinf_init();
            if(tinf_uncompress(out, &t32, in 2, zsize - 2) == TINF_OK) size = t32;
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.