seregonwar/PFU-PupFileUnpacker

please finish this soon

Opened this issue · 18 comments

hey can you please finish this soon and if you found a way to decrypt of extract these file you must have also had a way to repack them thank you for all the work so far your doing great as i look throught the code i think you are doing an amazing job if you need any help let me know

Hi,

Unfortunately, I had to halt my work on this project due to other commitments and unforeseen issues. Currently, the main code has some problems that you can identify by running the startup file pup_unpacker.py. As soon as I have the opportunity, I will resume working on the project. From this point forward, I will be dedicating my efforts to it. In the meantime, if you're interested, you can take it on. You have all the necessary documentation to proceed. If you decide to do so, please keep me updated.

PS. Feel free to send a pull request for any changes you make. Before doing so, please ensure that the changes are relevant to the project, functional, and do not compromise the overall operation of the program. If you can enhance the GUI, as I'm uncertain about its user-friendliness and modernity, it would be appreciated. I'll include your name in the readme.md file as a token of gratitude and credit for your contributions.

This is my telegram name for share your progress or problem, scribe me for all necessities: @seregonwar

Best regards,
SeregonWar

hello, I can confirm that I've started working on the project again and you can see it yourself by viewing the commits :).

thanks bro

wait what was the problem you had for the pup_unpacker.py i'll try to help

Hello zeeboi9,

Thank you for asking what issues I faced in the last code update.

In summary, I solved the following problems:

  • I have defined all the necessary global constants, such as HEADER_SIZE, MAGIC, VERSION and others, to avoid errors due to undefined variables

  • I fixed the library import errors needed at the beginning of the code

  • I correctly initialized the Pup class and its attributes in the constructor

  • I implemented the reading and validation of the PUP file header

  • I correctly extracted the table of entries from the file

  • I managed the selection of the PUP file via the Tkinter GUI

  • I integrated the PUP decoding function into a separate module

  • I have optimized the saving of the extracted files to the final destination

  • I added error checking and handling

In summary, the code is now more solid, with less problematic, better structured and should work better. I intervened on all the main critical issues that had been reported.

The code still has problems but I'm solving them, now the program starts but if I don't correct the errors it won't work. If you want you can do it already, run the code on an IDE and check the warnings given by it (use vs2022 or vs code), the following are the dependencies needed to make it all work properly:

Here is a list of the main dependencies needed to run the code for the extraction of PUP files:

-Python 3.6 or higher

-Tkinter module for GUI

pip install tkinter

-Struct module to read the track

Basic in Python standard library

-Module os to interact with the file system

Basic in Python standard library

-Zipfile module to decompress files

pip install zipfile

LZMA form to decompress LZMA data

pip install lzma

  • Module ps4_dec_pup_info to extract info from the PUP to be imported from the GitHub repository

Psutil module to get info on CPU and memory

pip install psutil

Pytest module for code testing

pip install pytest

Thank you for your support <3

no thank you for doing this

Hello! Sorry for not continuing the development, I am writing you here again to tell you that the development of the software has restarted, I am fixing the many bugs and useless things added previously! If everything works correctly you will soon be able to extract .PUP packages.

As previously stated, I managed to convert the '''PS4UPDATE.PUP''' file into a '''PS4UPDATE.PUP.dec''' file, I leave you the content of the information from the latest push to the repository:

PS4 Update Extraction Summary

I translated most of the code to English (it was previously written in Italian for development purposes). So far, I have managed to extract the following information:

Extracted Data:

  • Magic Number: b'SLB2'
  • Read Magic: b'SLB2'
  • Version: 2
  • File Size: 8589934592 bytes
  • Checksum: 981795
  • Table Offset: 0

Data Details:

  • Read Data Length: 502679040 bytes
  • Encrypted Data Length: 502679040 bytes
  • Decrypted Data Length: 502679040 bytes

Decrypted Data (Preview):

  • Decrypted data (before padding):
    b'K\x06\xeb\xc1}\x8dWw:\xfb7\x1fh\xc2w\x8a\x1c\xec\xd0g:\xd1\x180\xbej\xcd7Y\x81aR\x1ejd\xec|[<\x0c\x8b5=n\x90\xf7\x15\xc6]j\xaek\x02\xe1\xf5\x8eG\xb8@c\x01\x8a\x8c\xd1'...
    

Padding Information:

  • Padding Length: 46 bytes
  • Invalid Padding: Padding length out of bounds, ignoring padding

Decrypted File:

  • Decrypted file saved as: C:/Users/marco/Downloads/PS4UPDATE.PUP.dec

Problematic Section:

  • 0x00 - Missing
    Flags: 0xC3C5B7CEC646A1E
    Id: 0xC3C5B7CEC6
    Compressed: True
    Blocked: True
    File Offset: 0xC615F7906E3D358B
    File Size: 0x8EF5E1026BAE6A5D
    Memory Size: 0xD18C8A016340B847

  • Blob 0:
    OFFSET = 14273586793717511563, FILE_SIZE = 10301387123192654429
    Error extracting blob 0: Values too large for OFFSET or FILE_SIZE in blob 0


Error Details:

  • Error extracting file:
    C:/Users/user/Downloads/PS4UPDATE.PUP.dec
    Problem: Values too large for OFFSET or FILE_SIZE in blob 0.

Next Steps:

As you can see, I have encountered a problem with values being too large, but this will be fixed with the next upload. :)

Bro If u complete this the ps4 homebrew community Will celebrate u like a hero

IMA post it to the resdit so I can get more help

It would be very nice, after the latest developments of jailbreak for ps4 11.00 with the PPoE flaw and buffer overload I had a hope of finally being able to finalize the program! I don’t know if you’ve read the latest news but another exploitable bypass has been found on fw11.50 and below! Ah another thing, if you want you can test the code, currently the program is able to extract some “blobs” and convert the file from PS4UPDATE.PUP to PS4UPDATE.PUP.dec but I have to implement a working unpacking that allows the extraction of the PS4UPDATE1 and 2 directories.

that is all pretty cool i hope the reddit post will get to people who can help u i have a suggestion like not now but when your project is more mature it will probably make sense to make precompiled binaries as the average person might not be willing to or able to install python and its packages and clone the repo and run it though in actuality it probably is easy I'll see what else i can do to help ur project keep up the great work

As soon as the program will work perfectly I will compile it in .exe and .deb (the latter without a graphical interface) and it will be accessible even to inexperienced people, so I have implemented a simple gui translated into various languages. Even the fact that it has no terminals but that it manages everything in the graphical interface is a plus point in my opinion.

that is good

btw what python version ans package manager are you using(ie conda or pip)

I am using pip 24.2, the latest version of the pip package manager. The requirements.txt file lists all the dependencies used throughout the entire project.

Hi I wanted to inform you that the compiled version has just been uploaded and you can test it without danger of crashing or anything else. If you encounter any problems please let me know! (I'm working on full decryption of the files, keep an eye on the commits) ;)

that is very cool will do