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

boost ArchiveStorageDecryptor.decrypt_block with cpp implementation #279

Merged
merged 4 commits into from
Oct 27, 2024

Conversation

AXiX-official
Copy link
Contributor

On my device loading UnityCN encrypted file via
env = UnityPy.load(“test”)
For the original Python implementation, a 10MB file takes roughly 7.8s, and a 50MB file takes roughly 30s
But the cpp implementation only takes 0.076s and 0.24s respectively.
I can provide some test files if needed
(Only tested it on windows using msvc compilation, but I guess other platforms won't have any problems with it)

Copy link
Owner

@K0lb3 K0lb3 left a comment

Choose a reason for hiding this comment

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

The core part looks good.
I just want some changes to the Python api usage.

@AXiX-official
Copy link
Contributor Author

In fact, while self.index has a type hint of bytes but is assigned as a bytearray
guess u mean y* instead of y# refer
If self.index is acctually a bytes obj then maybe I can use y# so I don't have to deal with buffer and reference counting I guess
However, the official documentation says that y* is the recommended way to accept binary data
So I'm not really sure which to use.

@K0lb3
Copy link
Owner

K0lb3 commented Oct 27, 2024

You're right, I meant y* and not y#.

Thanks for the adjustments and also again for the work.

@K0lb3 K0lb3 merged commit 65deb2a into K0lb3:master Oct 27, 2024
3 checks passed
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