Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResourceHelper: Add MIP importing #306

Merged
merged 10 commits into from
Dec 31, 2023
Merged

ResourceHelper: Add MIP importing #306

merged 10 commits into from
Dec 31, 2023

Conversation

Beyley
Copy link
Member

@Beyley Beyley commented Dec 24, 2023

This adds full importing of LBP PSP MIP files.

The LBP PSP asset decryption key must be placed in the keys folder next to the executable (create it if missing), with the name psp. If the key is missing, Refresh isnt even able to detect whether or not a file is a MIP file.

This also brings in a new dependency for LZO decompression, since MIP files are sometimes compressed.

@jvyden 9a91cb7 this commit im unsure about, should it be the client's or the API's responsibility to append the psp/ for PSP assets?

@Beyley Beyley requested a review from jvyden December 24, 2023 01:17
@jvyden
Copy link
Member

jvyden commented Dec 27, 2023

Regarding 9a91cb7, probably the API's responsibility. It should be as easy as possible to write a client.

Copy link
Member

@jvyden jvyden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are we ripping the XOR key from the game? We should definitely document that step on the wiki.

Additionally, what's the plan for production? Are we planning to just run a re-import of assets? I'm not sure the importer is ready for that - IIRC it only looks at files not present in the database.

Refresh.GameServer/Refresh.GameServer.csproj Outdated Show resolved Hide resolved
Refresh.GameServer/Refresh.GameServer.csproj Show resolved Hide resolved
Refresh.GameServer/Resources/ResourceHelper.cs Outdated Show resolved Hide resolved
Refresh.GameServer/Resources/ResourceHelper.cs Outdated Show resolved Hide resolved
@Beyley
Copy link
Member Author

Beyley commented Dec 28, 2023

How are we ripping the XOR key from the game? We should definitely document that step on the wiki.

I'll have to write a guide for that, i dont have one on-hand.

Additionally, what's the plan for production? Are we planning to just run a re-import of assets? I'm not sure the importer is ready for that - IIRC it only looks at files not present in the database.

From my testing, a -i then a -I with the CLI is sufficient to trigger the conversion to take place.

@Beyley Beyley marked this pull request as draft December 28, 2023 03:50
@Beyley
Copy link
Member Author

Beyley commented Dec 28, 2023

Marking as draft, since complete rewrite of decryption is needing to be done, see this conversation

Switches from an XOR blob to directly decrypting the data as we stream it in.
@Beyley
Copy link
Member Author

Beyley commented Dec 28, 2023

Going to mark as ready for review, since the Refresh side code is now done. We still need to write the tool for extracting the key (should probably go into docs repo so its on the docs wiki?), but i think that should be done separately. For now, if you want to extract the key, manually follow the instructions here using a LBP PSP US 2.0.5 copy of the game's EBOOT

@Beyley Beyley marked this pull request as ready for review December 28, 2023 21:52
@Beyley Beyley requested a review from jvyden December 28, 2023 21:52
@jvyden jvyden merged commit f84062c into main Dec 31, 2023
2 checks passed
@jvyden jvyden deleted the read-mip-textures branch December 31, 2023 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants