[Delphi] QQ tail source code

zhaozj2021-02-16  125

Description: 1. Just learn how Hook technology. 2. Only for the QQ2004PReview version. 3. Monitor only Ctrl Enter. 4. Open the QQ Chat dialog box 5. Enter the tail information in the text box. 6. Click "Open QQ Tail". 7. Send QQ messages using Ctrl Enter. 8. Please don't use it for malicious behavior! ============ joecom =====

DLL: Library Hookdll;

{Important note about DLL memory management: ShareMem must be the first unit in your library's USES clause AND your project's (select Project-View Source) USES clause if your DLL exports any procedures or functions that pass strings as parameters or function results This applies. to all strings passed to and from your DLL -.. even those that are nested in records and classes ShareMem is the interface unit to the BORLNDMM.DLL shared memory manager, which must be deployed along with your DLL to avoid using BORLNDMM.DLL PASS STRING INFORMATION USING PCHAR OR SHORTSTRING Parameters.

Uses Sysutils, Windows, Messages, Classes; Const IDC_Richedit = 894;

VAR HPROC, HKEY: HWND; {$ r * .res} // get window text

Function getWndtext (hwnd: hwnd): string; var ret: longint; mtext: pchar; buf: integer; begin ret: = sendMessage (hwnd, wm_gettextLength, 0, 0) 1; GetMem (MTEXT, RET); Try BUF: = Longint (mtext); sendMessage (hwnd, wm_gettext, ret, buf); result: = strpas (mtext); Finally FreeMem (MTEXT, RET); end; End;

// Send text to window procedure setWndtext (hwnd: hwnd; text: string); var // Ret: longint; mText: pchar; buf: integer; begin getmem (mtext, length (text)); strcopy (mtext, pchar) TEXT); try buf: = longint (mText); SendMessage (hwnd, wm_settext, 0, buf); Finally FreeMem (MTEXT, Length (Text)); End;

// Send your own tail message Procedure SendmyTailText (Handle: hwnd); var msg: string; begin msg: = getWndtext (Handle); msg: = msg # 13 # 10 'I have my own QQ tail, don't fight I am ' # 13 # 10 ' Welcome to Joeang Software Studio http: //joecom.blogone.net '; setWndText (Handle, MSG);

END;

Function Findqqq: hwnd; var hqq: hwnd; begin result: = 0; // Find QQ HQQ: = FindWindowEx (0, // parent 0, // Child '# 32770', // window class name by spy or minispy You can find NIL // window caption);

// Loop Find While (HQQ <> 0) Do // and (hsend = 0) Begin IF (POS ('chat ", getWndtext (hqq))> 0) OR (POS (' Send Message ', GetWndText (HQQ ))> 0) OR (POS ('group', getWndtext (hqq))> 0) The begin result: = hqq; exit; end; // Find QQ HQQ: = FINDWINDOWEX (0, // parent hqq, // Child '# 32770', // window class name You can find nil // window cappions by spy or miniSPY;

END;

Function CallwndProc (Handle, MSG, WPARAM, LRESULT; stdcall; var hrichtext, hqq, hchild: hwnd; // qq Enter message box Handlebegin Result: = 0; HQQ: = Findqq; if HQQ = 0 THEN Exit; hchild: = getdlgitem (hqq, 0); // Send the sub-window where the window is located // hsend: = getdlgitem (hchild, 1); // The handle of the send button Handle: = getdlgitem (hchild, 0); hrichtext: = GetDlgItem (hChild, 894); if (Handle = hChild) and (Msg = WM_COMMAND) and (LOWORD (wParam) = 1) then SendMyTailText (hRichText); result: = CallNextHookEx (hProc, Msg, wParam, lParam); end ;

// intercept Ctrl Enterfunction KeyboardProc (iCode: Integer; WParam: WPARAM; lParam: LPARAM): LRESULT; stdcall; const VK_S = $ 53; var hRichText, hSend, hQQ, hChild: Hwnd; // QQ input message box Handlebegin Result : = 0; HQQ: = Findqq; if HQQ = 0 THEN EXIT; hCHILD: = getdlgitem (hqq, 0); // Send window Sub-window // hsend: = getdlgitem (hChild, 1); // Send button HRICHTEXT: = Getdlgitem (Getdlgitem (Hchild, 0), 894); if iF iF iF iF Icode <0 Then Begin Result: = CallNexthooKex (HKEY, ICODE, WPARAM, LPARAM); EXIT; END; // Capture Hot Key Message IF (( wParam = VK_RETURN) and (GetAsyncKeyState (VK_CONTROL) <0)) then begin SendMyTailText (hRichText); end; result: = CallNextHookEx (hKey, iCode, wParam, lParam); end; Function SetHook: Boolean; stdcall; export; var dwThreadID : DWord; HQQ: hwnd; begin result: = false; hqq: = findqq; if hqq = 0 Then EXIT; DWTHREADID: = GetWindowThreadProcessID (HQQ, NIL);

If DWTHREADID = 0 THEN BEGIN MessageBox (0, 'Hook Failed!', 'DLL ERROR', MB_ICONITION MB_OK); EXIT; END; // Mount Hook // Use Send Button Send Message // HPROC: = SETWINDOWSHOKEX (Wh_CallWndProc , @Callwndproc, hinstance, dwthreadid; // Send message using Ctrl Enter HKEY: = SETWINDOWSHOKEX (Wh_Keyboard, @keyboardproc, hinstance, dwthreadid);

Result: = (HPROC <> 0) or (HKEY <> 0); END;

Function unhook: boolean; stdcall; export; begin

Result: = UnhookWindowsHookex (HKEY);

END;

Exports // DLL Output Function Sthook, UnHook; BeGinend.

========== Main interface: Start QQ tail: sethook; stop QQ tail: unhook. ==================== Executable file download: 50K

Save the following connection as, then change the ".jpg" to ".rar", then decompress it. QQ tail download

转载请注明原文地址:https://www.9cbs.com/read-8940.html

New Post(0)