Created
December 31, 2016 11:24
-
-
Save mpfund/ccb188979ba69f72c64372da0499e420 to your computer and use it in GitHub Desktop.
dll in process injecten
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
#include <iostream> | |
#include <windows.h> | |
#include <psapi.h> | |
using namespace std; | |
int main() | |
{ | |
DWORD pProcessIds[500]; | |
DWORD pBytesReturned; | |
HANDLE hprocess = NULL; | |
char filepath[300]; | |
if(EnumProcesses(pProcessIds,sizeof(pProcessIds),&pBytesReturned)!=0) | |
{ | |
for(DWORD x=0;x<=pBytesReturned/sizeof(DWORD);x++) | |
{ | |
hprocess = OpenProcess(PROCESS_QUERY_INFORMATION|PROCESS_VM_READ,false,pProcessIds[x++]); | |
if(hprocess != NULL) | |
{ | |
GetModuleFileNameEx(hprocess,NULL,filepath,sizeof(filepath)); | |
printf("%u %s \n",pProcessIds[x-1],filepath); | |
} | |
//else{printf("%u\n",GetLastError());} | |
} | |
} | |
else | |
{printf("Enum Fehlgeschlagen\n");} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment