ZenHAX
https://zenhax.com/

run two array in one .bms
https://zenhax.com/viewtopic.php?f=11&t=8856
Page 1 of 1

Author:  Shokoniraya [ Wed Nov 07, 2018 5:59 am ]
Post subject:  run two array in one .bms

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:
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

Author:  aluigi [ Wed Nov 07, 2018 1:44 pm ]
Post subject:  Re: run two array in one .bms

findloc automatically terminates the execution if it doesn't find the next pattern but it supports an option to avoid that:
Code:
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

Author:  Shokoniraya [ Mon Jan 21, 2019 7:39 pm ]
Post subject:  Re: run two array in one .bms

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:
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

Author:  aluigi [ Mon Jan 21, 2019 10:36 pm ]
Post subject:  Re: run two array in one .bms

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.

Author:  Shokoniraya [ Tue Jan 22, 2019 5:53 am ]
Post subject:  Re: run two array in one .bms

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!

Author:  Shokoniraya [ Tue Jan 22, 2019 6:40 am ]
Post subject:  Re: run two array in one .bms

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

Attachments:
real_file.zip [2.67 KiB]
Downloaded 167 times

Author:  aluigi [ Tue Jan 22, 2019 11:15 pm ]
Post subject:  Re: run two array in one .bms

'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:
for
    get OFFSET long
    if OFFSET == 0
        break
    endif
    get SIZE long
    math OFFSET * 64
    log "" OFFSET SIZE
next

Author:  Shokoniraya [ Wed Jan 23, 2019 6:18 am ]
Post subject:  Re: run two array in one .bms

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

Author:  aluigi [ Wed Jan 23, 2019 10:34 am ]
Post subject:  Re: run two array in one .bms

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.

Author:  Shokoniraya [ Thu Jan 24, 2019 4:48 am ]
Post subject:  Re: run two array in one .bms

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

Attachments:
Test.zip [4.98 KiB]
Downloaded 121 times

Author:  GHOST DEAD [ Thu Feb 07, 2019 8:52 am ]
Post subject:  Re: run two array in one .bms

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!

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/