God of War script for unpacking .pak file

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: God of War script for unpacking .pak file

Post by AnonBaiter »

^ I don't think he has the ISO though.
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: God of War script for unpacking .pak file

Post by AnonBaiter »

Okay, just to see if I actually had a grasp of these God of War 2 archives...

So aluigi, I just had to check up the European version of that game and to be quite honest these PART1.PAK and PART2.PAK archives(a.k.a. 2 PAK archives) are the same as the American version of that game. Only the PART_NUM field is different in GODOFWAR.TOC from that version(see attachment below).
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: God of War script for unpacking .pak file

Post by aluigi »

So, in short, does the script work or not?
It's old stuff and I would avoid to return on it.
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: God of War script for unpacking .pak file

Post by AnonBaiter »

Just debunking your GOW2 5-pak theory.

About your question, it`s safe to say "no". Although...

Code: Select all

   math OFFSET * 0x800
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: God of War script for unpacking .pak file

Post by AnonBaiter »

Okay, let me see if I grasped this one yet...

So, you have this file info out of GODOFWAR.TOC(using a modified version of your script of course; the script does not try to load the .PAK files this time):

Code: Select all

. 0000000000000226
. 0000000000004d5c getdstr NAME       "BG22004A.VPK" 24
    42 47 32 32 30 30 34 41 2e 56 50 4b 00 00 00 00   BG22004A.VPK....
    00 00 00 00 00 00 00 00                           ........
. 0000000000004d74 get     SIZE       0x0000000000494800 4
. 0000000000004d78 get     PART_NUM   0x0000000000000002 4
. 0000000000004d7c get     OFFSET_IDX 0x00000000000002b4 4
. 0000000000010014 get     OFFSET     0x00000000001faf43 4
2
. 00000000 putarr  OFFSET     0x00000000fd7a1800 0:550
.
So, you're seeing that the .VPK file has an offset of 0x1faf43, which multiplied by 0x800 the result is 0xfd7a1800. Finally, it weighs at 0x494800 in size. And this is from PART1.PAK.

However, for PART2.PAK it seems it is needed to find the offset for this file.

Code: Select all

. 00000000000006ce
. 000000000000f4fc getdstr NAME       "ZEUS10.WAD" 24
    5a 45 55 53 31 30 2e 57 41 44 00 00 00 00 00 00   ZEUS10.WAD......
    00 00 00 00 00 00 00 00                           ........
. 000000000000f514 get     SIZE       0x00000000002b8540 4
. 000000000000f518 get     PART_NUM   0x0000000000000001 4
. 000000000000f51c get     OFFSET_IDX 0x0000000000000a34 4
. 0000000000011e14 get     OFFSET     0x0000000000a155cd 4
1
. 00000000 putarr  OFFSET     0x000000050aae6800 0:1742
.
With that offset, it doesn't seem like a big deal, right? Well, turns out the ZEUS10.WAD offset actually resides in the offset 0x45fa6800, right down to the same size and within the same archive(PART2.PAK).

Both screenshots with proof of these files are in the attachment.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: God of War script for unpacking .pak file

Post by aluigi »

So you have PART_NUM 2 but the file is in PART1.PAK, and then you have PART_NUM 1 and the file is in PART2.PAK.
Is that correct?

If that's true how can you trust the information written in the TOC if the PART_NUM field is random?
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: God of War script for unpacking .pak file

Post by AnonBaiter »

aluigi wrote:So you have PART_NUM 2 but the file is in PART1.PAK, and then you have PART_NUM 1 and the file is in PART2.PAK.
Is that correct?

If that's true how can you trust the information written in the TOC if the PART_NUM field is random?
Because the PART_NUM value differs for no reason. See here:

Code: Select all

. 0000000000000000 get     FILES      0x00000000000006d0 4
. 0000000000000004 getdstr NAME       "01GAA.VA1" 24
    30 31 47 41 41 2e 56 41 31 00 00 00 00 00 00 00   01GAA.VA1.......
    00 00 00 00 00 00 00 00                           ........
. 000000000000001c get     SIZE       0x0000000000012620 4
. 0000000000000020 get     PART_NUM   0x0000000000000001 4
. 0000000000000024 get     OFFSET_IDX 0x0000000000000000 4
. 000000000000f544 get     OFFSET     0x00000000000fccb9 4
1
. 00000000 putarr  OFFSET     0x000000007e65c800 0:0
.
. 0000000000000001
. 0000000000000028 getdstr NAME       "01GAA.VA2" 24
    30 31 47 41 41 2e 56 41 32 00 00 00 00 00 00 00   01GAA.VA2.......
    00 00 00 00 00 00 00 00                           ........
. 0000000000000040 get     SIZE       0x0000000000016500 4
. 0000000000000044 get     PART_NUM   0x0000000000000001 4
. 0000000000000048 get     OFFSET_IDX 0x0000000000000001 4
. 000000000000f548 get     OFFSET     0x00000000000fccde 4
1
. 00000000 putarr  OFFSET     0x000000007e66f000 0:1
.
. 0000000000000002
. 000000000000004c getdstr NAME       "01GAA.VA3" 24
    30 31 47 41 41 2e 56 41 33 00 00 00 00 00 00 00   01GAA.VA3.......
    00 00 00 00 00 00 00 00                           ........
. 0000000000000064 get     SIZE       0x0000000000012620 4
. 0000000000000068 get     PART_NUM   0x0000000000000001 4
. 000000000000006c get     OFFSET_IDX 0x0000000000000002 4
. 000000000000f54c get     OFFSET     0x00000000000fcd0b 4
1
. 00000000 putarr  OFFSET     0x000000007e685800 0:2
.
. 0000000000000003
. 0000000000000070 getdstr NAME       "01GAA.VA4" 24
    30 31 47 41 41 2e 56 41 34 00 00 00 00 00 00 00   01GAA.VA4.......
    00 00 00 00 00 00 00 00                           ........
. 0000000000000088 get     SIZE       0x0000000000016460 4
. 000000000000008c get     PART_NUM   0x0000000000000001 4
. 0000000000000090 get     OFFSET_IDX 0x0000000000000003 4
. 000000000000f550 get     OFFSET     0x00000000000fcd30 4
1
. 00000000 putarr  OFFSET     0x000000007e698000 0:3
.
. 0000000000000004
. 0000000000000094 getdstr NAME       "01GAA.VA5" 24
    30 31 47 41 41 2e 56 41 35 00 00 00 00 00 00 00   01GAA.VA5.......
    00 00 00 00 00 00 00 00                           ........
. 00000000000000ac get     SIZE       0x0000000000015f70 4
. 00000000000000b0 get     PART_NUM   0x0000000000000001 4
. 00000000000000b4 get     OFFSET_IDX 0x0000000000000004 4
. 000000000000f554 get     OFFSET     0x00000000000fcd5d 4
1
. 00000000 putarr  OFFSET     0x000000007e6ae800 0:4
.
. 0000000000000005
. 00000000000000b8 getdstr NAME       "01GAA.VAG" 24
    30 31 47 41 41 2e 56 41 47 00 00 00 00 00 00 00   01GAA.VAG.......
    00 00 00 00 00 00 00 00                           ........
. 00000000000000d0 get     SIZE       0x000000000002bc00 4
. 00000000000000d4 get     PART_NUM   0x0000000000000001 4
. 00000000000000d8 get     OFFSET_IDX 0x0000000000000005 4
. 000000000000f558 get     OFFSET     0x00000000000fcc61 4
1
. 00000000 putarr  OFFSET     0x000000007e630800 0:5
.
. 0000000000000006
. 00000000000000dc getdstr NAME       "02GAB.VA1" 24
    30 32 47 41 42 2e 56 41 31 00 00 00 00 00 00 00   02GAB.VA1.......
    00 00 00 00 00 00 00 00                           ........
. 00000000000000f4 get     SIZE       0x0000000000012530 4
. 00000000000000f8 get     PART_NUM   0x0000000000000001 4
. 00000000000000fc get     OFFSET_IDX 0x0000000000000006 4
. 000000000000f55c get     OFFSET     0x0000000000157a74 4
1
. 00000000 putarr  OFFSET     0x00000000abd3a000 0:6
.
. 0000000000000007
. 0000000000000100 getdstr NAME       "02GAB.VA2" 24
    30 32 47 41 42 2e 56 41 32 00 00 00 00 00 00 00   02GAB.VA2.......
    00 00 00 00 00 00 00 00                           ........
. 0000000000000118 get     SIZE       0x0000000000014df0 4
. 000000000000011c get     PART_NUM   0x0000000000000001 4
. 0000000000000120 get     OFFSET_IDX 0x0000000000000007 4
. 000000000000f560 get     OFFSET     0x0000000000157a99 4
1
. 00000000 putarr  OFFSET     0x00000000abd4c800 0:7
.
. 0000000000000008
. 0000000000000124 getdstr NAME       "02GAB.VA3" 24
    30 32 47 41 42 2e 56 41 33 00 00 00 00 00 00 00   02GAB.VA3.......
    00 00 00 00 00 00 00 00                           ........
. 000000000000013c get     SIZE       0x0000000000012850 4
. 0000000000000140 get     PART_NUM   0x0000000000000001 4
. 0000000000000144 get     OFFSET_IDX 0x0000000000000008 4
. 000000000000f564 get     OFFSET     0x0000000000157ac3 4
1
. 00000000 putarr  OFFSET     0x00000000abd61800 0:8
.
. 0000000000000009
. 0000000000000148 getdstr NAME       "02GAB.VA4" 24
    30 32 47 41 42 2e 56 41 34 00 00 00 00 00 00 00   02GAB.VA4.......
    00 00 00 00 00 00 00 00                           ........
. 0000000000000160 get     SIZE       0x0000000000013bb0 4
. 0000000000000164 get     PART_NUM   0x0000000000000001 4
. 0000000000000168 get     OFFSET_IDX 0x0000000000000009 4
. 000000000000f568 get     OFFSET     0x0000000000157ae9 4
1
. 00000000 putarr  OFFSET     0x00000000abd74800 0:9
.
. 000000000000000a
. 000000000000016c getdstr NAME       "02GAB.VA5" 24
    30 32 47 41 42 2e 56 41 35 00 00 00 00 00 00 00   02GAB.VA5.......
    00 00 00 00 00 00 00 00                           ........
. 0000000000000184 get     SIZE       0x0000000000015710 4
. 0000000000000188 get     PART_NUM   0x0000000000000001 4
. 000000000000018c get     OFFSET_IDX 0x000000000000000a 4
. 000000000000f56c get     OFFSET     0x0000000000157b11 4
1
. 00000000 putarr  OFFSET     0x00000000abd88800 0:10
.
. 000000000000000b
. 0000000000000190 getdstr NAME       "02GAB.VAG" 24
    30 32 47 41 42 2e 56 41 47 00 00 00 00 00 00 00   02GAB.VAG.......
    00 00 00 00 00 00 00 00                           ........
. 00000000000001a8 get     SIZE       0x0000000000028d70 4
. 00000000000001ac get     PART_NUM   0x0000000000000001 4
. 00000000000001b0 get     OFFSET_IDX 0x000000000000000b 4
. 000000000000f570 get     OFFSET     0x0000000000157a22 4
1
. 00000000 putarr  OFFSET     0x00000000abd11000 0:11
.
. 000000000000000c
. 00000000000001b4 getdstr NAME       "05D01S1.VA1" 24
    30 35 44 30 31 53 31 2e 56 41 31 00 00 00 00 00   05D01S1.VA1.....
    00 00 00 00 00 00 00 00                           ........
. 00000000000001cc get     SIZE       0x0000000000005120 4
. 00000000000001d0 get     PART_NUM   0x0000000000000002 4
. 00000000000001d4 get     OFFSET_IDX 0x000000000000000c 4
. 000000000000f574 get     OFFSET     0x0000000000056e14 4
2
. 00000000 putarr  OFFSET     0x000000002b70a000 0:12
.
By the time 05D01S1.VA1 is reached the PART_NUM field acts completely chaotic, and it all goes downhill from there. It doesn't care that there are only two 4GB files(PART1.PAK and PART2.PAK) that relate to the GODOFWAR.TOC, it just randomizes the numbers as it sees fit. See the attached full report and you see what I mean.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: God of War script for unpacking .pak file

Post by aluigi »

So there is no way to get the data if you can't trust a field which is essential for the extracting process.
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: God of War script for unpacking .pak file

Post by AnonBaiter »

aluigi wrote:So there is no way to get the data if you can't trust a field which is essential for the extracting process.
There is... so long as you do something like this:

Code: Select all

math PART_NUM == ACTUAL_PART_NUM
This way, the latter variable can be used for something else(including xmath operations) later on.

I've also thought of other options for handling that field, however I didn't put much confidence into it. I doubt that this one will help either.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: God of War script for unpacking .pak file

Post by aluigi »

Not a solution because I remember that the files were not usually stored sequentially.
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: God of War script for unpacking .pak file

Post by AnonBaiter »

Heh.
Hawre
Posts: 3
Joined: Wed May 23, 2018 6:21 pm

Re: God of War script for unpacking .pak file

Post by Hawre »

Hi, I'm an Iranian, and I do not know much about English.
I have a request. Please help me please

I asked so much in Iran that nobody knew, I want to export the models and animations of the God of War game 1 inside the Part1.Pak file.
I could open the Part1.Pak file using a script, and now I'm going to some form.
pss, psw, vpk, vag, wad
I could exhaust my videos and music but I could not open wad files. I want to expand models and animations as well as textures.

Please help me make you my last hope :|
Thank you very much for your work

Any question?

On this side, this person has been able to pull out the model, using the tool he explained. Now, my question is, what is this tool? And how is it implemented?
https://github.com/mogaika/god_of_war_browser

What is god_of_war_browser and how is it implemented?
Kratos9999
Posts: 129
Joined: Mon Aug 22, 2016 10:30 am

Re: God of War script for unpacking .pak file

Post by Kratos9999 »

Hi hawre, this tool was created to help investigate the files in the Gow, and mainly to allow the romhackers translate the game to another language. I used this tool to translate Gow into my language, this tool open and handles the WAD files, is as all-in-one tool to the Gow. If you need help with WAD archives and if you plan to do a translation, send a private message for me, I can help.
GHOST DEAD
Posts: 218
Joined: Wed Jul 19, 2017 5:04 am

Re: God of War script for unpacking .pak file

Post by GHOST DEAD »

Hawre wrote:Hi, I'm an Iranian, and I do not know much about English.
I have a request. Please help me please

I asked so much in Iran that nobody knew, I want to export the models and animations of the God of War game 1 inside the Part1.Pak file.
I could open the Part1.Pak file using a script, and now I'm going to some form.
pss, psw, vpk, vag, wad
I could exhaust my videos and music but I could not open wad files. I want to expand models and animations as well as textures.

Please help me make you my last hope :|
Thank you very much for your work

Any question?

On this side, this person has been able to pull out the model, using the tool he explained. Now, my question is, what is this tool? And how is it implemented?
https://github.com/mogaika/god_of_war_browser

What is god_of_war_browser and how is it implemented?


I know a little persian and Afghanian (becuase i worked in a iranian Sofware Company about 6 Years Ago)
،سلام به شما، من ایرانی می‌‌دانم،
چه نسخه‌ای را می گویید؟ شاید بتوانم به شما کمک کنم
Hawre
Posts: 3
Joined: Wed May 23, 2018 6:21 pm

Re: God of War script for unpacking .pak file

Post by Hawre »

Hello
My friends recorded a video that I described all the stuff in this video
I ask you to look at this video and tell me what to do with the animations and the models?

Download : http://www.mediafire.com/file/l93ijr4i8 ... 1.mp4/file
Hawre
Posts: 3
Joined: Wed May 23, 2018 6:21 pm

Re: God of War script for unpacking .pak file

Post by Hawre »

Hi guys god_of_war_browser The new version has come out very interestingly this time it can open and play animations.
Only I got into trouble again. Its construction does not respond to emails.
How can I save your animation if you can?
And another question how to convert SND files to Wav format?
Why does it get broken and the mesh crashes when I drive into Maya or Unity?
https://www.mediafire.com/view/ovdzmksm ... 1.jpg/file


https://github.com/mogaika/god_of_war_b ... -567789408