GithubHelp home page GithubHelp logo

atvaark / gzstool Goto Github PK

View Code? Open in Web Editor NEW
67.0 7.0 18.0 2.48 MB

Fox Engine/MGSV/MGS dat, fpk, fpkd, pftxs and sbp unpacker/repacker

License: MIT License

C# 98.91% PowerShell 1.09%
mgsv metal-gear-solid c-sharp tool modding windows fox-engine

gzstool's People

Contributors

atvaark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

gzstool's Issues

Non-negative number required.

Heya, same issue as the last person, although I can attach a file.
I'm using the latest version of your software and windows 10, although I'm pretty sure it's got to do with the file itself. Would appreciate any help.

assets.zip

v0.2.0 does not accommodate .6.ftexs file extensions

For whatever reason, the source code has no references to the .6.ftexs extension. The release works as intended, so does this mean that the source code is misaligned with the release's executable?

private static readonly Dictionary<int, string> TypeExtensions = new Dictionary<int, string>
{
{0, ""},
{1, ".xml"},
{2, ".json"},
{3, ".ese"},
{4, ".fxp"},
{5, ".fpk"},
{6, ".fpkd"},
{7, ".fpkl"},
{8, ".aib"},
{9, ".frig"},
{10, ".mtar"},
{11, ".gani"},
{12, ".evb"},
{13, ".evf"},
{14, ".ag.evf"},
{15, ".cc.evf"},
{16, ".fx.evf"},
{17, ".sd.evf"},
{18, ".vo.evf"},
{19, ".fsd"},
{20, ".fage"},
{21, ".fago"},
{22, ".fag"},
{23, ".fagx"},
{24, ".fagp"},
{25, ".frdv"},
{26, ".fdmg"},
{27, ".des"},
{28, ".fdes"},
{29, ".aibc"},
{30, ".mtl"},
{31, ".fsml"},
{32, ".fox"},
{33, ".fox2"},
{34, ".las"},
{35, ".fstb"},
{36, ".lua"},
{37, ".fcnp"},
{38, ".fcnpx"},
{39, ".sub"},
{40, ".fova"},
{41, ".lad"},
{42, ".lani"},
{43, ".vfx"},
{44, ".vfxbin"},
{45, ".frt"},
{46, ".gpfp"},
{47, ".gskl"},
{48, ".geom"},
{49, ".tgt"},
{50, ".path"},
{51, ".fmdl"},
{52, ".ftex"},
{53, ".htre"},
{54, ".tre2"},
{55, ".grxla"},
{56, ".grxoc"},
{57, ".mog"},
{58, ".pftxs"},
{59, ".nav2"},
{60, ".bnd"},
{61, ".parts"},
{62, ".phsd"},
{63, ".ph"},
{64, ".veh"},
{65, ".sdf"},
{66, ".sad"},
{67, ".sim"},
{68, ".fclo"},
{69, ".clo"},
{70, ".lng"},
{71, ".uig"},
{72, ".uil"},
{73, ".uif"},
{74, ".uia"},
{75, ".fnt"},
{76, ".utxl"},
{77, ".uigb"},
{78, ".vfxdb"},
{79, ".rbs"},
{80, ".aia"},
{81, ".aim"},
{82, ".aip"},
{83, ".aigc"},
{84, ".aig"},
{85, ".ait"},
{86, ".fsm"},
{87, ".obr"},
{88, ".obrb"},
{89, ".lpsh"},
{90, ".sani"},
{91, ".rdb"},
{92, ".phep"},
{93, ".simep"},
{94, ".atsh"},
{95, ".txt"},
{96, ".1.ftexs"},
{97, ".2.ftexs"},
{98, ".3.ftexs"},
{99, ".4.ftexs"},
{100, ".5.ftexs"},
{101, ".sbp"},
{102, ".mas"},
{103, ".rdf"},
{104, ".wem"},
{105, ".lba"},
{106, ".uilb"}
};

If I understand the situation, and if possible, Could you please describe how the release accommodates the .6.ftexs extension? Thank you!

Output?

Running the program GzsTool.exe S:\Steam\SteamApps\path\wherever\chunk0.dat it threw all the data in some obscure (hidden!) directory placed inside the root directory of the drive named VTRoot that the program ran on. What is that supposed to be?

I was wondering why would you do this... A sane program would work as simple as this: program.exe C:\target\file.extension D:\output\directory. I was searching (for 10 minutes!) to find the output directory after searching for ~5 minutes first on whether such a command I illustrated exists. But apparently that's not very intuitive here. Ok.

Alright. Thanks. Just wanted to mention that for any other stragglers.

Unpacking error

