Advertisement
Nattack

Untitled

Feb 26th, 2018
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. // ConsoleApplication1.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "windows.h"
  6. #include <iostream>
  7.  
  8. using namespace std;
  9.  
  10. typedef short (CALLBACK* DoAThing)();
  11.  
  12.  
  13. int main()
  14. {
  15.     HINSTANCE hGetProcIDDLL = LoadLibrary(L"kernel32.dll");
  16.  
  17.     if (hGetProcIDDLL != NULL) cout << "loaded DLL" << endl;
  18.     else cout << "did not load DLL" << endl;
  19.    
  20.     DoAThing DoAThingPtr = (DoAThing)GetProcAddress(hGetProcIDDLL, "GetCurrentProcessId");
  21.  
  22.     cout << DoAThingPtr();
  23.     FreeLibrary(hGetProcIDDLL);
  24.     cin.get();
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement