Symbols.c 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #include "pal.h"
  2. #include "pal_debug.h"
  3. #define SYMBOL_ADDR(sym) \
  4. ({ \
  5. void* _sym; \
  6. __asm__ volatile("movq " #sym "@GOTPCREL(%%rip), %0" : "=r"(_sym)); \
  7. _sym; \
  8. })
  9. #define PRINT_SYMBOL(sym) pal_printf(#sym " = %p\n", SYMBOL_ADDR(sym))
  10. int main(int argc, char** argv, char** envp) {
  11. PRINT_SYMBOL(DkVirtualMemoryAlloc);
  12. PRINT_SYMBOL(DkVirtualMemoryFree);
  13. PRINT_SYMBOL(DkVirtualMemoryProtect);
  14. PRINT_SYMBOL(DkProcessCreate);
  15. PRINT_SYMBOL(DkProcessExit);
  16. PRINT_SYMBOL(DkStreamOpen);
  17. PRINT_SYMBOL(DkStreamWaitForClient);
  18. PRINT_SYMBOL(DkStreamRead);
  19. PRINT_SYMBOL(DkStreamWrite);
  20. PRINT_SYMBOL(DkStreamDelete);
  21. PRINT_SYMBOL(DkStreamMap);
  22. PRINT_SYMBOL(DkStreamUnmap);
  23. PRINT_SYMBOL(DkStreamSetLength);
  24. PRINT_SYMBOL(DkStreamFlush);
  25. PRINT_SYMBOL(DkSendHandle);
  26. PRINT_SYMBOL(DkReceiveHandle);
  27. PRINT_SYMBOL(DkStreamAttributesQuery);
  28. PRINT_SYMBOL(DkStreamAttributesQueryByHandle);
  29. PRINT_SYMBOL(DkStreamAttributesSetByHandle);
  30. PRINT_SYMBOL(DkStreamGetName);
  31. PRINT_SYMBOL(DkStreamChangeName);
  32. PRINT_SYMBOL(DkThreadCreate);
  33. PRINT_SYMBOL(DkThreadDelayExecution);
  34. PRINT_SYMBOL(DkThreadYieldExecution);
  35. PRINT_SYMBOL(DkThreadExit);
  36. PRINT_SYMBOL(DkThreadResume);
  37. PRINT_SYMBOL(DkSetExceptionHandler);
  38. PRINT_SYMBOL(DkExceptionReturn);
  39. PRINT_SYMBOL(DkMutexCreate);
  40. PRINT_SYMBOL(DkMutexRelease);
  41. PRINT_SYMBOL(DkNotificationEventCreate);
  42. PRINT_SYMBOL(DkSynchronizationEventCreate);
  43. PRINT_SYMBOL(DkEventSet);
  44. PRINT_SYMBOL(DkEventClear);
  45. PRINT_SYMBOL(DkObjectsWaitAny);
  46. PRINT_SYMBOL(DkObjectClose);
  47. PRINT_SYMBOL(DkSystemTimeQuery);
  48. PRINT_SYMBOL(DkRandomBitsRead);
  49. PRINT_SYMBOL(DkInstructionCacheFlush);
  50. PRINT_SYMBOL(DkSegmentRegister);
  51. PRINT_SYMBOL(DkMemoryAvailableQuota);
  52. return 0;
  53. }