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

Class DisableWow64FsRedirection

windows/utils/winutils.py:607–627  ·  view source on GitHub ↗

A context manager that disable the SysWow64 Filesystem Redirection :: if is_process_32_bits: def pop_calc_64(): with windows.utils.DisableWow64FsRedirection(): return windows.utils.create_process(r"C:\Windows\system32\calc.exe", True)

Source from the content-addressed store, hash-verified

605
606
607class DisableWow64FsRedirection(object):
608 """
609 A context manager that disable the SysWow64 Filesystem Redirection ::
610
611 if is_process_32_bits:
612 def pop_calc_64():
613 with windows.utils.DisableWow64FsRedirection():
614 return windows.utils.create_process(r"C:\Windows\system32\calc.exe", True)
615 """
616 def __enter__(self):
617 if windows.current_process.bitness == 64 or windows.system.bitness == 32:
618 return self
619 self.OldValue = PVOID()
620 winproxy.Wow64DisableWow64FsRedirection(ctypes.byref(self.OldValue))
621 return self
622
623 def __exit__(self, exc_type, exc_value, traceback):
624 if windows.current_process.bitness == 64 or windows.system.bitness == 32:
625 return False
626 winproxy.Wow64RevertWow64FsRedirection(self.OldValue)
627 return False

Callers 1

pop_proc_64Function · 0.90

Calls

no outgoing calls

Tested by 1

pop_proc_64Function · 0.72