如何使用hook,或者其他方法得到对方程序中文本框的内容。--100fen

xch28 2003-05-21 07:32:03
如题,
不要告诉我sendmessage来得到,我试了,不行。
http://expert.csdn.net/Expert/topic/1815/1815068.xml?temp=.1778223
可以参考这个帖子,如果解决了,分可以全给。
急,谢谢。:(
...全文
177 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
tianliangle2003 2003-05-22
  • 打赏
  • 举报
回复
如果你是用的2000/xp那就需要做个dll然后注入到你想要得到密码的窗口进程中
不要向我要源码我也没有
xch28 2003-05-21
  • 打赏
  • 举报
回复
对不起,我们这里不让上qq。
我留下我的qq号吧
16303482
BeyondStudio 2003-05-21
  • 打赏
  • 举报
回复
加QQ:87482543
xch28 2003-05-21
  • 打赏
  • 举报
回复
不是去密码程序。我给你发短信了。请查收
BeyondStudio 2003-05-21
  • 打赏
  • 举报
回复
你是不是做取 *** 程序?
BeyondStudio 2003-05-21
  • 打赏
  • 举报
回复
你看上面的源码啊,是通过调用Dll2.dll中的方法实现的
xch28 2003-05-21
  • 打赏
  • 举报
回复
楼上,请问怎么用hook实现?谢谢。
BeyondStudio 2003-05-21
  • 打赏
  • 举报
回复
使用了 Hook
xch28 2003-05-21
  • 打赏
  • 举报
回复
能不能给讲讲?
好象还是sendmessage
BeyondStudio 2003-05-21
  • 打赏
  • 举报
回复
password.dpr
{***************************************************************}
program password;

uses
windows,messages;

{$R *.RES}

var
//----------------------
wClass: TWndClass; //窗口类变量
Msg: TMSG; //消息变量
hInst, //程序实例
Handle, //主窗口句柄
hFont, //字体句柄
//----------------
hEditEmail, //e-mail编辑
hLabelEmail //e-mail提示
:integer; //句柄类型
procedure WriteCaption(hwnd:hwnd;text:pchar);begin sendmessage(hwnd,WM_SETTEXT,0,integer(text));end;
procedure ReadCaption(hwnd:hwnd;text:pchar);begin sendmessage(hwnd,WM_GETTEXT,400,integer(text));end;

//主程序结束
procedure ShutDown;
begin
DeleteObject(hFont);
UnRegisterClass(wClass.lpszClassName,hInst);
ExitProcess(hInst);
end;
//这是主窗口的消息处理函数
function WindowProc(hWnd,Msg,wParam,lParam:integer):Longint; stdcall;
begin
Result:=DefWindowProc(hWnd,Msg,wParam,lParam);
case Msg of
WM_DESTROY: ShutDown;
end;
end;
//定义几个窗口创建函数
function CreateEdit(name:pchar;x1,y1,x2,y2:integer):hwnd;begin Result:=CreateWindowEx(WS_EX_CLIENTEDGE,'Edit',name,WS_VISIBLE or WS_CHILD or ES_PASSWORD or ES_LEFT or ES_AUTOHSCROLL,x1,y1,x2,y2,Handle,0,hInst,nil);end;
function CreateLabel(name:pchar;x1,y1,x2,y2:integer):hwnd;begin Result:=CreateWindow('Static',name,WS_VISIBLE or WS_CHILD or SS_LEFT,x1,y1,x2,y2,Handle,0,hInst,nil);end;
function CreateMain(name:pchar;x1,y1,x2,y2:integer):hwnd;
begin
hInst:=GetModuleHandle(nil);
with wClass do
begin
Style:= CS_PARENTDC;
hIcon:= LoadIcon(hInst,'MAINICON');
lpfnWndProc:= @WindowProc;
hInstance:= hInst;
hbrBackground:= COLOR_BTNFACE+1;
lpszClassName:= 'MainClass';
hCursor:= LoadCursor(0,IDC_ARROW);
end;
RegisterClass(wClass);
Result:=CreateWindow(wClass.lpszClassName,name,WS_OVERLAPPEDWINDOW or WS_VISIBLE,x1,y1,x2,y2,0,0,hInst,nil);
end;
//---------主过程,类似于 C语言 中的 WinMain()
begin
handle:=CreateMain('exename',10,10,320,135);
hEditEmail:=CreateEdit('njhhack@263.net',60,4,174,20);
hLabelEmail:=CreateLabel('攻击目标:',4,8,54,24);
hFont:=CreateFont(-12,0,0,0,0,0,0,0,GB2312_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH or FF_DONTCARE,'宋体');
//改变字体
SendMessage(hEditEmail,WM_SETFONT,hFont,0);
SendMessage(hLabelEmail,WM_SETFONT,hFont,0);
while(GetMessage(Msg,Handle,0,0))do
begin
TranslateMessage(Msg);
DispatchMessage(Msg);
end;
end.

{*************************************************}
pass2k.dpr
{*************************************************}
Program Pass2K;
uses windows,messages,sysutils;
var
wClass: TWndClass; //窗口类变量
Msg: TMSG; //消息变量
hInst,Handle,hParent:thandle;
hLong:longint;
hPoint:TPOINT;
//
procedure run2;
var
hRemoteThread,hkernel32,dwRemoteProcessId,hRemoteProcess:integer;
cb,pcb:dword;
pfnStartAddr,pszLibFileName,pszLibFileRemote:pchar;
begin
cb:=100;
GetWindowThreadProcessId(hParent,@dwRemoteProcessId);
hRemoteProcess:=OpenProcess(PROCESS_ALL_ACCESS,FALSE,dwRemoteProcessId);
getmem(pszLibFileName,cb);
strcopy(pszLibFileName,pchar(ExtractFilePath(ParamStr(0))+'\dll02.dll'));
pszLibFileRemote:=VirtualAllocEx(hRemoteProcess,NIL,cb,MEM_COMMIT,PAGE_READWRITE);
WriteProcessMemory(hRemoteProcess,pszLibFileRemote,pszLibFileName,cb,pcb);
Freemem(pszLibFileName);
hkernel32:=GetModuleHandle('Kernel32.dll');
pfnStartAddr:=GetProcAddress(hkernel32,'LoadLibraryA');
hRemoteThread:=CreateRemoteThread(hRemoteProcess,NIL,0,pfnStartAddr,pszLibFileRemote,0,pcb);
WaitForSingleObject(hRemoteThread,INFINITE);
TerminateThread(hRemoteThread,0);
end;
//这是主窗口的消息处理函数
function WindowProc(hWnd,Msg,wParam,lParam:integer):Longint; stdcall;
begin
Result:=DefWindowProc(hWnd,Msg,wParam,lParam);
case Msg of
WM_DESTROY:halt;
WM_TIMER:
begin
GetCursorPos(hPoint);
hParent:=WindowFromPoint(hPoint);
hLong:=GetWindowLong(hParent,GWL_STYLE);
if (hLong and ES_PASSWORD)=ES_PASSWORD then run2;
end;
end;
end;
//
begin
hInst:=GetModuleHandle(nil);
with wClass do
begin
Style:= CS_PARENTDC;
hIcon:= LoadIcon(hInst,'MAINICON');
lpfnWndProc:= @WindowProc;
hInstance:= hInst;
hbrBackground:= COLOR_BTNFACE+1;
lpszClassName:= 'MainHostClass';
hCursor:= LoadCursor(0,IDC_ARROW);
end;
RegisterClass(wClass);
handle:=CreateWindow(wClass.lpszClassName,'http://hotsky.363.net',WS_OVERLAPPEDWINDOW or WS_VISIBLE,80,10,220,85,0,0,hInst,nil);
settimer(handle,0,200,NIL);
while(GetMessage(Msg,Handle,0,0))do
begin
TranslateMessage(Msg);
DispatchMessage(Msg);
end;
end.

{********************************}
Dll2.dpr
{********************************}
library dll02;
uses windows,messages,sysutils;
var
hInst,hParent:thandle;
hPoint:TPOINT;
str:array[0..100] of char;
begin
// hInst:=GetModuleHandle(nil);
GetCursorPos(hPoint);
hParent:=WindowFromPoint(hPoint);
GetWindowText(hParent,str,100);
MessageBox(0,str,pchar('hehe'),0);
FreeLibrary(hinstance);
end.
下载代码方式:https://pan.quark.cn/s/a4b39357ea24 全国计算机等级考试二级教程《Python语言程序设计》(2018年版)被视为针对Python入门者和备考人员的核心学习材料。该资料汇总了教材内的所有编程练习答案,这些答案在Python 3.5.3环境经过实际执行测试,从而保障了代码的准确性和应用价值。备考人员借助这些答案,能够评估自身的学习进度,并深入理解和熟练掌握Python编程的基础原理与方法。 1. Python基础理论:Python作为一门高级编程语言,因其简明扼要的语法结构和卓越的功能表现而备受推崇。基础内容涵盖了变量、数据种类(例如整型、浮点型、字符串、布尔型、列表、元组、字典、集合)、逻辑控制(比如条件判断if-else,循环控制for、while)、函数的声明及使用、模块的引入等。 2. Python高级应用:Python的进阶内容涉及异常管理(try-except-finally结构),类与实例(面向对象编程的基础,包含类的构造、对象的生成、属性与方法的运用、继承机制、多态表现),装饰器(用于调整函数或类的功能特性),上下文管理器(借助with语句实现资源管理)等。 3. 数据文件处理:Python配备了全面的文件操作功能,涉及文件的开启、数据读写、关闭操作,以及多种操作模式(例如r模式用于读取,w模式用于写入,a模式用于追加内容等)。此外,还包括文本文件与二进制文件的转换处理,以及文件的位置调整、复制和删除等操作。 4. 标准库的运用:Python的标准库资源极为丰富,比如os模块提供操作系统接口,sys模块用于获取系统参数,random模块可用于生成随机数值,datetime模块负责处...

1,184

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