CHUNK ALL (need to solve)

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

CHUNK ALL (need to solve)

Post by Shokoniraya »

i need help to fix this script

script can work good in reimport2 and there is no reason to bad happening
but game always has been stoped work and give error

what is the problem?

problem is: need to fix CHUNK_ALL

what is the CHUNK_ALL?
when you extracting whole archive, size of all file in folder are CHUNK_ALL (2704) and need to update in reimport mode
how can i solve it?
you can download test archive in this topic

Code: Select all

idstring "BKHD"
get HEADER_ONE long

findloc DIDX_POINT binary "\x44\x49\x44\x58"
goto DIDX_POINT
get DIDX_HEADER long
get HEADER_HEADING long

goto 0x0
findloc DATA binary "\x44\x41\x54\x41"
get DATA long
get CHUNK_ALL long #all extracted size
goto 0x0
findloc HEADER_TWO_SCOUND binary "\x44\x49\x44\x58"
goto HEADER_TWO_SCOUND
get DIDX_HEADER long
get HEADER_TWO long
math HEADER_TWO /= 12 #12, (CRC, OFFSET, SIZE long)

math DUMMY_ADDER = 24
math HEADER_HEADING + HEADER_ONE
math HEADER_HEADING + DUMMY_ADDER

for i = 0 < HEADER_TWO
get CRC long
get OFFSET long
get SIZE long
math OFFSET + HEADER_HEADING
string CRC p "%08x.wem" CRC
log CRC OFFSET SIZE
next i
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: CHUNK ALL (need to solve)

Post by aluigi »

Isn't more simple to just use the official script for this format?
http://aluigi.org/bms/armyoftwo.bms

As you can see the format is quite complex.
Shokoniraya
Posts: 416
Joined: Sat Sep 15, 2018 5:22 am

Re: CHUNK ALL (need to solve)

Post by Shokoniraya »

aluigi wrote:Isn't more simple to just use the official script for this format?
http://aluigi.org/bms/armyoftwo.bms

As you can see the format is quite complex.


right, good Script... but for pck (AKPK), not .bnk

if all files size (whole extrcted files Size) doesnt match with CHUNK_ALL, then game will going to (stop working!) or black screen or even audio can play, or some files cant play
i have same problem in umod unreal engine 2.5 (.umd)!
need to Update CHUNK_ALL too!
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: CHUNK ALL (need to solve)

Post by aluigi »

Shokoniraya wrote:right, good Script... but for pck (AKPK), not .bnk

Why don't you just try it instead of replying?

Code: Select all

  offset   filesize   filename
--------------------------------------
  000000d0 208        00000000.dat
  000001a0 208        00000001.dat
  00000270 208        00000002.dat
  00000340 208        00000003.dat
  00000410 208        00000004.dat
  000004e0 208        00000005.dat
  000005b0 208        00000006.dat
  00000680 208        00000007.dat
  00000750 208        00000008.dat
  00000820 208        00000009.dat
  000008f0 208        0000000a.dat
  000009c0 208        0000000b.dat
  00000a90 208        0000000c.dat
Shokoniraya
Posts: 416
Joined: Sat Sep 15, 2018 5:22 am

Re: CHUNK ALL (need to solve)

Post by Shokoniraya »

i think i found a way to make a fixer... but i need to run another array after end of (i)
your way in other topic doesnt work in this script!

Code: Select all

# Life Is Strange .bnk
# not Supported reimport2 yet!
# Script By Shokoniraya
idstring "BKHD"
get HEADER_ONE long

findloc DIDX_POINT binary "\x44\x49\x44\x58"
goto DIDX_POINT
get DIDX_HEADER long
get HEADER_HEADING long

goto 0x0
findloc DATA binary "\x44\x41\x54\x41"
get DATA long
get CHUNK long #all extracted size
goto 0x0
findloc HEADER_TWO_SCOUND binary "\x44\x49\x44\x58"
goto HEADER_TWO_SCOUND
get DIDX_HEADER long
get HEADER_TWO long
math HEADER_TWO /= 12 #12, (CRC, OFFSET, SIZE long)

math DUMMY_ADDER = 24
math HEADER_HEADING + HEADER_ONE
math HEADER_HEADING + DUMMY_ADDER

for i = 0 < HEADER_TWO
get CRC long
get OFFSET long
get SIZE long
math OFFSET + HEADER_HEADING
string CRC p "%08x.wem" CRC
log CRC OFFSET SIZE
next i
GHOST DEAD
Posts: 218
Joined: Wed Jul 19, 2017 5:04 am

Re: CHUNK ALL (need to solve)

Post by GHOST DEAD »

not Chunk_all, its just a memory scanner
when game want to load, plug will check size of file, not size of full archive, and that is why bnk is decompressed, because of speed for reading by CPU and optimizing and some other thing...

anyway, i hope this will help you to set memory scanner size (dont use -r, just using as extracting mode)
GHOST DEAD
Posts: 218
Joined: Wed Jul 19, 2017 5:04 am

Re: CHUNK ALL (need to solve)

Post by GHOST DEAD »

GHOST DEAD wrote:not Chunk_all, its just a memory scanner
when game want to load, plug will check size of file, not size of full archive, and that is why bnk is decompressed, because of speed for reading by CPU and optimizing and some other thing...

anyway, i hope this will help you to set memory scanner size (dont use -r, just using as extracting mode)


oh... and i forgot to tell you somthing, game cant read wem file in new offset, must be one by one (forgot bms and try something else)