run two array in one .bms

Programming related discussions related to game research
Shokoniraya
Posts: 416
Joined: Sat Sep 15, 2018 5:22 am

run two array in one .bms

Post by Shokoniraya »

i need to know how can i run two array in one script, both (for i) and (for w)

i mean, when array one is over (i), then go to 0x0-OFFSET and run another array (w)

like this:

Code: Select all

get TAFS_CHECKER extension
if TAFS_CHECKER == "emd"


for i
findloc FINDER_GET binary "\x00\x32\x33\x54"
goto FINDER_GET
getdstring DUMMY_EMD 60
get SIZE long
findloc DDS_HEADER binary "\x44\x44\x53\x20"
goto DDS_HEADER
savepos OFFSET
log "" OFFSET SIZE
next i


goto 0


for w
findloc TYAPE2 binary "\x66\x72\x6D\x6A"
goto TYAPE2
get DUMMY long
get SAIZE long
savepos OAFFSET
log "" OAFFSET SAIZE
next w


cleanexit
else
endif
endFunction
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: run two array in one .bms

Post by aluigi »

findloc automatically terminates the execution if it doesn't find the next pattern but it supports an option to avoid that:

Code: Select all

get TAFS_CHECKER extension
if TAFS_CHECKER == "emd"


for
findloc FINDER_GET binary "\x00\x32\x33\x54" 0 ""
if FINDER_GET == ""
    break
endif
goto FINDER_GET
getdstring DUMMY_EMD 60
get SIZE long
findloc DDS_HEADER binary "\x44\x44\x53\x20"
goto DDS_HEADER
savepos OFFSET
log "" OFFSET SIZE
next


goto 0


for
findloc TYAPE2 binary "\x66\x72\x6D\x6A" 0 ""
if TYAPE2 == ""
    break
endif
goto TYAPE2
get DUMMY long
get SAIZE long
savepos OAFFSET
log "" OAFFSET SAIZE
next


cleanexit
else
endif
endFunction
Shokoniraya
Posts: 416
Joined: Sat Sep 15, 2018 5:22 am

Re: run two array in one .bms

Post by Shokoniraya »

Aluigi. is there any way to run two diffrent array in one bms?
i saw so many problem in QuickBMS but why must be like that? dont left this great program behind

Code: Select all

for j = 1
get OFFSET long
get SIZE long
log "" OFFSET SIZE
next j

for i = 1
get ID longlong
get HASH long
get OFFSET long
get SIZE long
get ZSIZE long
get DUMMY long
clog HASH OFFSET SIZE ZSIZE
next i
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: run two array in one .bms

Post by aluigi »

There are no arrays in that script, what you mean?
Tell me exactly what you want to do in the script and how you want to use 2 arrays.
Shokoniraya
Posts: 416
Joined: Sat Sep 15, 2018 5:22 am

Re: run two array in one .bms

Post by Shokoniraya »

aluigi wrote:There are no arrays in that script, what you mean?
Tell me exactly what you want to do in the script and how you want to use 2 arrays.


just for j can run. but for i never run!
Shokoniraya
Posts: 416
Joined: Sat Sep 15, 2018 5:22 am

Re: run two array in one .bms

Post by Shokoniraya »

in zip file i packed a bms and a azh file.
but file do not have any files long and need to count headers and but next array cant run
also offset files need to be x64 and game cant read any offset but x64 and cant load files.
two problem for now. i have same problem in many files
Last edited by Shokoniraya on Tue Jan 22, 2019 6:49 am, edited 1 time in total.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: run two array in one .bms

Post by aluigi »

'j' is in an endless loop and therefore you will never enter in the 'i' cycle.

Regarding the azh file you correctly found that the offset requires to be multiplied by 64, very good.
I suggest something like the following script:

Code: Select all

for
    get OFFSET long
    if OFFSET == 0
        break
    endif
    get SIZE long
    math OFFSET * 64
    log "" OFFSET SIZE
next
Shokoniraya
Posts: 416
Joined: Sat Sep 15, 2018 5:22 am

Re: run two array in one .bms

Post by Shokoniraya »

i need multiplied OFFSET in reimport2 too. but how?
and i need to count headers too. file does not have any FILES long to do
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: run two array in one .bms

Post by aluigi »

reimport2 does the job automatically and it works perfectly with that file.

There is no FILES field in that file and so you don't know how many files exist in the archive.
The only way is checking if the OFFSET field is zero which means there are no other files.
Shokoniraya
Posts: 416
Joined: Sat Sep 15, 2018 5:22 am

Re: run two array in one .bms

Post by Shokoniraya »

look at this one, edited script,
there is two folder My Editing and Your QuickBMS
in Your QuickBMS folder i used your bms and game will crash because its totaly wrong and game cant read offset in any address and must be x64

in My Editing folder i change offset numbers in header and file postion and game can read normally
GHOST DEAD
Posts: 218
Joined: Wed Jul 19, 2017 5:04 am

Re: run two array in one .bms

Post by GHOST DEAD »

Shokoniraya wrote:look at this one, edited script,
there is two folder My Editing and Your QuickBMS
in Your QuickBMS folder i used your bms and game will crash because its totaly wrong and game cant read offset in any address and must be x64

in My Editing folder i change offset numbers in header and file postion and game can read normally


add your extra cycle for a specified file, not for a total command! your skill was wrong!