XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Tue Oct 24, 2017 5:30 am

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Pit People music archive (.pak)
PostPosted: Mon Nov 28, 2016 11:52 am 
Offline
ultra-n00b

Joined: Mon Nov 28, 2016 11:43 am
Posts: 3
Has thanked: 1 time
Have thanks: 1 time














You can make the ads go away by registering

Hey, I have problems accesing the data (music) in the following archive (from Pit People game):
http://www.megafileupload.com/803a/music.pak

Unfortunately, doing stuff reccomended for previous Behemoth games doesn't seem to work, Dragon unpacker and Hyperripper can't find anything. Pretty stuck here, hoped some extractions guru's from here could guide me on some way as I'm very inexperienced :)


Top
 Profile  
 
 Post subject: Re: Pit People music archive (.pak)
PostPosted: Mon Dec 05, 2016 7:41 pm 
Offline
veteran

Joined: Wed Jun 02, 2010 4:53 am
Posts: 128
Has thanked: 13 times
Have thanks: 127 times
Here's a QuickBMS script for extracting the .fsb files from music.pak:
Code:
idstring "PKTB"
get DUMMY long   # maybe version
get FILE_COUNT long
get FILE_SECTION_OFFSET long
get STRING_SECTION_OFFSET long
get STRING_SECTION_LENGTH long
get DUMMY long   # 0
get DUMMY long   # 0

for i = 0 < FILE_COUNT
   xmath OFFSET "0x20 + i * 0x20"
   goto OFFSET
   
   get DUMMY long   # maybe checksum
   get FILE_OFFSET long
   get FILE_LENGTH long
   get DUMMY long   # always 0
   get STRING_OFFSET long
   get DUMMY long   # always 0
   get DUMMY long   # always 0
   get DUMMY long   # always 0
   
   math FILE_OFFSET += FILE_SECTION_OFFSET
   math STRING_OFFSET += STRING_SECTION_OFFSET
   
   goto STRING_OFFSET
   get FILE_NAME string
   
   log FILE_NAME FILE_OFFSET FILE_LENGTH
next i


Top
 Profile  
 
 Post subject: Re: Pit People music archive (.pak)
PostPosted: Thu Dec 08, 2016 1:05 am 
Offline
ultra-n00b

Joined: Mon Nov 28, 2016 11:43 am
Posts: 3
Has thanked: 1 time
Have thanks: 1 time
Holy, almost gave up on this, huge thanks herbert!

So far Aezay FSB extractor can get headerless audio (.ogg) data from these. If I get this right, it's pretty much blind luck now, trying to import this as raw audio attaching different type of metadata to make this correctly playable. I'll try to make something out of it, thanks a lot again :)


Top
 Profile  
 
 Post subject: Re: Pit People music archive (.pak)
PostPosted: Thu Dec 08, 2016 12:35 pm 
Offline
ultra-n00b

Joined: Mon Nov 28, 2016 11:43 am
Posts: 3
Has thanked: 1 time
Have thanks: 1 time
UPDATE: SUCCESS

