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.

Getting name from package files

Featured Replies

  • Author
  • Localization

sigroon365, posted Sat Aug 20, 2016 12:31 pm (16685)


Hi, I have a question about getting name from package files which doesn't contain name length.

Image
In this situation, how one can retrieve names of each files?

Sample files. https://www.sendspace.com/file/4a3zhw

And my bms script.
Code:
endian little

get name_off long
get off long
goto off

get off_size long
get files long
get block_size long
xmath block_size "block_size - off_size"

for i = 0
get offset long
savepos tmp
get next_offset long

if next_offset  > block_size
xmath size "block_size - offset"
xmath offset "offset off off_size"

else

xmath size "next_offset - offset"
xmath offset "offset off off_size"
goto tmp
endif

get packname filename
string packname = _unpacked/

log packname OFFSET SIZE

next i
  • Author
  • Localization

TheUkrainianBard, posted Sat Aug 20, 2016 12:50 pm (16687)


But there's a 0x0A delimiter. Use
Code:
GetCT VAR TYPE CHAR [FILENUM]

    It reads a string till the reaching of the CHAR delimiter.

    arguments
      VAR       Output variable
      TYPE      Only unicode is the alternative type, any other value
                is just ignored because doesn't matter for this
                operation
      CHAR      The delimiter character as 8bit number, if this number
                is negative QuickBMS will convert it to positive and
                read till the current byte is the same (so it's like
                a way to skip the same byte in a file)
      FILENUM   Number of the file associated to the archive (0)

    Examples:
      GetCT NAME string 0x0a
      GetCT NAME string 0x3b
      set DELIMITER_BYTE long 0x0a
      GetCT NAME string DELIMITER_BYTE
      GetCT NAME unicode 0x0a
  • Author
  • Localization

sigroon365, posted Sat Aug 20, 2016 1:05 pm (16689)


Thank you. It's better than mine. :D
  • Author
  • Localization

sigroon365, posted Mon Nov 07, 2016 11:19 am (18636)


aluigi wrote:
http://aluigi.org/bms/senran_kagura_shinovi_versus.bms


Hi. :) Can you update the script for other types?

Code:
get NAMES_OFF long

do
get OFFSET long
savepos tmp
get NEXT OFFSET long
...
while ~ end when 0xFFFFFFFF
  • Author
  • Localization

aluigi, posted Mon Nov 07, 2016 1:51 pm (18639)


Script 0.2
  • Author
  • Localization

sigroon365, posted Tue Nov 08, 2016 2:37 am (18647)


aluigi wrote:
Script 0.2


Thank you :)
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.