Hey, I have a problem when trying to unpack fpk file. The Gzs Tool crashes and gives this messages.
I've been trying to unpack the face.fpk file from PES 2018 dat but nothing works for me. Any solution what may cause this problem?

Unhandled Exception: System.IO.EndOfStreamException: Unable to read beyond the end of the stream.
at System.IO.BinaryReader.FillBuffer(Int32 numBytes)
at System.IO.BinaryReader.ReadUInt32()
at GzsTool.Core.Fpk.FpkFile.Read(Stream input)
at GzsTool.Program.ReadArchive[T](String path)
at GzsTool.Program.Main(String[] args)

Unhandled Exception: System.ArgumentOutOfRangeException: Non-negative number required.
Parameter name: value
at System.IO.FileStream.set_Position(Int64 value)
at GzsTool.Core.Fpk.FpkString.Read(Stream input)
at GzsTool.Core.Fpk.FpkEntry.Read(Stream input)
at GzsTool.Core.Fpk.FpkFile.Read(Stream input)
at GzsTool.Program.ReadArchive[T](String path)
at GzsTool.Program.Main(String[] args)

Error unpacking SSD (Metal Gear Survive)

Attempting to unpack any .dat from SSD yields this:

Unhandled Exception: System.IO.EndOfStreamException: Unable to read beyond the end of the stream. at System.IO.BinaryReader.FillBuffer(Int32 numBytes) at System.IO.BinaryReader.ReadUInt32() at GzsTool.Core.Qar.QarEntry.Read(BinaryReader reader) at GzsTool.Core.Qar.QarFile.Read(Stream input) at GzsTool.Program.ReadArchive[T](String path) at GzsTool.Program.Main(String[] args)

I throws this error on line 92 of QarEntry, on QarEntry() #2.

The files can be found here.

Unpacking a dat in the same directory as the tool create the output folder at the root of the drive

Hi,
I've found a relatively minor bug.

I copied the tool in my installation folder for MGSV:TPP, under master/:
D:\Steam\steamapps\common\MGS_TPP\master

I opened a cmd prompt in that folder (using shift+right click, open command window here).
I tried the unpack the data1.dat file by using this command:
GzsTool.exe data1.dat
It looked like this in the cmd prompt:
D:\Steam\steamapps\common\MGS_TPP\master>GzsTool.exe data1.dat

However, it unpacked the files in a folder directly at the root of the drive, which was:
D:\data1_dat\

I believe it should unpack the files directly in the same folder, like this:
D:\Steam\steamapps\common\MGS_TPP\master\data1_dat

I also found a workaround, somehow, moving the current working directly to the parent folder so the command is executed like that:
D:\Steam\steamapps\common\MGS_TPP>master\GzsTool.exe master\data1.dat
It unpacked the files in what should be the correct folder:
D:\Steam\steamapps\common\MGS_TPP\master\data1_dat

*other games*

Hello, I guess you are way out of scene by now but would it somehow be possible adding support for fpk files in fate Unlimited Codes and bleach hts 7 (both are using same structure). As of now I failed to find any tool that can properly unpack and repack them. Ty...

No folder

Doesn't create folder after unpacking .dat, just .xml.

Error in cpk file format version

Hi ,
I am creating patch for pes 2020 mobile , i saw vedio on YouTube and tried
I got successful every tym when i made changes in my patch
Bt after 9/4/2020 update when i load patch obb in my phone ,pes starts download ita own patch

I created again and again bt every tym pes dwnld it's own patch , so it's mean my patch has error
I noticed that in my patch (created) dt.cpk files has different file format version that og file format.
So how to resolve this error

Issue unpacking and repacking chunk0.dat

Hey apparently unpacking and repacking the chunk0.dat game files with the current QAR dictionary project results in an infinite load screen according to other modders. Supposedly doesn't occur with QARTool so I'm curious if you have any idea what the issue is. Brought up by tinmantex and investigated by others.

"so theres an issue unpacking then repacking chunk0 with gzstool with a current dictionary? simply doing that with no modifications causes a hang on load. doing the same thing with an empty dictionary and its fine.

BobDoleOwndU - Today at 12:30 AM
Huh. Interesting. I knew that repacking caused an infinite hanging screen. But I didn't know that it doesn't happen with an empty dictionary. QAR Tool doesn't have that issue though

Joey35233 - Today at 2:32 PM
@HeartlessSeph Have you gotten anywhere with bone weights?

hoopyboop - Today at 3:27 PM
@TinManTex that's kind of bizarre. Maybe an improper definition being used somewhere? Not sure why that'd be an issue though, since hash collisions should mean it shouldn't matter. Though if QAR Tool doesn't share the issue I guess it is some weird bug. Maybe something to report to Atvaark to see if he knows what's up with it.

