Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * some code I put here to not forget it
- */
- typedef int (*aes_crypto_cmd_t)(unsigned int op, void* src, void* dst, int size, unsigned int hwKey, void* iv, void* key);
- int main(void)
- {
- // Set hardcoded aes_hw_crypto_cmd offset here...
- aes_crypto_cmd_t mahAESThing = (aes_crypto_cmd_t) 0x0;
- // Copy the KBAG to someAddy...
- memcpy((void*) someAddy, (void*) KBAGloc, 0x30);
- mahAESThing(0x11,(void*) someAddy,(void*)someAddy,0x30,0x20000200,0,0); // (0x10 == ENCRYPT & 0x11 == DECRYPT)
- // Hexdump the area of someAddy to grab the result :)
- return 0;
- }
- // Sample code to 32-bit endian byte flip
- #if 0
- uint32_t key[] = {
- 0xF8A555D2, 0x00000000, 0x00000000, 0x00000000,
- 0xF4DFD3CB, 0x00000000, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00000000,
- };
- int main(void)
- {
- int i;
- for(i = 0; i < (sizeof(key)/sizeof(uint32_t)); i++) {
- printf("%08X", __builtin_bswap32(key[i]));
- }
- return 0;
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement