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.

for - next Problem!

Featured Replies

  • Author
  • Localization

Shokoniraya, posted Tue Jan 29, 2019 5:18 am (42904)


Seems like QuickBMS cant do a if endif like this

Code:
get FILES long
get HEADER long
for i = 0 get ID long
get TEST long
if TEST == -1
next i
endif
get SIZE long
get DUMMY long
get OFFSET long
log ID OFFSET SIZE
next i


what is the problem now? it really clear. when i run this script QuickBMS will always going to next i and dont read if and just do next i. but just have to do it when TEST == -1.
its wrong. QuickBMS just will find next i text in script and not matter there is a if option!
note: i am sure this problem never solve too :)

{
for i

if
next i
endif

next i
}

TEST.zip

  • Author
  • Localization

aluigi, posted Tue Jan 29, 2019 12:05 pm (42916)


Learn programming and learn the bms language.
I don't even know what you want to do but I guess you want the following:
Code:
get FILES long
get HEADER long
for i = 0 < FILES
    get ID long
    get TEST long
    if TEST != -1
        get SIZE long
        get DUMMY long
        get OFFSET long
        log ID OFFSET SIZE
    endif
next i

Exists also a "continue" instruction that works like in C and other programming languages, it's something you can try in place of the "next i" of your wrong code.

Anyway PLEASE don't open topics for every single wrong usage you do of the bms language, I try to answer but it takes time and I prefer to dedicate it to other topics.
  • Author
  • Localization

Delutto, posted Tue Jan 29, 2019 12:12 pm (42918)


Why every time that you get stuck in something, you immediately assume that is a quickbms problem?!? Well, I don't kown about bms, but in general programming speaking, you are trying to do something against the logic, this your code will fail in any known programing language.
Every loop has a condition to end its cycle, in you case, the loop will ended when i = FILES, you can't override this, the only thing you can do is force to exit, breaking this loop, aluigi showed this to you a few days ago here.

Edit1: aluigi just answered...
Edit2: I think that you don't understand that is the "next" is part of the "for" instruction, and not another common instruction.
  • Author
  • Localization

Shokoniraya, posted Wed Jan 30, 2019 6:35 am (42949)


Delutto wrote:
Why every time that you get stuck in something, you immediately assume that is a quickbms problem?!? Well, I don't kown about bms, but in general programming speaking, you are trying to do something against the logic, this your code will fail in any known programing language.
Every loop has a condition to ended its ciclo, in you case, the loop will ended when i = FILES, you can't override this, the only thing you can do is force to exit, breaking this loop, aluigi showed this to you a few days ago here.

Edit1: aluigi just answered...
Edit2: I think that you don't understand that is the "next" is part of the "for" instruction, and not another common instruction.

so. i need to creat a dumper and i need to count header first for some reason
how can i do it when i cant put two different cycle? because last file will lost and i did it with calculating the header of first file and header of next file
  • Author
  • Localization

Delutto, posted Wed Jan 30, 2019 2:01 pm (42955)


aluigi's code works perfectly, so I don't understand what you're trying to do, but if for some reason you want to do the same thing using two loops, you just need store the values on first loop and recovery this values on second loop:
Code:
get FILES long
get HEADER long
for i = 0 < FILES
   get ID long
   putarray 0 i ID
   get TEST long
   putarray 1 i TEST
   if TEST != -1
      get SIZE long
      get DUMMY long
      get OFFSET long
      putarray 2 i SIZE
      putarray 3 i OFFSET
   endif
next i

for i = 0 < FILES
   getarray ID 0 i
   getarray TEST 1 i
   if TEST == -1
      continue
   endif
   getarray SIZE 2 i
   getarray OFFSET 3 i
   log ID OFFSET SIZE
next i
  • Author
  • Localization

GHOST DEAD, posted Thu Feb 07, 2019 8:48 am (43242)


in some language, codes has an special id (it's up to your skill) and will find those id to do actors
but if you write [for $2], then actor will find first [next $2] in script, that is why can't run your work
  • Author
  • Localization

aluigi, posted Sat Feb 09, 2019 7:17 am (43302)


@GHOST DEAD
No sense, please don't post just for posting.
The topic has been already answered.
Thanks
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.