首页
社区
课程
招聘
[旧帖] [求助]win32程序。 0.00雪花
发表于: 2011-10-15 18:01 1521

[旧帖] [求助]win32程序。 0.00雪花

2011-10-15 18:01
1521
;>>>程序功能是发现QQ游戏就马上关闭。
.386
.model flat,stdcall
option casemap:none
include windows.inc
include user32.inc
include kernel32.inc
includelib kernel32.lib
includelib user32.lib
.data
ClassCaption db "QQ游戏",0
szCaption db '启动',0
szText db '欢迎你使用',0
szText1 db '腾讯公司系统正在维护',0ah,0dh,'请关闭QQ游戏',0
szText2 db '重要提示',0
.code
_CloseQQgame proc
        pushad
        invoke FindWindow,0,addr ClassCaption
        .if eax != 0
                invoke SendMessage,eax,WM_CLOSE,0,0
                invoke MessageBox,NULL,offset szText1,offset szText2,MB_OK
        .endif
        popad       
        ret

_CloseQQgame endp
start:
        invoke MessageBox,NULL,offset szText,offset szCaption,MB_OK
        invoke SetTimer,0,0,3000,addr _CloseQQgame        ;>>>为什么没有去调用他的回调函数,
        ;.While TRUE       
        ;invoke _CloseQQgame
        ;.endw
        invoke ExitProcess,NULL
end start
问题:为什么这个程序不执行就退出来了,请大牛们指点

[培训]科锐软件逆向54期预科班、正式班开始火爆招生报名啦!!!

收藏
免费 0
支持
分享
最新回复 (4)
雪    币: 1897
活跃值: (1976)
能力值: ( LV12,RANK:230 )
在线值:
发帖
回帖
粉丝
2
木有消息循环,Timer怎么执行啊。
2011-10-15 18:17
0
雪    币: 29
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
难道非要消息循环。。
2011-10-15 19:46
0
雪    币: 288
活跃值: (212)
能力值: ( LV9,RANK:170 )
在线值:
发帖
回帖
粉丝
4
从网上搜的
026K9s2c8@1M7q4)9K6b7g2)9J5c8W2)9J5c8X3u0T1M7#2)9J5k6h3u0U0j5$3&6Q4x3X3g2F1k6i4c8Q4x3V1k6@1K9s2u0W2j5h3c8Q4x3X3b7J5y4o6b7J5x3o6u0Q4x3X3b7I4i4K6u0V1x3g2)9J5k6h3S2@1L8h3H3`.

具体的代码如下:
.386
.model flat,stdcall
option casemap:none
;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
; Include 定义
;────────────────────────────────
include      windows.inc
include       user32.inc
includelib     user32.lib
include       kernel32.inc
includelib     kernel32.lib

;--------------------------------------------------------------------
; 数据段
;--------------------------------------------------------------------
        .data?
;──────────────────────────────────
   
hqqNews        dd    ?   
_count        dd    ?    ;计数

;--------------------------------------------------------------------
;常数定义
;--------------------------------------------------------------------
        .const
;──────────────────────────────────
_dqqNewsWindow    db    'QQ游戏',0  ;窗口标题

;--------------------------------------------------------------------
; 代码段
;--------------------------------------------------------------------
    .code
;--------------------------------------------------------------------
;定时器过程
;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
_Proctime    proc   

        inc _count
        invoke FindWindow, NULL,addr _dqqNewsWindow
        .if eax
            invoke SendMessage, eax,WM_CLOSE,NULL,NULL   
        .endif
        ret
_Proctime    endp

;--------------------------------------------------------------------
;主过程--建立定时器与消息循环
;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
_proc_min    proc   
        local @stMsg : MSG
        
        mov _count,1
        invoke    SetTimer,NULL,NULL,1000,addr _Proctime
        mov hqqNews,eax
        .while    TRUE
            .break    .if _count > 500      ;每次1秒,500约为8分钟后退出程序。
            invoke    GetMessage,addr @stMsg,NULL,0,0
            invoke    TranslateMessage,addr @stMsg
            invoke    DispatchMessage,addr @stMsg
        .endw
        invoke    KillTimer ,NULL,hqqNews
        ret
_proc_min    endp
;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
start:
        call _proc_min
        invoke    ExitProcess,NULL
;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    end    start
2011-10-15 21:15
0
雪    币: 128
活跃值: (116)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
回调函数是在特定的事件或条件发生时由系统调用的,用于对该事件或条件进行响应。
看MSDN
You can process the message by providing a WM_TIMER case in the window procedure. Otherwise, DispatchMessage will call the TimerProc callback function specified in the call to the SetTimer function used to install the timer.

实际上最终是由DispatchMessage ()来调用你的回调函数的。
2011-10-15 22:12
0
游客
登录 | 注册 方可回帖
返回