Sometimes we need other applications to send and receive network data interception, such as IE to send
the ** head of analysis, to get the address of the request, this time we can use some such as WPE, Sniffer
tools like achieve their goals, but the tools with limited functionality, in order to achieve greater functionality,
or our own hands to DIY it.
Intercept network data packets in three ways, first the network card set to promiscuous mode, you can
monitor this to all packets on the LAN, the second is the target process HOOK API functions to send and
receive, the third method is own implement a proxy DLL. Here we use the HOOK API methods, so easy to
implement, but also will not get a lot of useless data (such as the first method would be to monitor all
network data).
The following is a simplified API HOOK as the template, the principle is the use of message hook into the
DLL code into the target process, then the API function GetProcAddress to get entry address, the function
entry address entry to define their own functions, so API function to get the corresponding parameters,
dealt with, and then back to the real API function entry address, and call it.
HOOK.DLL code:
library Hook;
uses
SysUtils,
windows,
Messages,
APIHook in ‘APIHook.pas’;
type
PData = ^ TData;
TData = record
Hook: THandle;
Hooked: Boolean;
end;
var
DLLData: PData;
{————————————}
{Procedure name: HookProc
{Process functions: HOOK process
{Process parameters: nCode, wParam, lParam message phase
{Related parameters
{————————————}
procedure HookProc (nCode, wParam, lParam: LongWORD); stdcall;
begin
if not DLLData ^. Hooked then
begin
HookAPI;
DLLData ^. Hooked: = True;
end;
/ / Call the next Hook
CallNextHookEx (DLLData ^. Hook, nCode, wParam, lParam);
end;
{————————————}
{Function name: InstallHook
{Function: HOOK installed on the specified window
{Function arguments: sWindow: To install windows HOOK
{Return value: success returns TRUE, FALSE on failure
{————————————}
function InstallHook (SWindow: LongWORD): Boolean; stdcall;
var
ThreadID: LongWORD;
begin
Result: = False;
DLLData ^. Hook: = 0;
Recent Posts
Recent Posts
Save img with UIImagePickerController
Save img with UIImagePickerController
system status bar is hidden in the iPhone
system status bar is hidden in the iPhone
phone / iPad, to change UIToolbar the
phone / iPad, to change UIToolbar the
background color
background color
The NSTimer timer operation
The NSTimer timer operation
Dynamic adjustment of the UITableViewCell
Dynamic adjustment of the UITableViewCell
height to achieve
height to achieve
Recent Comments
Recent Comments
big pony ralph lauren on
Public function
Public function
MessageBoxTimeOut not achieve regular
MessageBoxTimeOut not achieve regular
news
news
buy generic viagra on
Unable to load Process
Unable to load Process
Monitor device driver
Monitor device driver
viagra on
createremotethread function api
createremotethread function api
realize by reactos
realize by reactos
low price viagra on
call msi createprocess vc
call msi createprocess vc
cheap viagra pills on
zlib 64bit
zlib 64bit
lib
lib
Archives
Archives
March 2012
March 2012
February 2012
February 2012
January 2012
January 2012
December 2011
December 2011
November 2011
November 2011
October 2011
October 2011
September 2011
September 2011
August 2011
August 2011
July 2011
July 2011
June 2011
June 2011
Categories
Categories
application program
application program
book
book
system kernel
system kernel
tools download
tools download
Meta
Meta
Log in
Log in
Entries
Entries
RSS
RSS
Comments
Comments
RSS
RSS
Blogroll
Blogroll
anti asm
anti asm
xrumerservice
xrumerservice
Tags
Tags
403
403
ace
ace
activex
activex
asm
asm
bitmap
bitmap
book
book
boot
boot
chtmlview
chtmlview
com
com
computer
computer
cpuid
cpuid
createprocess
createprocess
CStatic
CStatic
CString
CString
design
design
future
future
Gloox
Gloox
HOOK
HOOK
hook api
hook api
http
http
injection
injection
IObjectSafe
IObjectSafe
iphone
iphone
javscript
javscript
linux
linux
mac
mac
macos 10.5.8
macos 10.5.8
memory
memory
msi
msi
msiexec.exe
msiexec.exe
mupdf
mupdf
Object-oriented
Object-oriented
Objective-C
Objective-C