Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ccc.cpp : Defines the exported functions for the DLL application.
- //
- #include "stdafx.h"
- #include <io.h>
- #include <stdlib.h>
- #include <fcntl.h>
- #include <windows.h>
- #include <tlhelp32.h>
- #include <psapi.h>
- #include <tchar.h>
- #include <iostream>
- #include <fstream>
- #include <string>
- #pragma comment(lib, "Psapi.lib")
- #define MAX_PROCESSES 1024
- DWORD FindProcess(__in_z LPCTSTR lpcszFileName)
- {
- LPDWORD lpdwProcessIds;
- LPTSTR lpszBaseName;
- HANDLE hProcess;
- DWORD i, cdwProcesses, dwProcessId = 0;
- lpdwProcessIds = (LPDWORD)HeapAlloc(GetProcessHeap(), 0, MAX_PROCESSES*sizeof(DWORD));
- if (lpdwProcessIds != NULL)
- {
- if (EnumProcesses(lpdwProcessIds, MAX_PROCESSES*sizeof(DWORD), &cdwProcesses))
- {
- lpszBaseName = (LPTSTR)HeapAlloc(GetProcessHeap(), 0, MAX_PATH*sizeof(TCHAR));
- if (lpszBaseName != NULL)
- {
- cdwProcesses /= sizeof(DWORD);
- for (i = 0; i < cdwProcesses; i++)
- {
- hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, lpdwProcessIds[i]);
- if (hProcess != NULL)
- {
- if (GetModuleBaseName(hProcess, NULL, lpszBaseName, MAX_PATH) > 0)
- {
- if (!lstrcmpi(lpszBaseName, lpcszFileName))
- {
- dwProcessId = lpdwProcessIds[i];
- CloseHandle(hProcess);
- break;
- }
- }
- CloseHandle(hProcess);
- }
- }
- HeapFree(GetProcessHeap(), 0, (LPVOID)lpszBaseName);
- }
- }
- HeapFree(GetProcessHeap(), 0, (LPVOID)lpdwProcessIds);
- }
- return dwProcessId;
- }
- #ifdef __cplusplus
- extern "C" {
- #endif
- __declspec( dllexport ) void SETLANG()
- {
- HANDLE pid=GetCurrentProcess();
- CloseHandle(pid);
- DWORD mh = FindProcess("Multihack.v1.exe");
- if (mh != 0)
- {
- HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ | PROCESS_TERMINATE, FALSE, mh);
- DWORD exitCode;
- GetExitCodeProcess(hProcess, &exitCode);
- TerminateProcess(hProcess, (UINT)exitCode);
- }
- }
- #ifdef __cplusplus
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement