This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$OutputEncoding = New-Object -typename System.Text.UTF8Encoding | |
[Console]::OutputEncoding = New-Object -typename System.Text.UTF8Encoding |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Gets a pointer to the PEB for x86, x64, ARM, ARM64, IA64, Alpha AXP, MIPS, and PowerPC. | |
// This relies on MS-compiler intrinsics. | |
// It has only been tested on x86/x64/ARMv7. | |
inline PEB* NtCurrentPeb() { | |
#ifdef _M_X64 | |
return (PEB*)(__readgsqword(0x60)); | |
#elif _M_IX86 | |
return (PEB*)(__readfsdword(0x30)); |