mirror of
https://github.com/SciresM/hactool
synced 2024-11-10 06:34:14 +00:00
Merge pull request #28 from Thealexbarney/nax0-decrypt-fix
Fix NAX0 decryption
This commit is contained in:
commit
94d55a936b
1 changed files with 3 additions and 2 deletions
5
nax0.c
5
nax0.c
|
@ -129,8 +129,9 @@ void nax0_save(nax0_ctx_t *ctx) {
|
|||
fprintf(stderr, "Failed to read file!\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
aes_xts_decrypt(ctx->aes_ctx, buf, buf, read_size, (ofs - 0x4000) >> 14, 0x4000);
|
||||
|
||||
uint64_t dec_size = (read_size + 0x3FFF) & ~0x3FFF;
|
||||
aes_xts_decrypt(ctx->aes_ctx, buf, buf, dec_size, (ofs - 0x4000) >> 14, 0x4000);
|
||||
|
||||
if (fwrite(buf, 1, read_size, f_dec) != read_size) {
|
||||
fprintf(stderr, "Failed to write file!\n");
|
||||
|
|
Loading…
Reference in a new issue