Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archive

The Original Forum. Game archives, full of resources. How to open them? Get help here.
User avatar
stiffy360
n00b
Posts: 17
Joined: Sat Oct 11, 2014 4:17 am
Has thanked: 3 times
Been thanked: 1 time

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by stiffy360 »

JayK wrote:Hmm I don't know what the problem could be at this point o.0 the most I can do is offer you the dds I get when extracted, what are you using to view the dds files?

https://dl.dropboxusercontent.com/u/687 ... ef_hnm.dds
dxt1 bitmap manipulator, but it happens with photoshop as well.

EDIT: I had forgotten to decrypt the files again. it works now. Thanks for the help!
JayK
mega-veteran
mega-veteran
Posts: 172
Joined: Fri Jun 01, 2012 10:08 am
Has thanked: 35 times
Been thanked: 121 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by JayK »

Glad it did, because I was stumped beyond that point :p
volfin
ultra-veteran
ultra-veteran
Posts: 452
Joined: Sun Jul 06, 2014 6:30 am
Has thanked: 110 times
Been thanked: 326 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by volfin »

DEElekgolo wrote:Here's the structure for the block/chunk map. The number of entries can be found in the previous FTEXSFileBlockCount variable.

Code: Select all

struct BlockMapEntry
{
	unsigned short CompressedSize;
	unsigned short UncompressedSize;
	unsigned short Unknown1;
	unsigned short Unknown2;			// Usually zero
};
Looks to be this:

Code: Select all

struct BlockMapEntry
{
	unsigned short CompressedSize;
	unsigned short UncompressedSize;
	unsigned long  Block_Offset;
};
Block_Offset points to where that block begins in the ftexs file.
User avatar
wunk
advanced
Posts: 44
Joined: Thu Dec 23, 2010 9:49 am
Has thanked: 9 times
Been thanked: 32 times
Contact:

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by wunk »

the .WEM files are just regular WAV files. The compression code is 0xFFFF though so the compression will have to be figured out.

Also cubemaps have 6 times as many mip map entries for each face at each MIP level.
I'm poking through more shaders and textures to figure out more. There's some good hints in data_02\shaders\dx11 that show the structures of some of the data being passed in(xor the fsop files with 0x9C as cra0 mentioned). Source code is all there. http://i.imgur.com/yYlcxbR.png

The byte at 0x1C(or short rather) in the FTEX files seem to show the intended usage of the texture or something like that.

If I was to write out a quick enum it would be something like:

Code: Select all

enum FTEX_USAGE
{
    Masks        = 1, // Found for srm and mtm files
                     //     Each channel acts as a grayscale mask. Possibly PBR parameters(roughness, gloss, etc)
    Color       = 3, // Found for bsm files(albedo/diffuse texture)
    Reflection     = 7, // so far only found for cubemaps (cbm)
    NormalMap   = 9  // Found for nrm files
};
I really gotta get my hands on an unpacked EXE so I can really poke around rather than puttering around blindly.

@volfin

Looks correct!
User avatar
cra0
ultra-veteran
ultra-veteran
Posts: 438
Joined: Fri Apr 27, 2012 9:37 am
Has thanked: 29 times
Been thanked: 189 times
Contact:

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by cra0 »

DEElekgolo wrote:the .WEM files are just regular WAV files. The compression code is 0xFFFF though so the compression will have to be figured out.

Also cubemaps have 6 times as many mip map entries for each face at each MIP level.
I'm poking through more shaders and textures to figure out more. There's some good hints in data_02\shaders\dx11 that show the structures of some of the data being passed in(xor the fsop files with 0x9C as cra0 mentioned). Source code is all there. http://i.imgur.com/yYlcxbR.png

The byte at 0x1C(or short rather) in the FTEX files seem to show the intended usage of the texture or something like that.

If I was to write out a quick enum it would be something like:

Code: Select all

enum FTEX_USAGE
{
    Masks        = 1, // Found for srm and mtm files
                     //     Each channel acts as a grayscale mask. Possibly PBR parameters(roughness, gloss, etc)
    Color       = 3, // Found for bsm files(albedo/diffuse texture)
    Reflection     = 7, // so far only found for cubemaps (cbm)
    NormalMap   = 9  // Found for nrm files
};
I really gotta get my hands on an unpacked EXE so I can really poke around rather than puttering around blindly.

@volfin

Looks correct!
I dumped the PE region from memory if you want. PM me
crash2317
ultra-n00b
Posts: 4
Joined: Tue Aug 26, 2014 12:52 am

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by crash2317 »

You guys are geniuses! I am a CG artist, and i've looked forward to work with the game models of snake and raiden for a looong time now. And now i see you guys creating realy tricky tools to finally get to the point, when all of MGS fans will be able to create a fan art, based on the result of your hard work. Thank you so much guys, really appreciated.

P.S. I have one technical question to you guys: how exactly are you reading the encrypted code of anything with hex editor? I know a bit of theory, but i would like to know some practical part of it. Thanks again!
JayK
mega-veteran
mega-veteran
Posts: 172
Joined: Fri Jun 01, 2012 10:08 am
Has thanked: 35 times
Been thanked: 121 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by JayK »

