mirror of
https://github.com/GerbilSoft/wiiu-nandextract-c.git
synced 2025-06-18 19:25:36 -04:00
archive
This commit is contained in:
parent
8c4eae6fbc
commit
cdbc250bab
@ -1,3 +1,8 @@
|
||||
## Note about archival
|
||||
This code was basically directly translated from C# to C, and is incredibly dirty.
|
||||
(A lot of unneeded allocations / copying / reading).
|
||||
This should probably be completely rewritten.
|
||||
|
||||
# wiiu-nandextract-c
|
||||
Wii (U) NAND Extractor written in C
|
||||
|
||||
|
10
extractor.c
10
extractor.c
@ -203,7 +203,7 @@ uint8_t getKey(void)
|
||||
}
|
||||
}
|
||||
|
||||
printf("Error key not valid");
|
||||
printf("Error key not valid\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -500,16 +500,12 @@ void extractFile(fst_t fst, uint16_t entry, char* parent)
|
||||
|
||||
uint8_t* aesDecrypt(uint8_t* key, uint8_t* enc_data, size_t data_size)
|
||||
{
|
||||
uint8_t* dec_data = calloc(data_size, sizeof(uint8_t));
|
||||
memcpy(dec_data, enc_data, data_size);
|
||||
free(enc_data);
|
||||
|
||||
uint8_t iv[16] = { 0 };
|
||||
|
||||
struct AES_ctx ctx;
|
||||
AES_init_ctx_iv(&ctx, key, iv);
|
||||
|
||||
AES_CBC_decrypt_buffer(&ctx, dec_data, data_size);
|
||||
AES_CBC_decrypt_buffer(&ctx, enc_data, data_size);
|
||||
|
||||
return dec_data;
|
||||
return enc_data;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user