This is an old tool I wrote in 2015 that handles unpacking and repacking pak files from Retro Studios titles. It supports the Metroid Prime series and the Donkey Kong Country Returns series. It also supports automatically decompressing assets, including assets that contain compressed data embedded within the file format. It was very useful back in the day, but recently (for me at least) it's largely been usurped by Prime World Editor's recooking functionality.
This code was originally closed source and I never bothered making it simple for anyone to compile other than me (hardcoded libraries in PakTool.pro), and I haven't touched the code in years, so I make no guarantee of it being easy to use or compile. :p