xor_deobfuscate.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // callconv: x0 arm64 (x0, x1, x2, x3, x4, x5, x6, x7, stack);
  2. void sym.func.100043b34 (int64_t arg1) {
  3. [sp - 0x30]! = (x22, 2)
  4. [var_10h] = (x20, 2)
  5. [var_20h] = (x29, 2)
  6. x29 = sp + 0x20
  7. x20 = x1 // arg1
  8. x19 = x8
  9. x1 = 0x1006c0000
  10. x1 += 0x2c0 // section.4.__TEXT.__cstring
  11. x0 = x8
  12. sym.func.10013ad30 () // sym.func.10013ad30(0x0, 0x1006c02c0, 0x0, 0x0)
  13. x21 = 0
  14. x22 = 0x1008ae000
  15. loc_0x100043b64:
  16. // CODE XREF from sym.func.100043b34 @ 0x100043bac(x)
  17. w9 = (byte) [x20 + 0x17]
  18. x8 = x9 & 0xff
  19. if (w9 != 0x1f) goto 0x100043b78 // likely
  20. goto loc_0x100043b70;
  21. return x0;
  22. loc_0x100043b70:
  23. x9 = x8
  24. goto 0x100043b7c
  25. loc_0x100043b7c:
  26. // CODE XREF from sym.func.100043b34 @ 0x100043b74(x)
  27. v = x9 - x21
  28. if (((unsigned) v) <= 0) goto 0x100043bb0 // unlikely
  29. goto loc_0x100043b84;
  30. return x0;
  31. loc_0x100043b84:
  32. x9 = x20
  33. if (w8 == 7) goto 0x100043b90 // unlikely
  34. goto loc_0x100043b8c;
  35. loc_0x100043b90:
  36. w8 = (byte) [x9 + x21]
  37. w9 = (byte) [x22 + 0x5b0]
  38. w8 ^= w9
  39. w1 = (char) w8
  40. try { // cleanup at 0x100043bc0
  41. x0 = x19
  42. method.std::__1::basic_string_char__std::__1::char_traits_char___std::__1::allocator_char___.push_back_char_ () // try.794.100043b34.to // method.std::__1::basic_string_char__std::__1::char_traits_char___std::__1::allocator_char___.push_back_char_(0x0, 0xffffffef, 0x0, 0x0)
  43. } // end try
  44. x21 += 1
  45. goto 0x100043b64
  46. goto loc_0x100043b8c;
  47. loc_0x100043b8c:
  48. x9 = [x20]
  49. return x0;
  50. loc_0x100043b78: // orphan
  51. x9 = [x20 + 8]
  52. return x0;
  53. loc_0x100043bb0: // orphan
  54. (x29, 2) = 3 // sp
  55. (x20, 2) = 3
  56. (x22, 2) = 3 // sp
  57. }