Yakalayıcı
unknown
c_cpp
9 months ago
1.3 kB
13
Indexable
#include <windows.h>
#include <stdio.h>
#include <iostream>
HHOOK hHook = NULL;
LRESULT CALLBACK KeyboardProc(int nCode, WPARAM wParam, LPARAM lParam) {
if (nCode >= 0) {
MessageBoxA(NULL, "Keyboard Hook algılandı!", "Uyarı!", MB_OK | MB_ICONWARNING);
}
return CallNextHookEx(hHook, nCode, wParam, lParam);
}
DWORD WINAPI HookThread(LPVOID lpParam) {
HINSTANCE hInstance = GetModuleHandle(NULL);
hHook = SetWindowsHookEx(WH_KEYBOARD_LL, KeyboardProc, hInstance, 0);
if (hHook == NULL) {
MessageBoxA(NULL, "Hook oluşturulamadı!", "Hata!", MB_OK | MB_ICONERROR);
}
else {
MessageBoxA(NULL, "Hook başarıyla oluşturuldu!", "Başarılı!", MB_OK | MB_ICONINFORMATION);
}
MSG msg;
while (GetMessage(&msg, NULL, 0, 0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
UnhookWindowsHookEx(hHook);
return 0;
}
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
if (ul_reason_for_call == DLL_PROCESS_ATTACH) {
MessageBoxA(NULL, "DLL Inject Edildi!", "Başarılı", MB_OK | MB_ICONINFORMATION);
DisableThreadLibraryCalls(hModule);
CreateThread(NULL, 0, HookThread, NULL, 0, NULL);
}
return TRUE;
}
Editor is loading...
Leave a Comment