Hacking RELEASE GFunPAC - A bodged utility to extract files from Pokemon LGPE .gfpac archives

CHEMI6DER

Well-Known Member
OP
Member
Joined
Feb 3, 2016
Messages
105
Trophies
0
Location
Houen Chihou
XP
2,041
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)
 

Attachments

  • GFunPAC_win32.zip
    136.1 KB · Views: 441
  • GFunPAC_src.zip
    851.8 KB · Views: 334

Cruizeez96

New Member
Newbie
Joined
Nov 16, 2018
Messages
2
Trophies
0
Age
40
XP
53
Country
United States
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)

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.
 

Kaphotics

badc0ded
Member
Joined
Sep 10, 2010
Messages
612
Trophies
0
XP
626
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.
 

CHEMI6DER

Well-Known Member
OP
Member
Joined
Feb 3, 2016
Messages
105
Trophies
0
Location
Houen Chihou
XP
2,041
Country
Russia
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.
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

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.
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,

lorddusk

Active Member
Newcomer
Joined
Mar 20, 2010
Messages
28
Trophies
0
Age
32
Location
Deurne
Website
Visit site
XP
86
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)
 

CHEMI6DER

Well-Known Member
OP
Member
Joined
Feb 3, 2016
Messages
105
Trophies
0
Location
Houen Chihou
XP
2,041
Country
Russia
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)
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)
 

AKANE11

Member
Newcomer
Joined
Nov 27, 2018
Messages
8
Trophies
0
Age
23
XP
48
Country
United States
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)
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??
 

Astoria

Well-Known Member
Member
Joined
Aug 26, 2009
Messages
658
Trophies
1
XP
1,271
Country
Costa Rica
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??
Did you extract the romfs and exefs to folders with those corresponding names? That's a requirement.
 

AKANE11

Member
Newcomer
Joined
Nov 27, 2018
Messages
8
Trophies
0
Age
23
XP
48
Country
United States
Did you extract the romfs and exefs to folders with those corresponding names? That's a requirement.
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.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • BigOnYa @ BigOnYa:
    I just been playing offline, and they give you a few bots here n there on your team to help battle. I don't think it's as funny as the other games tho, more battle oriented than humor, which kinda sucks, but I'm still early in it
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, doesnt the game have a campaign mode?
  • BigOnYa @ BigOnYa:
    Yea, and co-op, but you can also start a pvp session and battle just with friends. You get special skill cards (powers) the more you play. And higher value cards, but you can only enable so many cards at a time.
  • K3Nv2 @ K3Nv2:
    If you can find enough for it
  • BigOnYa @ BigOnYa:
    Toilet paper is considered the money, you collect and buy stuff with TP, kinda funny. Graphics are def better than the other games tho, I think they used Unity 5 engine.
  • Psionic Roshambo @ Psionic Roshambo:
    Look if I zoom in enough I can see the herpes!!!
    +1
  • BigOnYa @ BigOnYa:
    In fact I'm gonna go make a drink, roll a fatty n play some, good night to all!
    +2
  • Xdqwerty @ Xdqwerty:
    I bet most people at the time still watched it in black and white
  • SylverReZ @ SylverReZ:
    @Xdqwerty, Many of them did before colour television was common.
  • SylverReZ @ SylverReZ:
    Likely because black and white TV was in-expensive.
    +1
  • K3Nv2 @ K3Nv2:
    It certainly wasn't inexpensive it cost the same as a new car back then
  • K3Nv2 @ K3Nv2:
    How much did a 1965 color TV cost?

    For example, a 21-inch (diagonal) GE color television in 1965 had an advertised price of $499, which is equal to $4,724 in today's dollars, according to the federal government's inflation calculator.
    +1
  • Xdqwerty @ Xdqwerty:
    @K3Nv2, take into consideration how economy was back then
  • K3Nv2 @ K3Nv2:
    Yeah that's why they listed inflation rates
  • Xdqwerty @ Xdqwerty:
    Sorry didnt read that part
  • BakerMan @ BakerMan:
    @LeoTCK don't worry i knew he was joking
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    My first color TV was like 1984 or something lol
  • Psionic Roshambo @ Psionic Roshambo:
    19 inches it was glorious lol
  • SylverReZ @ SylverReZ:
    @Psionic Roshambo, If it doesn't fit, you should've gotten one smaller lol
    +2
  • SylverReZ @ SylverReZ:
    If a racoon can fit up to 8-inches then so be it
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Lol it it fits I sit? Lol
    +1
  • SylverReZ @ SylverReZ:
    @Psionic Roshambo, Will it blend lol
    SylverReZ @ SylverReZ: @Psionic Roshambo, Will it blend lol