Symbols.c 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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(DkStreamsWaitEvents);
  33. PRINT_SYMBOL(DkThreadCreate);
  34. PRINT_SYMBOL(DkThreadDelayExecution);
  35. PRINT_SYMBOL(DkThreadYieldExecution);
  36. PRINT_SYMBOL(DkThreadExit);
  37. PRINT_SYMBOL(DkThreadResume);
  38. PRINT_SYMBOL(DkSetExceptionHandler);
  39. PRINT_SYMBOL(DkExceptionReturn);
  40. PRINT_SYMBOL(DkMutexCreate);
  41. PRINT_SYMBOL(DkMutexRelease);
  42. PRINT_SYMBOL(DkNotificationEventCreate);
  43. PRINT_SYMBOL(DkSynchronizationEventCreate);
  44. PRINT_SYMBOL(DkEventSet);
  45. PRINT_SYMBOL(DkEventClear);
  46. PRINT_SYMBOL(DkSynchronizationObjectWait);
  47. PRINT_SYMBOL(DkObjectClose);
  48. PRINT_SYMBOL(DkSystemTimeQuery);
  49. PRINT_SYMBOL(DkRandomBitsRead);
  50. PRINT_SYMBOL(DkInstructionCacheFlush);
  51. PRINT_SYMBOL(DkSegmentRegister);
  52. PRINT_SYMBOL(DkMemoryAvailableQuota);
  53. return 0;
  54. }