tinmantex - Today at 6:56 PM
So (after a bunch of divide and conquer) the offending entry is /Assets/tpptest/pack/location/empty/empty
which matches legit fpk/d which is a mission pack used for init, which seems to match up with where if fails on loading
so i'm guessing gzstool is packing that with a different hash for some reason?
confirmed it by keeping the dictionary and removing just that entry and also an dictionary with just that entry.

BobDoleOwndU - Today at 6:59 PM
According to my debug version of GzsTool, that name's hash is 1978c01cfffc2. Do you know if that's supposed to be what it is?

hoopyboop - Today at 7:07 PM
Well mgsvPathHasher.exe is reporting:
/Assets/tpptest/pack/location/empty/empty 978c01cfffc2

So I'm not sure what the issue is.

BobDoleOwndU - Today at 7:08 PM
unknown's path hasher uses the same algorithm as GzsTool. So they both come up with the same result(edited)

hoopyboop - Today at 7:09 PM
So an issue with the lead 13th digit is what you're saying?
As I mentioned before at some point, Sergeanur said he isn't interested in modding MGSV at this time, but having his input would be great on this matter.

BobDoleOwndU - Today at 7:10 PM
Nono, unknown added functionality to strip the extra digit to make it easier to search for file names in a hex editor. Because the extra digit is added to the extension hex part of the name, unless you know what the extension digits are, you can't search for that part of the name

hoopyboop - Today at 7:11 PM
Oh gotcha
@unknown I don't write C-type programs. Where exactly did you do that (for stripping digits)? Or does anyone else know? Unless I'm reading that wrong anyway.
unknown - Today at 7:15 PM
idk
https://github.com/unknown321/mgsv_path_hasher/blob/master/main.cs#L76 here I think
GitHub
unknown321/mgsv_path_hasher
Contribute to mgsv_path_hasher development by creating an account on GitHub.

BobDoleOwndU - Today at 7:16 PM
It's this part here

ulong testStrCode32 = GetStrCode32(text);
hash = testStrCode32.ToString("x");
if (hash.Length < 12)
hash = hash.PadLeft(12,'0');
hash = hash.Substring(hash.Length-12,12);
unknown - Today at 7:16 PM
ye
I don't remember the exact reason why I did it though

BobDoleOwndU - Today at 7:17 PM
Makes it easier to search for hashes in a hex editor
unknown - Today at 7:17 PM
no
there was an issue and I don't remember
anyway, sergeanur has the definitive hashing function

BobDoleOwndU - Today at 7:18 PM
Well, even if that wasn't the orginal intention, it does make it easier to search for hashes ๐Ÿ˜›
Do we know if there's a difference between sergeanur and Atvaark's hashing functions (other than QAR Tool being written in C++ I think)? They should be the same I would think. I do think there's a difference in the way the tools pack things though(edited)

hoopyboop - Today at 7:28 PM
idk, at any rate I'll rebuild unknown's main.cs file to see what results from it though.
Did a FOR /R %A (*.cs) DO (csc "%A") loop on every folder on my HDD C:\ folder until I interrupted it. RIP every program.(edited)
Figured out why it wasn't running proper. Needed to do "csc /r:CityHash.dll main.cs" according to unknown's GitHub page.
Rebuilt with my edits. Don't know what issue he was referring to. Seems to work fine. Will try with the problem entry.
Got
/Assets/tpptest/pack/location/empty/empty 1978c01cfffc2
So in other words I have no idea. Might be an issue with GZsTools algorithm like others have mentioned since QAR Tool apparently has no issue with chunk0.dat.(edited)
My changes (aside from changing default hash reversal) were just this:
ulong testStrCode32 = GetStrCode32(text);
hash = testStrCode32.ToString("x");
if (hash.Length < 13)
hash = hash.PadLeft(13,'0');
hash = hash.Substring(hash.Length-13,13);
Perhaps running Sergeanur's QAR Tool with a blank dictionary will reveal the issue.

hoopyboop - Today at 8:02 PM
QAR_Tool's .inf file lists those entries as
522d978c01cfffc2|chunk0\1978c01cfffc2.fpk key=0 version=0 compressed=1
ed55978c01cfffc2|chunk0\1978c01cfffc2.fpkd key=0 version=0 compressed=1
Which goes back to: "hell if I know"
Might be a major bug with GZsTool. I'll contact Atvaark and see what he knows if no one else has or wants to.(edited)"

Gzstool problem

I dear friend I have problem with GzsTool
When I try to unpack fpk files from pes
Gives Error message

Please help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.