首页
社区
课程
招聘
网上找来的程序,编译通不过
2004-9-7 00:40 3767

网上找来的程序,编译通不过

2004-9-7 00:40
3767
已经做过了整理,还有4个错误,帮忙看一下,谢谢!

.586
.model flat,stdcall
option casemap:none
include windows.inc
include kernel32.inc
include comdlg32.inc
include user32.inc
includelib kernel32.lib
includelib comdlg32.lib
includelib user32.lib

.data
AppName db "Win32 Debug Example no.4",0  
ofn OPENFILENAME <>  
FilterString db "Executable Files",0,"*.exe",0  
             db "All Files",0,"*.*",0,0  
ExitProc db "The debuggee exits",0Dh,0Ah  
         db "Total Instructions executed : %lu",0  
TotalInstruction dd 0

buffer db 512 dup(?)  
startinfo STARTUPINFO <>  
pi PROCESS_INFORMATION <>  
DBEvent DEBUG_EVENT <>  
context CONTEXT <>  

.code  
start:  
mov ofn.lStructSize,SIZEOF ofn  
mov ofn.lpstrFilter, OFFSET FilterString  
mov ofn.lpstrFile, OFFSET buffer  
mov ofn.nMaxFile,512  
mov ofn.Flags, OFN_FILEMUSTEXIST or OFN_PATHMUSTEXIST or OFN_LONGNAMES or OFN_EXPLORER or OFN_HIDEREADONLY  
invoke GetOpenFileName, ADDR ofn  
.if eax==TRUE  
    invoke GetStartupInfo,addr startinfo  
    invoke CreateProcess, addr buffer, NULL, NULL, NULL, FALSE,DEBUG_PROCESS+ DEBUG_ONLY_THIS_PROCESS, NULL, NULL, addr startinfo, addr pi  
    .while TRUE  
       invoke WaitForDebugEvent, addr DBEvent, INFINITE  
       .if DBEvent.dwDebugEventCode==EXIT_PROCESS_DEBUG_EVENT  
          invoke wsprintf, addr buffer, addr ExitProc, TotalInstruction  
          invoke MessageBox, 0, addr buffer, addr AppName,MB_OK+MB_ICONINFORMATION  
          .break  
       .elseif DBEvent.dwDebugEventCode==EXCEPTION_DEBUG_EVENT           
.if
DBEvent.u.Exception.pExceptionRecord.ExceptionCode==EXCEPTION_BREAKPOINT  
             mov context.ContextFlags, CONTEXT_CONTROL  
             invoke GetThreadContext, pi.hThread, addr context or context.regFlag,100h  
             invoke SetThreadContext,pi.hThread, addr context  
             invoke ContinueDebugEvent,DBEvent.dwProcessId,DBEvent.dwThreadId, DBG_CONTINUE  
             .continue  
          .elseif
DBEvent.u.Exception.pExceptionRecord.ExceptionCode==EXCEPTION_SINGLE_STEP  
             inc TotalInstruction  
             invoke GetThreadContext,pi.hThread,addr context or context.regFlag,100h  
             invoke SetThreadContext,pi.hThread, addr context  
             invoke ContinueDebugEvent, DBEvent.dwProcessId,
DBEvent.dwThreadId,DBG_CONTINUE  
             .continue  
          .endif  
       .endif  
       invoke ContinueDebugEvent, DBEvent.dwProcessId, DBEvent.dwThreadId,DBG_EXCEPTION_NOT_HANDLED  
    .endw  
.endif  
invoke CloseHandle,pi.hProcess  
invoke CloseHandle,pi.hThread  
invoke ExitProcess, 0  
end start

[培训]《安卓高级研修班(网课)》月薪三万计划,掌握调试、分析还原ollvm、vmp的方法,定制art虚拟机自动化脱壳的方法

收藏
免费 1
打赏
分享
最新回复 (1)
雪    币: 241
活跃值: (21)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
hying 2004-9-7 10:15
2
0
代码好象没有错误.
invoke GetThreadContext, pi.hThread, addr context or context.regFlag,100h  
这应该是2行
invoke GetThreadContext, pi.hThread, addr context
or context.regFlag,100h  
下面还有一处.
我用MASM8编译能通过.
游客
登录 | 注册 方可回帖
返回