Download Demo Project - 499 KB
Introduction
HookAPI is the API SDK that sets up system wide hooks for all windows platforms. It could easily hook 32-bit windows system APIs or 32-bit user-defined DLL. It could be used easily and all you need to do is write a DLL File Named mydll.dll or mydll_9x.dll. it is based on apispy32 by yariv kaplan.
The Code Injects Two Dlls INTO The Destination Application. The First DLL, HookapixX.dll, Updates The Api's First 5 Bytes:
PAPI [0] = 0xE8;
* (DWORD *) & PAPI [1] = (DWORD) ProcessCall - (DWORD) PAPI -CALL_BYTES_SIZE;
The Nother DLL
MYDLLXXX.DLL, RUNS The New Api Instead of The Old Api, Like this Sample To Hook The
Socket Function:
Int WinApi MySocket (int Af, int usepe, int protocol)
{
Writelog ("Debug MySocket, AF =% D, Type =% D, Protocol =% D", AF, TYPE, Protocol;
Return Socket (AF, TYPE, Protocol);
}
And hookapixx.dll hooks the createprocessw / createprocessa functions, so it can catch the creation of new processes and inject the two dlls:
#ifdef Winnt
IF (! Strcmp (Pinfo-> API_NAME, "CREATEPROCESSW" ||
! strcmp (Pinfo-> API_NAME, "CreateProcessa"))
{
Pi = (process_information *) pdwparam [9];
IF (pi-> hprocess)
{
InjectLib (Pi-> HProcess, FNAME); // Hook New Process
}
}
#ENDIF
If you want to use it, then load the first DLL HookAPIxx.dll. If it's an NT system (WinNT / XP / 200x), you should call function HookAllProcess () in the DLL and call UnhookAllProcess when you exit. There are other functions In the DLL, Like HookoneProcess, HookoneProcess2 To Hook One Application On NT System.
Mydllxx.dll is loading by hookapixx.dll when hookapixx.dll is initialized, and then makes the hook:
Chookapi :: Chookapi ()
{
LoadMydll (); init ();
HookAllapi ();
} It incrudes The Following Parts:
Hookapi SDK Full Source Codes Many Examples Source Codes, Such As;
Hook socket functions like socket, send, recv, connect, ... Hook file functions like CreateFile, ReadFile, ... Hook registry functions like RegOpenKey, RegQueryValue, RegQueryValueEx, ... Delphi sample for Hook socket function Delphi sample for Hook file function Hook ExitWindowsEx Hook LoadLibrary and GetProcAddress Hook GDI functions like TextOut, ExtTextOut Hook Shell API function like SHBrowseForFolder, SHGetFileInfo, ... Hiden Processes sample, it can hide processes, task managers can not find it filter Advertisement bar sample, it can filter AD bar of IE or other network application, or filter the data from some ports of TCP / UDP Message filter sample, it can filter some messages of the windows Execute file manager sample, it can forbide some files open, execute, and hidden some folders or files NET Encrypt Sample, IT CAN Encrypt All The Application That Wrriten with socket. With this, you will not need encrypt in your application. Hook a ship game to aut o Drop Bomb and Auto Elude Bullet
About Pudn.com
An Old C Programmer In China. Click Here To View Pudn.com's Online Profile.
Other Popular Articles: