More TEB syswow fix

This commit is contained in:
hakril
2025-01-31 17:37:07 +01:00
parent 36c1eb647f
commit 029f7cba35
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -474,7 +474,7 @@ class TestProcessWithCheckGarbage(object):
with proc32_64.allocated_memory(0x1000) as addr:
assert proc32_64.get_mapped_filename(addr) is None
def test_current_thread_teb():
def test_current_thread_teb(self):
teb = windows.current_thread.teb
assert ctypes.addressof(teb) == ctypes.addressof(windows.current_thread.teb.NtTib.Self[0])
assert ctypes.addressof(windows.current_process.peb) == ctypes.addressof(teb.ProcessEnvironmentBlock[0])
+4 -2
View File
@@ -916,8 +916,10 @@ class WinThread(Thread):
@property
def teb_syswow(self):
return RemoteTEB64(self.teb_syswow_base, self.owner)
if windows.current_process.bitness == 64:
return RemoteTEB64(self.teb_syswow_base, self)
else: #current is 32bits
return RemoteTEB64(self.teb_syswow_base, windows.syswow64.ReadSyswow64Process(self.owner))
def exit(self, code=0):
"""Exit the thread"""