-
Автор темы
- #1
создаём консольное приложение
создаём файл .cpp
кидаем на него код
создаём файл .cpp
кидаем на него код
Форматирование (BB-код):
#include "stdafx.h"
#include <windows.h>
#include <iostream>
#include <string>
#include <TlHelp32.h>
using namespace std;
DWORD pid;
bool Inject(DWORD pid, char *dllName)
{
HANDLE h = OpenProcess(PROCESS_ALL_ACCESS, false, pid);
if (h)
{
LPVOID LoadLibAddr = (LPVOID)GetProcAddress(GetModuleHandleA("kernel32.dll"), "LoadLibraryA");
cout << "[!] Initialized Library\n";
LPVOID dereercomp = VirtualAllocEx(h, NULL, strlen(dllName), MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
cout << "[!] Initialized memory allocation\n";
WriteProcessMemory(h, dereercomp, dllName, strlen(dllName), NULL);
cout << "[!] Wrote dll name to memory: " << strlen(dllName) << " byte(s)\n";
HANDLE asdc = CreateRemoteThread(h, NULL, NULL, (LPTHREAD_START_ROUTINE)LoadLibAddr, dereercomp, 0, NULL);
cout << "[!] Created remote thread: " << asdc << endl;
cout << "[!] Waiting for Dll exit...\n";
WaitForSingleObject(asdc, INFINITE);
VirtualFreeEx(h, dereercomp, strlen(dllName), MEM_RELEASE);
cout << "[!] Freeing memory\n";
CloseHandle(asdc);
CloseHandle(h);
cout << "[!] Closed all handles\n";
return true;
cout << "[!] Complete!\n";
Beep(247, 500);
Sleep(300);
}
system("cls");
system("color c");
cout << "[!] Игра не запущена!\n";
Sleep(3000);
return false;
}
int main() {
string strDLL;
cout << "Введите название DLL чита: ";
getline(cin, strDLL);
GetFullPathName((strDLL.c_str()), MAX_PATH, full_path, NULL);
Inject(pid, full_path);
}
Последнее редактирование: