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 Script - Help

Featured Replies

  • Author
  • Localization

h3x3r, posted Thu Oct 11, 2018 11:37 am (39401)


Hi there i need your help. I have edited aluigi's script to unpack files. But i need to unpack files to the folders specified by file_type with their original names specified by file_ID.
Here is script. Thanks in advance!
Code:
idstring YBIG
get DUMMY long
get DUMMY long
get DUMMY long
get OFFSET long
goto OFFSET
get DUMMY short
get DUMMY short
get FILES long
getdstring DUMMY 0x51
getdstring MAINFOLDER 0x4
#get MAINFOLDER long
getdstring DUMMY 0x23

savepos TMP
math BASE_OFF = FILES
math BASE_OFF *= 10
math BASE_OFF = TMP
math BASE_OFF x= 8

for i = 0 < FILES

    get OFFSET long
    get file_ID long   
    get file_type byte
    get bComplex byte   
   
    math OFFSET *= 8
    math OFFSET = BASE_OFF
    savepos TMP   
   goto OFFSET   

   if file_type < 126   
      get SIZE long
      savepos OFFSET
      log file_ID OFFSET SIZE
   endif   
   
   if file_type == 126
      getdstring DUMMY 0xE
      get COMCHAR byte
      if COMCHAR == 0
         goto OFFSET
         get SIZE long
         savepos OFFSET
         log file_ID OFFSET SIZE
      else
         goto OFFSET
         math OFFSET = 22
         get ZSIZE long
         math ZSIZE -= 18      
         get DUMMY0 long
         get DUMMY1 long
         get DUMMY2 long
         get SIZE long
         get TEXCOUNT short
         clog file_ID OFFSET ZSIZE SIZE
      endif
   endif
   
   if file_type > 126
      goto OFFSET   
      get SIZE long
      savepos OFFSET
      log file_ID OFFSET SIZE
   endif   
    goto TMP
next i
  • Author
  • Localization

aluigi, posted Thu Oct 11, 2018 4:28 pm (39418)


I guess you want to use this code:
Code:
string NAME p "%d/%d.dat" file_type file_id

Put it under "get bComplex byte" and replace all the file_ID in the *log operations with NAME
  • Author
  • Localization

h3x3r, posted Thu Oct 11, 2018 4:55 pm (39421)


Hell yes! Thanks aluigi.
BTW i must only change "%d/%d.dat" to "%d/%u.dat" because some values of file_ID was negative.
  • Author
  • Localization

aluigi, posted Thu Oct 11, 2018 5:49 pm (39422)


:D
  • Author
  • Localization

h3x3r, posted Thu Nov 15, 2018 1:42 pm (40392)


Hi aluigi, I have another question regarding string. I need to search specific strings and return long value before string. How to do that? Thanks!
The long value should be SIZE. String name is "NodsNoHe"

Tried this but no luck...

For
FindLoc OFFSET string "\x4E\x6F\x64\x73\x4E\x6F\x48\x65" 0 ""
if OFFSET == ""
savepos OFFSET
goto OFFSET-4
Get SIZE long
goto OFFSET
log NAME OFFSET SIZE
endif
Next
  • Author
  • Localization

aluigi, posted Thu Nov 15, 2018 2:40 pm (40394)


I would use something like:
Code:
findloc TMP string "NodsNoHe"
math TMP - 4
goto TMP
get SIZE long
By default findloc terminated quickbms if it doesn't find the string.
This is the alternative that doesn't terminate:
Code:
findloc TMP string "NodsNoHe" 0 ""
if TMP != ""
    math TMP - 4
    goto TMP
    get SIZE long
endif
  • Author
  • Localization

h3x3r, posted Thu Nov 15, 2018 3:21 pm (40396)


Thanks! It works but only for one occurrence. There are more then one occurrences of that string.
  • Author
  • Localization

aluigi, posted Thu Nov 15, 2018 10:54 pm (40404)


just close that code between a for cycle, for example:
Code:
for
findloc TMP string "NodsNoHe"
math TMP - 4
goto TMP
get SIZE long
getdstring SKIP SIZE # or findloc will find the same string again
next
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.