1. CHEMI6DER

    OP CHEMI6DER Advanced Member
    Newcomer

    Joined:
    Feb 3, 2016
    Messages:
    83
    Country:
    Russia
    This is a small utility bodged together by me from pkNX.
    All credit for RE'ing the format and writing the code goes to Kaphotics.

    Usage: ./gfunpac <input file name>
    Or just drag and drop the .gfpac onto the .exe

    I won't be uploading the source code of this to GitHub, because it's a horrible bodge and I hope that someone can develop a better utility.(But you can still find the source code in the downloads section of this post)
     

    Attached Files:

    Yoni Arousement and lordelan like this.
  2. Cruizeez96

    Cruizeez96 Newbie
    Newcomer

    Joined:
    Nov 16, 2018
    Messages:
    2
    Country:
    United States
    Thanks! At work but definitely giving this a shot later.

    Does this extract .dat, .bnt, and .bns flies from the gfpak? I’ve been using a quickbms plugin to do that but I have no idea what to do with the .dat files. I guess it’s too early to extract models from it.
     
  3. Kaphotics

    Kaphotics badc0ded
    Member

    Joined:
    Sep 10, 2010
    Messages:
    612
    Country:
    United States
    Just a heads up, but pkNX's GUI already does this. Download the latest build (commits->checkmark->teamcity download) and just drop gfpak files on the window.
     
  4. CHEMI6DER

    OP CHEMI6DER Advanced Member
    Newcomer

    Joined:
    Feb 3, 2016
    Messages:
    83
    Country:
    Russia
    You are talking about commit #6, right? I don't remember there being an option in the gui to do that(I looked through all submenus, but I'm just probably blind. Also it crashed when I attempted to load in a directory with the romfs and exefs folders(I don't remember what the exception window said though)), so that's the reason this whole thing exists. I also bodged a thing that changes the file extension of the extracted file based on the first four bytes and also bodged in upacking zlib compressed files.
    Edit: I looked at the source again and found that there is a form called "FileRipper" which does this exact thing. But there's no way of opening that form from the main form
    Edit 2: sorry, I'm stupid and just now realized what you were talking about. You should've made it more obvious that dragging and dropping a .gfpac file onto the main form extracts it

    As I said above this bodges in "file type detection thingy" that gives files proper extensions instead of just .dat or .bin or whatever. P.S. RTB has already made a .gfbmdl importer for 3dsmax, so you can try imporing some models. I don't know what to recommend for extracting textures from .bntx files. I guess, you could try SmashForge, but there are a few things that don't quite work right.
     
    Last edited by CHEMI6DER, Nov 17, 2018
  5. lorddusk

    lorddusk Member
    Newcomer

    Joined:
    Mar 20, 2010
    Messages:
    28
    Country:
    Netherlands
    It errors out for me :

    Code:
    Unhandled Exception: System.ArgumentException: outputLength is not valid
       at LZ4.LZ4Codec.Decode(Byte[] input, Int32 inputOffset, Int32 inputLength, Int32 outputLength)
       at pkNX.Containers.GFPack.Decompress(Byte[] encryptedData, Int32 decryptedLength, CompressionType type)
       at pkNX.Containers.GFPack.ReadPack(BinaryReader br)
       at GFunPAC.Program.Main(String[] args)
    
     
  6. CHEMI6DER

    OP CHEMI6DER Advanced Member
    Newcomer

    Joined:
    Feb 3, 2016
    Messages:
    83
    Country:
    Russia
    Seems like it can't decompress one of the files. The error log just tell us that the decompressed size of the file is not valid. I'll try looking into the issue, but I honestly have no idea what can cause this(except for a corrupted file maybe)
     
  7. AKANE11

    AKANE11 Newbie
    Newcomer

    Joined:
    Nov 27, 2018
    Messages:
    8
    Country:
    United States
    I can't get PkNx to open my game as it says object reference not set to an instance of an object. Any ideas why this is happening??
     
  8. Josephvb10

    Josephvb10 GBAtemp Advanced Fan
    Member

    Joined:
    Aug 26, 2009
    Messages:
    650
    Country:
    Costa Rica
    Did you extract the romfs and exefs to folders with those corresponding names? That's a requirement.
     
  9. AKANE11

    AKANE11 Newbie
    Newcomer

    Joined:
    Nov 27, 2018
    Messages:
    8
    Country:
    United States
    What do you mean by that, I just extracted the xci file and got the romfs and exefs from hactool and put it and put it in a new folder on my desktop.
     
Draft saved Draft deleted
Loading...

Hide similar threads Similar threads with keywords - archives, GFunPAC, utility