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

Method set_token

windows/winobject/process.py:545–548  ·  view source on GitHub ↗

Set the token for the thread (impersonation). Setting the token to None revert the impersonation

(self, token)

Source from the content-addressed store, hash-verified

543 return token.Token(token_handle.value)
544
545 def set_token(self, token):
546 """Set the token for the thread (impersonation). Setting the token to None revert the impersonation"""
547 thandle = getattr(token, "handle", token) # Accept raw handle & token object
548 return winproxy.SetThreadToken(self.handle, thandle)
549
550
551 _TOKEN_PROPERTY_DOC = """The thread :class:`~windows.winobject.token.Token`

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected