MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / get_teb_address

Method get_teb_address

pydevd_attach_to_process/winappdbg/thread.py:918–938  ·  view source on GitHub ↗

Returns a remote pointer to the TEB. @rtype: int @return: Remote pointer to the L{TEB} structure. @raise WindowsError: An exception is raised on error.

(self)

Source from the content-addressed store, hash-verified

916 return self.get_process().read_structure(self.get_teb_address(), win32.TEB)
917
918 def get_teb_address(self):
919 """
920 Returns a remote pointer to the TEB.
921
922 @rtype: int
923 @return: Remote pointer to the L{TEB} structure.
924 @raise WindowsError: An exception is raised on error.
925 """
926 try:
927 return self._teb_ptr
928 except AttributeError:
929 try:
930 hThread = self.get_handle(win32.THREAD_QUERY_INFORMATION)
931 tbi = win32.NtQueryInformationThread(hThread, win32.ThreadBasicInformation)
932 address = tbi.TebBaseAddress
933 except WindowsError:
934 address = self.get_linear_address("SegFs", 0) # fs:[0]
935 if not address:
936 raise
937 self._teb_ptr = address
938 return address
939
940 def get_linear_address(self, segment, address):
941 """

Callers 1

get_tebMethod · 0.95

Calls 2

get_handleMethod · 0.95
get_linear_addressMethod · 0.95

Tested by

no test coverage detected