If you really want to know about the FTEXS Dee, this is how the .1 files work. From the offsets in the FTEX file its basically

{
uint 16 compressedSize
uint 16 uncompressedSize
uint 16 unknown //always seems to be 0x08
uint 16 compressFlag // if its 0x80 its already uncompressed, if it's 0x0 its compressed
}

One thing I never understood is it repeats this block behined it, I don't know why they've made it do it twice. Also the end of the file always contains info for a texture in the next file although the next file has that info as well, that's another thing I found weird. Anyway you should know everything there is to know about tex's after this, hopefully someone else makes a repacker because at this point I can't be bothered :p
Sergeanur
advanced
Posts: 53
Joined: Fri Dec 30, 2011 12:26 pm
Been thanked: 37 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by Sergeanur »

Made a tool for unpacking and repacking FPK and FPKD.
link
Also uses dictionary for weird names.
DEElekgolo wrote:the .WEM files are just regular WAV files. The compression code is 0xFFFF though so the compression will have to be figured out.
Regular Wwise audio file, the converter is easy to find online.
Esppiral
n00b
Posts: 11
Joined: Thu Aug 14, 2014 4:39 pm
Has thanked: 3 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by Esppiral »

This does not work with the ps3 version of the game? I just unpacked the .psarc where all the files are compressed and got a ton of files and forders including. fpk .fpkd .pftxs files etc. but I can't extract a shit from them using the posted tools.
Sergeanur
advanced
Posts: 53
Joined: Fri Dec 30, 2011 12:26 pm
Been thanked: 37 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by Sergeanur »

Esppiral wrote:This does not work with the ps3 version of the game?
No.

Hey, could anyone provide me with decrypted EBOOT.BIN from PS3 version?
Last edited by Gh0stBlade on Sat Sep 24, 2016 4:03 pm, edited 1 time in total.
Reason: Double post merge.
User avatar
wunk
advanced
Posts: 44
Joined: Thu Dec 23, 2010 9:49 am
Has thanked: 9 times
Been thanked: 32 times
Contact:

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by wunk »

JayK wrote:If you really want to know about the FTEXS Dee, this is how the .1 files work. From the offsets in the FTEX file its basically

{
uint 16 compressedSize
uint 16 uncompressedSize
uint 16 unknown //always seems to be 0x08
uint 16 compressFlag // if its 0x80 its already uncompressed, if it's 0x0 its compressed
}

One thing I never understood is it repeats this block behined it, I don't know why they've made it do it twice. Also the end of the file always contains info for a texture in the next file although the next file has that info as well, that's another thing I found weird. Anyway you should know everything there is to know about tex's after this, hopefully someone else makes a repacker because at this point I can't be bothered :p
The redundant chunk entries are probably so that textures can be continuously streamed in without having to poke into the FTEX file again or something. So when it is done reading one mip map level it immediately knows where to go for the next level mip map and can just chain through until it reaches the null entry(last 8 bytes in the last ftexs file) to know it is done, as if each file was to be appended to the other continously.
Pretty much any file with s at the end of it is structured with some stream-like behavior.

The weird format of the first entry found in the .1.ftexs files is probably some special format lead-in for the complete stream. With that first 0x08 variable being the offset immediately after the Chunkentry itself. I usually found Compressed/Uncompressed Sizes of 0x8 or 0x10. Probably the lowest mip entry. Not sure about the compress flag but that 0x80 seems to only show for the first entry in .1 files so it's probably just a flag to show that it is at the beginning of a stream and zero just lets it know to continue on. When it reaches a zero entry when all 8 bytes are zero then it knows to stop(By possibly checking if CompressedSize and UncompressedSize are Zero).

If that structure is true then it would be something like

Code: Select all

struct BlockMapEntry
{
	unsigned short CompressedSize;
	unsigned short UncompressedSize;
	unsigned short Offset;
	unsigned short StreamFlags;
};
EIREXE
ultra-n00b
Posts: 9
Joined: Sun Apr 15, 2012 6:29 pm
Has thanked: 1 time

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by EIREXE »

For some reason the fpk unpacker stops working when I try to use it, any idea why is this?
Sergeanur
advanced
Posts: 53
Joined: Fri Dec 30, 2011 12:26 pm
Been thanked: 37 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by Sergeanur »

https://www.youtube.com/watch?v=puQYvc3fAJQ
Thanks to Adrien DS for finding Kojima files.
EIREXE wrote:For some reason the fpk unpacker stops working when I try to use it, any idea why is this?
It probably does all the stuff berofe you know it :D
JayK
mega-veteran
mega-veteran
Posts: 172
Joined: Fri Jun 01, 2012 10:08 am
Has thanked: 35 times
Been thanked: 121 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by JayK »

This is what meant when I said I was bad at explaining things :p I don't think I explained the .1 ftex well enough
Sergeanur wrote:Hey, could anyone provide me with decrypted EBOOT.BIN from PS3 version?
I'll send it when I get home
Sergeanur
advanced
Posts: 53
Joined: Fri Dec 30, 2011 12:26 pm
Been thanked: 37 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by Sergeanur »

Last edited by Sergeanur on Mon Dec 29, 2014 1:36 am, edited 1 time in total.
Post Reply