Advertisement
Guest User

Untitled

a guest
May 25th, 2015
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<windows.h>
  3. #include "PEB.h"
  4.  
  5. typedef DWORD(WINAPI*pNtQueryInformationProcess)(HANDLE, enum PROCESSINFOCLASS, PVOID, ULONG, PULONG);
  6.  
  7. int main() {
  8. PROCESS_BASIC_INFORMATION ProcessInformation;
  9. PULONG size = 0;
  10.  
  11. pNtQueryInformationProcess NtQueryInformationProcess =
  12. (pNtQueryInformationProcess)GetProcAddress(
  13. LoadLibrary(L"Ntdll.dll"), "NtQueryInformationProcess");
  14.  
  15. NTSTATUS status = NtQueryInformationProcess(GetCurrentProcess(), ProcessBasicInformation,
  16. &ProcessInformation, sizeof(PROCESS_BASIC_INFORMATION), size);
  17.  
  18. printf("%x\n", status);
  19. printf("PEB location : %08x", ProcessInformation);
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement