feat(cps): add CPS decryption, large GRF support, and error improvements#5
Open
guicaulada wants to merge 4 commits into
Open
feat(cps): add CPS decryption, large GRF support, and error improvements#5guicaulada wants to merge 4 commits into
guicaulada wants to merge 4 commits into
Conversation
Add -k/--key option to specify a cps.dll file for decrypting GRF files encrypted with CPS/Fury encryption. The decryption module extracts the RC4 S-box from the DLL's embedded key data and applies RC4 stream cipher decryption before zlib decompression. Falls back to plain inflate for unencrypted entries within encrypted GRFs. Also fixes a bug where compressed data was written to disk instead of decompressed data.
Bitwise OR with left shift produces signed 32-bit integers in JS, causing offsets >= 0x80000000 to become negative. Use unsigned right shift (>>> 0) to convert entry fields to unsigned 32-bit values.
Replace verbose multi-line error output with stack traces with single-line messages showing the file path and error reason.
The -k flag now accepts both CPS DLLs (with NUMBER marker) and plain text files containing a 512-character hex S-box. This enables decryption of GRFs encrypted by obfuscated CPS variants where the S-box must be dumped from runtime memory.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for extracting CPS/Fury-encrypted GRF files, fix extraction of large GRFs, and clean up error output.
-k/--keyoption to specify a CPS decryption key sourceUsage
Standard CPS DLL:
Raw S-box file: