Created
June 18, 2015 09:14
-
-
Save evernick/45a2dbb7bbcc0f90de24 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#define _WIN32_WINNT 0x0501 | |
#include <windows.h> | |
#include <stdio.h> | |
#include <Winternl.h> | |
typedef DWORD (WINAPI *PFZWQUERYINFORMATIONPROCESS) ( | |
HANDLE ProcessHandle, | |
DWORD ProcessInformationClass, // Origianl : _PROCESS_INFORMATION_CLASS | |
PVOID ProcessInformation, | |
ULONG ProcessInformationLength, | |
PULONG ReturnLength | |
); | |
int main(int argc, char **argv) | |
{ | |
PROCESS_BASIC_INFORMATION pPib; | |
PFZWQUERYINFORMATIONPROCESS pfZwQueryInformationProcess; | |
HMODULE h_ntdll = GetModuleHandle("ntdll.dll"); | |
pfZwQueryInformationProcess = (PFZWQUERYINFORMATIONPROCESS)GetProcAddress(h_ntdll, "ZwQueryInformationProcess"); | |
pfZwQueryInformationProcess(GetCurrentProcess(), ProcessBasicInformation, &pPib, sizeof(PROCESS_BASIC_INFORMATION), 0); // 0x0 : ProcessBasicInformation | |
printf("PEB Address Is : %p\n", pPib.PebBaseAddress); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment