void Test()
{
TCHAR dllPath[MAX_PATH] = _T("你的dll名称及完整路径");
HMODULE lib = LoadLibrary(_T("kernel32.dll"));
FARPROC proc = GetProcAddress(lib, "LoadLibraryA");
FreeLibrary(lib);
HANDLE process = OpenProcess(PROCESS_CREATE_THREAD|PROCESS_VM_OPERATION|PROCESS_VM_WRITE, FALSE, 1672);
LPVOID param = VirtualAllocEx(process, NULL, sizeof(dllPath), MEM_COMMIT, PAGE_EXECUTE_READWRITE);
BOOL b = WriteProcessMemory(process, param, dllPath, sizeof(dllPath), NULL);
HANDLE thread = CreateRemoteThread(process, NULL, 0, (LPTHREAD_START_ROUTINE)proc, param, 0, NULL);
WaitForSingleObject(thread, INFINITE);
VirtualFreeEx(process, param, 0, MEM_RELEASE);
CloseHandle(thread);
CloseHandle(process);
}
dll注入
最新推荐文章于 2024-04-11 09:58:39 发布