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. 'DkMutexCreate',
  37. 'DkMutexRelease',
  38. 'DkNotificationEventCreate',
  39. 'DkSynchronizationEventCreate',
  40. 'DkEventSet',
  41. 'DkEventClear',
  42. 'DkObjectsWaitAny',
  43. 'DkObjectClose',
  44. 'DkSystemTimeQuery',
  45. 'DkRandomBitsRead',
  46. 'DkInstructionCacheFlush',
  47. 'DkSegmentRegister',
  48. 'DkMemoryAvailableQuota',
  49. 'DkCreatePhysicalMemoryChannel',
  50. 'DkPhysicalMemoryCommit',
  51. 'DkPhysicalMemoryMap']
  52. def check_symbols(res):
  53. for sym in all_symbols:
  54. found = False
  55. for line in res[0].log:
  56. if line and line.startswith(sym + ' = '):
  57. if line == sym + ' = 0x0':
  58. return False
  59. found = True
  60. break
  61. if not found:
  62. return False
  63. return True
  64. regression.add_check(name="Symbol Resolution", check=check_symbols);
  65. rv = regression.run_checks()
  66. if rv: sys.exit(rv)