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)
| 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 | """ |
no test coverage detected