MCPcopy Create free account
hub / github.com/ELMERIKH/PyinMemoryPE / context

Method context

windows/winobject/process.py:789–813  ·  view source on GitHub ↗

The context of the thread, type depend of the target process. :type: :class:`windows.exception.ECONTEXT32` or :class:`windows.exception.ECONTEXT64` or :class:`windows.exception.ECONTEXTWOW64`

(self)

Source from the content-addressed store, hash-verified

787
788 @property
789 def context(self):
790 """The context of the thread, type depend of the target process.
791
792 :type: :class:`windows.exception.ECONTEXT32` or :class:`windows.exception.ECONTEXT64` or :class:`windows.exception.ECONTEXTWOW64`
793 """
794 if self.owner.bitness == 32 and windows.current_process.bitness == 64:
795 # Wow64
796 x = exception.ECONTEXTWOW64()
797 x.ContextFlags = CONTEXT_ALL
798 winproxy.Wow64GetThreadContext(self.handle, x)
799 return x
800
801 if self.owner.bitness == 64 and windows.current_process.bitness == 32:
802 x = exception.ECONTEXT64.new_aligned()
803 x.ContextFlags = CONTEXT_ALL
804 windows.syswow64.NtGetContextThread_32_to_64(self.handle, x)
805 return x
806
807 if self.owner.bitness == 32:
808 x = exception.ECONTEXT32()
809 else:
810 x = exception.ECONTEXT64.new_aligned()
811 x.ContextFlags = CONTEXT_ALL
812 winproxy.GetThreadContext(self.handle, x)
813 return x
814
815 @property
816 def context_syswow(self):

Callers

nothing calls this directly

Calls 1

new_alignedMethod · 0.80

Tested by

no test coverage detected