首页
社区
课程
招聘
对bpx settimer的困惑
发表于: 2007-4-2 18:00 4746

对bpx settimer的困惑

2007-4-2 18:00
4746
想破解一个软件的两小时限制,很多文章上提到修改timer的初始值来躲避作者对时间的限制
搜索了论坛,看了一些类似问题的解答,但小弟看了还是不是很明白.
0046B7C8    8B40 1C         mov eax,dword ptr ds:[eax+1C]            ;计数器消息的窗口句柄送EAX
0046B7CB    57              push edi                      ;计时器处理程序地址
0046B7CC    68 F4010000     push 1F4                      ;超时值,单位为毫秒.这里的1F4就是500毫秒
0046B7D1    68 4D010000     push 14D                      ;计时器标识符
0046B7D6    50              push eax                      ;用于计数器消息的窗口句柄
0046B7D7    FF15 1C975400   call dword ptr ds:[<&USER32.SetTimer>]            ; USER32.SetTimer

可如果程序是这样
00476F8F    6A 00           push 0
00476F91    56              push esi
00476F92    6A 0A           push 0A
00476F94    52              push edx
00476F95    FF15 1C975400   call dword ptr ds:[<&USER32.SetTimer>]            ; USER32.SetTimer

里面的0A是timer ID,那时间的设置在那里呢?

[课程]FART 脱壳王!加量不加价!FART作者讲授!

收藏
免费 0
支持
分享
最新回复 (7)
雪    币: 846
活跃值: (221)
能力值: (RANK:570 )
在线值:
发帖
回帖
粉丝
2
时间是ESI

参数是一样的,你没搞清楚SETTIMER的用法,建议装一个MSDN,看到不懂的就查找相关说明

计时器处理程序地址为0时,系统每隔一段时间发送一个消息(好象是wm_timer)给程序。

程序可以根据该消息来做相关处理,当然可以包括计时
2007-4-2 20:34
0
雪    币: 206
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
00476F35    51              push ecx
00476F36    52              push edx
00476F37    E8 933E0B00     call Touchvew.0052ADCF
00476F3C    50              push eax
00476F3D    8D4C24 14       lea ecx,dword ptr ss:[esp+14]
00476F41    C68424 C0020000>mov byte ptr ss:[esp+2C0],10
00476F49    E8 253D0B00     call Touchvew.0052AC73
00476F4E    8D4C24 1C       lea ecx,dword ptr ss:[esp+1C]
00476F52    C68424 BC020000>mov byte ptr ss:[esp+2BC],0F
00476F5A    E8 DB3B0B00     call Touchvew.0052AB3A
00476F5F    8B4424 10       mov eax,dword ptr ss:[esp+10]
00476F63    8B1D 84945400   mov ebx,dword ptr ds:[<&KERNEL32.GetPrivateProfil>; kernel32.GetPrivateProfileIntA
00476F69    50              push eax
00476F6A    6A 00           push 0
00476F6C    68 70555800     push Touchvew.00585570                            ; ASCII "basetime"
00476F71    68 68555800     push Touchvew.00585568                            ; ASCII "time"
00476F76    FFD3            call ebx
00476F78    8BF0            mov esi,eax
00476F7A    85F6            test esi,esi
00476F7C    89B5 10430000   mov dword ptr ss:[ebp+4310],esi
00476F82    74 17           je short Touchvew.00476F9B
00476F84    8B4D 1C         mov ecx,dword ptr ss:[ebp+1C]
00476F87    6A 0A           push 0A
00476F89    51              push ecx
00476F8A    FFD7            call edi
00476F8C    8B55 1C         mov edx,dword ptr ss:[ebp+1C]
00476F8F    6A 00           push 0
00476F91    56              push esi
00476F92    6A 0A           push 0A
00476F94    52              push edx
00476F95    FF15 1C975400   call dword ptr ds:[<&USER32.SetTimer>]            ; USER32.SetTimer
00476F9B    8B4424 10       mov eax,dword ptr ss:[esp+10]

这个esi指的是的什么数据呢?如何修改呢?
2007-4-4 13:04
0
雪    币: 206
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
有人吗。。。。。。。
2007-4-5 21:39
0
雪    币: 295
活跃值: (346)
能力值: ( LV9,RANK:530 )
在线值:
发帖
回帖
粉丝
5
The SetTimer function creates a timer with the specified time-out value.

UINT SetTimer(

    HWND hWnd,        // handle of window for timer messages
    UINT nIDEvent,        // timer identifier
    UINT uElapse,        // time-out value
    TIMERPROC lpTimerFunc         // address of timer procedure
   );       

Parameters

hWnd

Identifies the window to be associated with the timer. This window must be owned by the calling thread. If this parameter is NULL, no window is associated with the timer and the nIDEvent parameter is ignored.

nIDEvent

Specifies a nonzero timer identifier. If the hWnd parameter is NULL, this parameter is ignored.

uElapse

Specifies the time-out value, in milliseconds.

lpTimerFunc

Points to the function to be notified when the time-out value elapses. For more information about the function, see TimerProc.
If lpTimerFunc is NULL, the system posts a WM_TIMER message to the application queue. The hwnd member of the message's MSG structure contains the value of the hWnd parameter.

Return Values

If the function succeeds, the return value is an integer identifying the new timer. An application can pass this value, or the string identifier, if it exists, to the KillTimer function to destroy the timer. If the function fails to create a timer, the return value is zero.

Remarks

An application can process WM_TIMER messages by including a WM_TIMER case statement in the window procedure or by specifying a TimerProc callback function when creating the timer. When you specify a TimerProc callback function, the DispatchMessage function simply calls the callback function instead of the window procedure. Therefore, you need to dispatch messages in the calling thread, even when you use TimerProc instead of processing WM_TIMER.

The wParam parameter of the WM_TIMER message contains the value of the nIDEvent parameter.
2007-4-6 01:41
0
雪    币: 206
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
6
谢谢大家给于小弟的帮助,可我还是不会看ESI里面指定的地址还有如何去改这个地址里面的数据呀
2007-4-6 11:08
0
雪    币: 295
活跃值: (346)
能力值: ( LV9,RANK:530 )
在线值:
发帖
回帖
粉丝
7
ESI中不是地址, 是时间值, 对应参数uElapse, 由 下面的 call ebx 得来

00476F76    FFD3            call ebx
00476F78    8BF0            mov esi,eax

0    --- lpTimerFunc
esi  --- uElapse
0A   --- uIDEvent
edx  --- hWnd

00476F8C    8B55 1C         mov edx,dword ptr ss:[ebp+1C]
00476F8F    6A 00           push 0
00476F91    56              push esi
00476F92    6A 0A           push 0A
00476F94    52              push edx
00476F95    FF15 1C975400   call dword ptr ds:[<&USER32.SetTimer>]            ; USER32.SetTimer

在  SetTimer 以后, 每隔一定的时间 (uElapse = esi), 系统将发送WM_TIMER 消息给程序, 消息的hWnd 参数为上面的edx, nIDEvent 为0x0A
2007-4-7 02:44
0
雪    币: 206
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
8
谢谢blackeyes耐心的解答,我再想想
2007-4-7 11:21
0
游客
登录 | 注册 方可回帖
返回
//