| 113 | } |
| 114 | |
| 115 | PTEB GetTeb() { |
| 116 | #ifdef _WIN64 |
| 117 | return (PTEB)__readgsqword((ULONG)offsetof(NT_TIB, Self)); |
| 118 | #elif _WIN32 |
| 119 | return (PTEB)__readfsdword((ULONG)offsetof(NT_TIB, Self)); |
| 120 | #else |
| 121 | #error unupported_CPU |
| 122 | #endif // _WIN64 |
| 123 | |
| 124 | } |
| 125 | |
| 126 | PPEB GetPeb(PTEB pTeb) { |
| 127 | return pTeb->ProcessEnvironmentBlock; |