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.

Reading 4 bytes "long" and literally converting to String [BMS]

Featured Replies

  • Author
  • Localization

GHFear, posted Mon Mar 18, 2019 11:33 pm (45877)


I want to read 4 bytes and convert them to a string so that for instance [44 4A 44 3A] look like "444A443A" so that I can name the files after a series of bytes.
Looked around the documentation for hours, but can't find how to do that, if that can be done.

How is this done in a BMS script?

Edit: Just saw that there WAS a help section for QuickBMS. wow I have missed that for years lol. So, move this there if you want to.
  • Author
  • Localization

aluigi, posted Tue Mar 26, 2019 2:35 pm (46030)


Anyway one method is the following:
Code:
math VAR = 0x444A443A
string STR = VAR
print "%STR%"
  • Author
  • Localization

GHFear, posted Wed Mar 27, 2019 8:33 am (46073)


aluigi wrote:
Anyway one method is the following:
Code:
math VAR = 0x444A443A
string STR = VAR
print "%STR%"


I tried this, but it displays the string of the value, so "48 8A BA DE" becomes "HS??".

I want to read 4 bytes from the file and use the hexadecimal values as the name of the file, but it always translate them to the string counterpart(or an integer)

So to further explain, I want to read hexadecimals and also display the hexadecimals and NOT the strings or integers that those hexadecimals represent.
I want 48 8A BA DE to display as the same thing but as a string, but NOT convert it to a string, but display 48 8A BA DE when i do "print" or name a file.

Edit: Here is how I am setting the name:

Code:
string NAME p "%s\%s\%s" FOLDER "OFFSET" "AES1"


AES1 is just
Code:
get AES1 long


Edit2: After LOTS of looking in the documentation, I figured out you need to use "%x" to display the Hex values.
So the end result should look like this:

Code:
string NAME p "%s\%s\%x" FOLDER "OFFSET" "AES1"


or

Code:
string NAME p "%s\%s\%X" FOLDER "OFFSET" "AES1"


for uppercase letters.
  • Author
  • Localization

aluigi, posted Wed Mar 27, 2019 7:18 pm (46089)


ok you already found the solution :D

Maybe you want to use x instead of %x for giving a fixed size to the hex
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.