Thanks to herbert's QBMS script and tmiasko's fsb-vorbis-extractor (https://github.com/tmiasko/fsb-vorbis-extractor), 50 playable music files were extracted. Mostly spent time on trying make my broken ubuntu install work with cmake and libboost, all real work done by guys mentioned!

Extracted package:
http://www.megafileupload.com/grNH/out.zip

Cheers!


Top
 Profile  
 
 Post subject: Re: Pit People music archive (.pak)
PostPosted: Wed Dec 14, 2016 10:52 pm 
Offline
Site Admin
User avatar

Joined: Wed Jan 15, 2003 6:45 pm
Posts: 4012
Location: Dungeons of Doom
Has thanked: 411 times
Have thanks: 551 times
Nice!

http://www.xentax.com/downloads/music/bp/out.zip

_________________
Please like our Facebook page!


Top
 Profile  
 
 Post subject: Re: Pit People music archive (.pak)
PostPosted: Mon Jan 23, 2017 10:45 pm 
Offline
beginner

Joined: Sun Aug 07, 2016 1:57 am
Posts: 28
Has thanked: 3 times
Have thanks: 4 times
Hi,
the game (early released) might have changed the way pak files work because it no longer works. Can someone please look into it?

I've attached a small .pak file I found.


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.



Top
 Profile  
 
 Post subject: Re: Pit People music archive (.pak)
PostPosted: Wed Jan 25, 2017 12:10 am 
Offline
ultra-veteran
ultra-veteran

Joined: Fri Nov 06, 2009 12:13 am
Posts: 588
Has thanked: 66 times
Have thanks: 126 times
if version flag is 3 (as your samples are), the structure is different. the file table/names are scrambled (maybe xor'ed with a value)

using only 2 samples we can guess the xor key :)

the format is identical to the v0 script above.

so the xor key is dead simple to figure out (A^B = B^A)

Code:
73 65 63 6B 72 69 74 79 74 68 72 6F 75 67 68 6F


subtitles are compressed xml files - offzip can give you anything not understood

Quote:
+------------+-----+----------------------------+----------------------+
| hex_offset | ... | zip -> unzip size / offset | spaces before | info |
+------------+-----+----------------------------+----------------------+
0x00000240 . 112 -> 145 / 0x000002b0 _ 576 8:7:26:0:1:94072ffa
0x000002b0 . 119 -> 257 / 0x00000327 _ 0 8:7:26:0:1:8ea354be
0x00000330 . 136 -> 306 / 0x000003b8 _ 9 8:7:26:0:1:52585fcf
0x000003c0 . 107 -> 139 / 0x0000042b _ 8 8:7:26:0:1:5dff2d17
0x00000430 . 179 -> 874 / 0x000004e3 _ 5 8:7:26:0:1:32680afb
0x000004f0 . 113 -> 145 / 0x00000561 _ 13 8:7:26:0:1:c09a307f
0x00000570 . 127 -> 176 / 0x000005ef _ 15 8:7:26:0:1:25e23833
0x000005f0 . 110 -> 143 / 0x0000065e _ 1 8:7:26:0:1:4e782f76
0x00000660 . 147 -> 678 / 0x000006f3 _ 2 8:7:26:0:1:d346d7c4
0x00000700 . 190 -> 1436 / 0x000007be _ 13 8:7:26:0:1:a18cc8e1
0x000007c0 . 111 -> 242 / 0x0000082f _ 2 8:7:26:0:1:021b4d91
0x00000830 . 141 -> 570 / 0x000008bd _ 1 8:7:26:0:1:0df1b817
0x000008c0 . 480 -> 3153 / 0x00000aa0 _ 3 8:7:26:0:1:b1d0c319
0x00000aa0 . 108 -> 139 / 0x00000b0c _ 0 8:7:26:0:1:52072cd6
0x00000b10 . 204 -> 1146 / 0x00000bdc _ 4 8:7:26:0:1:c8706d3f
0x00000be0 . 426 -> 4238 / 0x00000d8a _ 4 8:7:26:0:1:031b2e58
0x00000d90 . 328 -> 1914 / 0x00000ed8 _ 6 8:7:26:0:1:fa58436c
0x00001000

- 17 valid compressed streams found

_________________
Useful tool links:


Top
 Profile  
 
 Post subject: Re: Pit People music archive (.pak)
PostPosted: Wed Jan 25, 2017 12:33 pm 
Offline
beginner

Joined: Sun Aug 07, 2016 1:57 am
Posts: 28
Has thanked: 3 times
Have thanks: 4 times
Okay so according to your findings, I tried offzip on them again and it did work, but not on "Fonts" and "Design" .pak files. However, I didn't get what you did exactly using the XOR key, okay so you figured it out by comparing both files, but what did you use the Key for? I mean if offzip was able to do the job, then the XOR is only for the table?

And btw many thanks for the help!!

The two mentioned files Fonts and Design are here.


Edit: So one thing I know is that XOR with 0 is unchanged, so we can expect the letters to show up following through the method the first guy unpacked.

Here are the values that I obtained from various files, where ? are not english alphabet.

Code:
?cesygir???q?ygu
?fes??ir???tk?gu
pces?tir???t?hgu
qces?tir???u?hgu
ces?uiro???t?hgu
?ces??ir???p?ogu
zcesyvir??ht?igu
?des??ir?????jfu
dces?vir??ht?jgu
rcesyuir??ml?hgu


How did you obtain the key from those?


Update 2:
I manually calculated some files, and to my amazement XOR is really an amazing thing! I was able to find out the XOR key again, but only as 16 Bytes, meanwhile I'm sure the key is a bit longer. (24/32), or it is 16 bytes twice.

Update 3:

The XOR key is:
Code:
73 65 63 75 72 69 74 79 74 68 72 6F 75 67 68 6F



Update 4:

I've extracted the files successfully but I'm unable to figure out the encoding of the names.


Top
 Profile  
 
 Post subject: Re: Pit People music archive (.pak)
PostPosted: Wed Jan 25, 2017 9:48 pm 
Offline
ultra-veteran
ultra-veteran

Joined: Fri Nov 06, 2009 12:13 am
Posts: 588
Has thanked: 66 times
Have thanks: 126 times
thethiny wrote:
I've extracted the files successfully but I'm unable to figure out the encoding of the names.


the names are in their own table at the bottom as version 0 were. they are also xor'd.

also only subtitles are packed. the shaders are non-compressed binary though

_________________
Useful tool links:


Top
 Profile  
 
 Post subject: Re: Pit People music archive (.pak)
PostPosted: Thu Jan 26, 2017 5:40 pm 
Offline
beginner

Joined: Sun Aug 07, 2016 1:57 am
Posts: 28
Has thanked: 3 times
Have thanks: 4 times
WRS wrote:
the names are in their own table at the bottom as version 0 were. they are also xor'd.

Using the same XOR technique is producing non English Letters. Are you sure about that?


Top
 Profile  
 
 Post subject: Re: Pit People music archive (.pak)
PostPosted: Wed Feb 15, 2017 11:15 pm 
Offline
ultra-n00b

Joined: Wed Feb 15, 2017 11:11 pm
Posts: 1
Has thanked: 0 time
Have thanks: 0 time
Mr.Mouse wrote:


Thank you so much! i've been looking for the soundtrack " 1.music_story_sofiacapture.ogg " for over a month now.
tried a lot of programs to unpack the music.pak but with no luck.

you've made my day. Thanks again! :-D


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group