005
19.08.2009, 05:34 Uhr
~BertaC
Gast
|
So hab nun ne ander Methode probiert (Detours 1.5).
Hier der Code
C++: |
#include <windows.h> #include <stdio.h> #include <detours.h> #include "xorstr.h" #pragma comment(lib,"detours.lib")
// GLOBALE VARIABELN
int vKey, xScreen, yScreen; // Tasten Simulation
void SimKeyPress() { KEYBDINPUT ki={0};
ki.wVk = vKey; ki.wScan = MapVirtualKeyEx(vKey, 0, GetKeyboardLayout(0));
INPUT ipEvent; ipEvent.type = INPUT_KEYBOARD; ipEvent.ki = ki;
SendInput(1,&ipEvent,sizeof(INPUT)); }
void SimKeyRelease() { KEYBDINPUT ki={0}; ki.wVk = vKey; ki.wScan = MapVirtualKeyEx(vKey, 0, GetKeyboardLayout(0));
INPUT ipEvent; ipEvent.type = INPUT_KEYBOARD; ipEvent.ki = ki; ipEvent.ki.dwFlags = KEYEVENTF_KEYUP;
SendInput(1,&ipEvent,sizeof(INPUT)); } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// typedef BOOL (WINAPI *BitBltFunc) (HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HDC hdcSrc, int nXSrc, int nYSrc, DWORD dwRop) = BitBlt;
BOOL WINAPI BitBltHooked(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HDC hdcSrc, int nXSrc, int nYSrc, DWORD dwRop) { BOOL bReturn;
xScreen = GetSystemMetrics(SM_CXSCREEN); yScreen = GetSystemMetrics(SM_CYSCREEN);
if ((nWidth == xScreen) && (nHeight == yScreen)) { // Tastendruck simulieren vKey = VK_DELETE;
SimKeyPress(); SimKeyRelease(); Sleep(100);
bReturn = BitBltPtr(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop);
SimKeyPress(); SimKeyRelease();
return bReturn; } return BitBltPtr(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop); }
void SetHook() { BitBltPtr = (BitBltFunc)DetourFunction((LPBYTE)DetourFindFunction(/*Gdi32.dll*/XorStr<0x2B,10,0xD0A951F1>("\x6C\x48\x44\x1D\x1D\x1E\x55\x5E\x5F"+0xD0A951F1).s, /*BitBlt*/XorStr<0xF5,7,0x95D8F86F>("\xB7\x9F\x83\xBA\x95\x8E"+0x95D8F86F).s),(LPBYTE)BitBltHooked); } // DLL MAIN BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, PVOID pvReserved) { if (DLL_PROCESS_ATTACH == dwReason) { SetHook(); } return TRUE; }
|
Jedoch kriege ich Folgenden Fehlermeldungen:
Code: |
1>.\main.cpp(41) : error C2513: 'BOOL (__stdcall *)(HDC,int,int,int,int,HDC,int,int,DWORD)': Keine Variable vor '=' deklariert 1>.\main.cpp(59) : error C3861: "BitBltPtr": Bezeichner wurde nicht gefunden. 1>.\main.cpp(66) : error C3861: "BitBltPtr": Bezeichner wurde nicht gefunden. 1>.\main.cpp(71) : error C2065: 'BitBltPtr': nichtdeklarierter Bezeichner
|
|