Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. /*
  2. * some code I put here to not forget it
  3. */
  4. typedef int (*aes_crypto_cmd_t)(unsigned int op, void* src, void* dst, int size, unsigned int hwKey, void* iv, void* key);
  5.  
  6. int main(void)
  7. {
  8.  
  9. // Set hardcoded aes_hw_crypto_cmd offset here...
  10. aes_crypto_cmd_t mahAESThing = (aes_crypto_cmd_t) 0x0;
  11.  
  12. // Copy the KBAG to someAddy...
  13. memcpy((void*) someAddy, (void*) KBAGloc, 0x30);
  14. mahAESThing(0x11,(void*) someAddy,(void*)someAddy,0x30,0x20000200,0,0); // (0x10 == ENCRYPT & 0x11 == DECRYPT)
  15.  
  16. // Hexdump the area of someAddy to grab the result :)
  17.  
  18. return 0;
  19. }
  20.  
  21. // Sample code to 32-bit endian byte flip
  22. #if 0
  23. uint32_t key[] = {
  24. 0xF8A555D2, 0x00000000, 0x00000000, 0x00000000,
  25. 0xF4DFD3CB, 0x00000000, 0x00000000, 0x00000000,
  26. 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  27. };
  28.  
  29. int main(void)
  30. {
  31. int i;
  32.  
  33. for(i = 0; i < (sizeof(key)/sizeof(uint32_t)); i++) {
  34. printf("%08X", __builtin_bswap32(key[i]));
  35. }
  36.  
  37. return 0;
  38.  
  39. }
  40. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement