00_Symbols.py 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #!/usr/bin/python
  2. import os, sys, mmap
  3. from regression import Regression
  4. loader = os.environ['PAL_LOADER']
  5. regression = Regression(loader, "Symbols")
  6. all_symbols = [
  7. 'DkVirtualMemoryAlloc',
  8. 'DkVirtualMemoryFree',
  9. 'DkVirtualMemoryProtect',
  10. 'DkProcessCreate',
  11. 'DkProcessExit',
  12. 'DkProcessSandboxCreate',
  13. 'DkStreamOpen',
  14. 'DkStreamWaitForClient',
  15. 'DkStreamRead',
  16. 'DkStreamWrite',
  17. 'DkStreamDelete',
  18. 'DkStreamMap',
  19. 'DkStreamUnmap',
  20. 'DkStreamSetLength',
  21. 'DkStreamFlush',
  22. 'DkSendHandle',
  23. 'DkReceiveHandle',
  24. 'DkStreamAttributesQuery',
  25. 'DkStreamAttributesQuerybyHandle',
  26. 'DkStreamAttributesSetbyHandle',
  27. 'DkStreamGetName',
  28. 'DkStreamChangeName',
  29. 'DkThreadCreate',
  30. 'DkThreadDelayExecution',
  31. 'DkThreadYieldExecution',
  32. 'DkThreadExit',
  33. 'DkThreadResume',
  34. 'DkSetExceptionHandler',
  35. 'DkExceptionReturn',
  36. 'DkSemaphoreCreate',
  37. 'DkSemaphoreRelease',
  38. 'DkNotificationEventCreate',
  39. 'DkSynchronizationEventCreate',
  40. 'DkEventSet',
  41. 'DkEventClear',
  42. 'DkObjectsWaitAny',
  43. 'DkObjectReference',
  44. 'DkObjectClose',
  45. 'DkSystemTimeQuery',
  46. 'DkRandomBitsRead',
  47. 'DkInstructionCacheFlush',
  48. 'DkSegmentRegister',
  49. 'DkMemoryAvailableQuota',
  50. 'DkCreatePhysicalMemoryChannel',
  51. 'DkPhysicalMemoryCommit',
  52. 'DkPhysicalMemoryMap']
  53. def check_symbols(res):
  54. for sym in all_symbols:
  55. found = False
  56. for line in res[0].log:
  57. if line and line.startswith(sym + ' = '):
  58. if line == sym + ' = 0x0':
  59. return False
  60. found = True
  61. break
  62. if not found:
  63. return False
  64. return True
  65. regression.add_check(name="Symbol Resolution", check=check_symbols);
  66. regression.run_checks()