gdb_video_hr.py 1.0 KB

12345678910111213141516171819202122
  1. # HRESULTs of WE's video texture upload (wallpaper64.exe 2.8.42 sub_1400F3480): the keyed mutex AcquireSync and the
  2. # media engine's TransferVideoFrame into the shared texture; the frame only counts when both succeed.
  3. # OUT=hr.txt COUNT=40 gdb -q -batch -p <wallpaper64.exe pid> -x gdb_video_hr.py
  4. import gdb, os
  5. gdb.execute('set pagination off')
  6. gdb.execute('set confirm off')
  7. out = open(os.environ.get('OUT', 'video_hr.txt'), 'w')
  8. count = [0]
  9. class B(gdb.Breakpoint):
  10. def __init__(self, addr, kind):
  11. super().__init__('*' + hex(addr), internal=False); self.kind = kind
  12. def stop(self):
  13. eax = int(gdb.selected_frame().read_register('rax')) & 0xffffffff
  14. out.write('%s hr=0x%08x\n' % (self.kind, eax)); out.flush()
  15. count[0] += 1
  16. if count[0] >= int(os.environ.get('COUNT', 40)):
  17. gdb.execute('delete'); out.close()
  18. gdb.post_event(lambda: gdb.execute('detach'))
  19. return False
  20. B(0x1400f3517, 'AcquireSync')
  21. B(0x1400f3545, 'TransferVideoFrame')
  22. gdb.execute('continue')