428 Shibuya Scramble PC edition [.wad files]

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
nautzz
Posts: 9
Joined: Fri Dec 27, 2019 6:24 pm

428 Shibuya Scramble PC edition [.wad files]

Post by nautzz »

it seems to be an only slightly modified version of the format used for danganronpa.

the bms script for that game seems to read all of the file names just fine. i'm just not able to extract any of the files.
errors out at line 42 every time i try

here's an example error for reference:

Code: Select all

  offset           filesize   filename
--------------------------------------
  000000000001e4b3 9223372036854777088 config\system_en.json

Error: impossible to write 0x8000000000000500 bytes (total 0x8000000000000500)
       Check your disk space or the script is wrong

Last script line before the error or that produced the error:
  42  log NAME OFFSET SIZE


any ideas as to how to go about making this work?
nautzz
Posts: 9
Joined: Fri Dec 27, 2019 6:24 pm

Re: 428 Shibuya Scramble PC edition [.wad files]

Post by nautzz »

so the danganronpa script is getting file sizes wrong, but seems to read file names & paths perfectly.
first 11 chars looks like this for file size every time

i tried out the zero time dilemma script, which seems to be getting at least some of the file sizes correctly... still doesn't get all of them though.
and the filenames are completely borked on that one, so it's a no go...
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: 428 Shibuya Scramble PC edition [.wad files]

Post by Ekey »

What script are you using (this one > http://aluigi.org/bms/danganronpa.bms)? The sizes are correct, they must be corrected like - SIZE &= 0x7FFFFFFFFFFFFFFF or something like that. Upload one small WAD :)
nautzz
Posts: 9
Joined: Fri Dec 27, 2019 6:24 pm

Re: 428 Shibuya Scramble PC edition [.wad files]

Post by nautzz »

yep, that's the one

sure thing! here's one of the patch ones. extension is .zip because it wouldn't upload otherwise
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: 428 Shibuya Scramble PC edition [.wad files]

Post by Ekey »

Add this line

Code: Select all

math SIZE &= 0x7FFFFFFFFFFFFFFF
after

Code: Select all

get SIZE longlong
Last edited by Ekey on Sun Dec 29, 2019 6:24 pm, edited 1 time in total.
nautzz
Posts: 9
Joined: Fri Dec 27, 2019 6:24 pm

Re: 428 Shibuya Scramble PC edition [.wad files]

Post by nautzz »

thanks for the help! works for the smaller files, but for the two larger files (which are the ones i'm really after) i now get a "not enough memory" error on one of them (seems more than a little bit strange to me, since i have 32 gb of RAM), and an "offset can't be reached" error for the other one.

full errors for reference:

Code: Select all

- error in src\extra\xalloc.c line 618: xdbg_malloc()

Error: memory allocation problem
       Not enough memory resources are available to process this command.

Code: Select all

Error: [myfseek] offset 0x80000000000cf176 in file 0 can't be reached

Last script line before the error or that produced the error:
  43  log NAME OFFSET SIZE
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: 428 Shibuya Scramble PC edition [.wad files]

Post by Ekey »

Add this line

Code: Select all

math OFFSET &= 0x7FFFFFFFFFFFFFFF


after

Code: Select all

get OFFSET longlong
Last edited by Ekey on Sun Dec 29, 2019 6:24 pm, edited 1 time in total.
nautzz
Posts: 9
Joined: Fri Dec 27, 2019 6:24 pm

Re: 428 Shibuya Scramble PC edition [.wad files]

Post by nautzz »

initially thought it was working perfectly, but all the files it extracted from one of the files are corrupted (with the notable exception of a good portion of the .dds files), and it still gives me the memory allocation bug for the other.

these issues seem more pernicious though, so it'd be understandable if you'd want to leave it at that
nautzz
Posts: 9
Joined: Fri Dec 27, 2019 6:24 pm

Re: 428 Shibuya Scramble PC edition [.wad files]

Post by nautzz »

for the one i can extract, about a fourth of the way through the archive everything it extracts is corrupted/doesn't work. always at the exact same spot.
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: 428 Shibuya Scramble PC edition [.wad files]

Post by Ekey »

Well, If you can upload 1 large file, we can see why corrupted data is being extracted.
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: 428 Shibuya Scramble PC edition [.wad files]

Post by spiritovod »

@Ekey: Thank you for the help, much appreciated.

Update: Sorry for the misinformation, modifications for BASE_OFF are not even required. But instead of

Code: Select all

math OFFSET &= 0x7FFFFFFF

this is required

Code: Select all

math OFFSET &= 0x7FFFFFFFFFFFFFFF

because int32 value is not enough to address offsets for more than 2GB of data.

So with the attached script and latest quickbms (0.10.1) I was able to unpack all game files properly (though it's not modified for ACPS bin files yet) and successfully reimport (with reimport2 option) modified files from shibuya_desktop_data_core.wad. The game shows modified text just fine, so I suppose the script works as intended.
Last edited by spiritovod on Sun Dec 29, 2019 5:45 pm, edited 3 times in total.
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: 428 Shibuya Scramble PC edition [.wad files]

Post by Ekey »

Good :)
nautzz
Posts: 9
Joined: Fri Dec 27, 2019 6:24 pm

Re: 428 Shibuya Scramble PC edition [.wad files]

Post by nautzz »

tried it out with the additional fix, doesn't seem to have changed anything. i'll upload the two larger files, it'll be a couple hours though
nautzz
Posts: 9
Joined: Fri Dec 27, 2019 6:24 pm

Re: 428 Shibuya Scramble PC edition [.wad files]

Post by nautzz »

here you go: https://mega.nz/#F!pAg0ySbL!-kiIvCiEHYWVcgsi1VpIYA

smaller of the two (shibuya-desktop-data-core.wad) is already uploaded (unfortunately it's the one you get the memory allocation error on, so nothing happens). the larger one (shibuya-desktop-data-main.wad) is 11 gigs, and will take a while.
link goes to a folder, so whenever the upload is complete for the latter one it'll be in there
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: 428 Shibuya Scramble PC edition [.wad files]

Post by spiritovod »

I found out the problem and modified my previous post to reflect required changes.
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: 428 Shibuya Scramble PC edition [.wad files]

Post by Ekey »

11gb, no thanks, just use filecutter :) > https://aluigi.altervista.org/bms/filecutter.bms

spiritovod wrote:I found out the problem and modified my previous post to reflect required changes.

I wrote about this in my previous post :)

Ekey wrote:The sizes are correct, they must be corrected like - SIZE &= 0x7FFFFFFFFFFFFFFF or something like that
nautzz
Posts: 9
Joined: Fri Dec 27, 2019 6:24 pm

Re: 428 Shibuya Scramble PC edition [.wad files]

Post by nautzz »

the "core" file still throws the memory allocation error, but since the files i actually wanted were all in main it did the job perfectly. thanks a bunch!
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: 428 Shibuya Scramble PC edition [.wad files]

Post by spiritovod »

Ekey wrote:I wrote about this in my previous post :)

That's true, but initially you've suggested 0x7FFFFFFF for both size and offset and after my post you've modified both of them. Also, for this particular game file size of any internal resource will never be more than max int32 value, so no need to adjust it as well. Script above works fine for the 11GB wad as well.

@nautzz: Maybe you're using outdated quickbms version. I don't have any problem with the big wad as well with provided script.
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: 428 Shibuya Scramble PC edition [.wad files]

Post by Ekey »

spiritovod wrote:That's true, but initially you've suggested 0x7FFFFFFF for both size and offset and after my post you've modified both of them.

Yes, because I did not know that there are archives up to 11GB :)