symbols.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #ifndef symbols_h
  2. #define symbols_h
  3. #include <stdio.h>
  4. enum kstruct_offset {
  5. /* struct task */
  6. KSTRUCT_OFFSET_TASK_LCK_MTX_TYPE,
  7. KSTRUCT_OFFSET_TASK_REF_COUNT,
  8. KSTRUCT_OFFSET_TASK_ACTIVE,
  9. KSTRUCT_OFFSET_TASK_VM_MAP,
  10. KSTRUCT_OFFSET_TASK_NEXT,
  11. KSTRUCT_OFFSET_TASK_PREV,
  12. KSTRUCT_OFFSET_TASK_ITK_SPACE,
  13. KSTRUCT_OFFSET_TASK_BSD_INFO,
  14. /* struct ipc_port */
  15. KSTRUCT_OFFSET_IPC_PORT_IO_BITS,
  16. KSTRUCT_OFFSET_IPC_PORT_IO_REFERENCES,
  17. KSTRUCT_OFFSET_IPC_PORT_IKMQ_BASE,
  18. KSTRUCT_OFFSET_IPC_PORT_MSG_COUNT,
  19. KSTRUCT_OFFSET_IPC_PORT_IP_RECEIVER,
  20. KSTRUCT_OFFSET_IPC_PORT_IP_KOBJECT,
  21. KSTRUCT_OFFSET_IPC_PORT_IP_CONTEXT,
  22. KSTRUCT_OFFSET_IPC_PORT_IP_SRIGHTS,
  23. /* struct proc */
  24. KSTRUCT_OFFSET_PROC_PID,
  25. /* struct ipc_space */
  26. KSTRUCT_OFFSET_IPC_SPACE_IS_TABLE,
  27. /* struct thread */
  28. KSTRUCT_OFFSET_THREAD_BOUND_PROCESSOR,
  29. KSTRUCT_OFFSET_THREAD_LAST_PROCESSOR,
  30. KSTRUCT_OFFSET_THREAD_CHOSEN_PROCESSOR,
  31. KSTRUCT_OFFSET_THREAD_CONTEXT_DATA, // thread.machine.contextData
  32. KSTRUCT_OFFSET_THREAD_UPCB, // thread.machine.upcb
  33. KSTRUCT_OFFSET_THREAD_UNEON, // thread.machine.uNeon
  34. KSTRUCT_OFFSET_THREAD_KSTACKPTR,
  35. /* struct processor */
  36. KSTRUCT_OFFSET_PROCESSOR_CPU_ID,
  37. /* struct cpu_data */
  38. KSTRUCT_OFFSET_CPU_DATA_EXCEPSTACKPTR, // despite the name this actually points to the top of the stack, not the bottom
  39. KSTRUCT_OFFSET_CPU_DATA_CPU_PROCESSOR,
  40. };
  41. // the
  42. enum ksymbol {
  43. KSYMBOL_OSARRAY_GET_META_CLASS,
  44. KSYMBOL_IOUSERCLIENT_GET_META_CLASS,
  45. KSYMBOL_IOUSERCLIENT_GET_TARGET_AND_TRAP_FOR_INDEX,
  46. KSYMBOL_CSBLOB_GET_CD_HASH,
  47. KSYMBOL_KALLOC_EXTERNAL,
  48. KSYMBOL_KFREE,
  49. KSYMBOL_RET,
  50. KSYMBOL_OSSERIALIZER_SERIALIZE,
  51. KSYMBOL_KPRINTF,
  52. KSYMBOL_UUID_COPY,
  53. KSYMBOL_CPU_DATA_ENTRIES,
  54. KSYMBOL_VALID_LINK_REGISTER,
  55. KSYMBOL_X21_JOP_GADGET,
  56. KSYMBOL_EXCEPTION_RETURN,
  57. KSYMBOL_THREAD_EXCEPTION_RETURN,
  58. KSYMBOL_SET_MDSCR_EL1_GADGET,
  59. KSYMBOL_WRITE_SYSCALL_ENTRYPOINT,
  60. KSYMBOL_EL1_HW_BP_INFINITE_LOOP,
  61. KSYMBOL_SLEH_SYNC_EPILOG
  62. };
  63. int koffset(enum kstruct_offset);
  64. uint64_t ksym(enum ksymbol);
  65. void offsets_init(void);
  66. void symbols_init(void);
  67. int probably_have_correct_symbols(void);
  68. #endif