首页
社区
课程
招聘
用CreateProcess启动ASProtect加密的软件后,发现有些块没有装载
发表于: 2004-4-26 10:41 8276

用CreateProcess启动ASProtect加密的软件后,发现有些块没有装载

2004-4-26 10:41
8276
壳是ASProtect1.1 MTE,PE头中记录的EOP是72001(壳的入口,不是原程序的).查看它的块表,确是有1个72000的块,这个块名字是.data,工具在块上还加了个"EP"的说明,我不知何意.
我带CREATE_SUSPENDED标志调用CreateProcess函数将它启动,程序启动后被挂着.然后用ReadProcessMemory想从472001处读入8字节代码,这时函数调用失败,再用VirtualQueryEx分析4720001这个地址,发现这个地址所在块居然没有分配,是MEM_FREE状态.但用调试工具确实会将472001做为开始地址中断.
这种EP块具体是怎么回事,哪位指点一下

[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)

收藏
免费 6
支持
分享
最新回复 (7)
雪    币: 279
活跃值: (375)
能力值: ( LV9,RANK:250 )
在线值:
发帖
回帖
粉丝
2
EP是指程序入口。由于加壳软件会模拟PE装载器对文件进行载入,所以你去读40**处地址时,可能还未有数据
2004-4-26 13:19
0
雪    币: 217
活跃值: (70)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
但这个块里就是壳的代码啊.程序最一开始就得到这运行的.而且是在PE文件中可以看出来的一个块,应该属于自动加载的块.我不明白用CreateProcess后这一块怎么会不加载,那马上我一ResumeThread主线程就要运行这里的代码了,它又如何马上加载上这代码呢?
2004-4-26 14:31
0
雪    币: 217
活跃值: (70)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
再做了些实验,发现这个块应该是加载了的,只是对ReadProcessMemory,VirtualQureyEx之类的函数做了防范.这应该就是所谓的防内存读写功能吧.不知如何改掉它
2004-4-26 14:44
0
雪    币: 217
活跃值: (70)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
我想应该是壳通过SEH技术在后来加载此块吧.但啥代码都没运行,就能设置SEH处理功能吗?不太懂
2004-4-26 16:46
0
雪    币: 279
活跃值: (375)
能力值: ( LV9,RANK:250 )
在线值:
发帖
回帖
粉丝
6
AsprDbgr.>CALL AsprDbgr.0040100C
00401005  PUSH 0                                                  ; /ExitCode = 0
00401007  CALL <JMP.&kernel32.ExitProcess>                        ; \ExitProcess
0040100C  PUSH AsprDbgr.00404000                                  ; /Arg1 = 00404000 ASCII "AsprDbgr v1.0beta (:P) Made by me... Manko.

"
00401011  CALL AsprDbgr.00402ED0                                  ; \AsprDbgr.00402ED0
00401016  MOV DWORD PTR DS:[404030],4C
00401020  MOV DWORD PTR DS:[40403C],AsprDbgr.00404180             ;  ASCII "Any files"
0040102A  MOV DWORD PTR DS:[40404C],AsprDbgr.0040407C
00401034  MOV DWORD PTR DS:[404050],104
0040103E  MOV DWORD PTR DS:[404064],281804
00401048  PUSH AsprDbgr.00404030                                  ; /pOpenFileName = AsprDbgr.00404030
0040104D  CALL <JMP.&comdlg32.GetOpenFileNameA>                   ; \GetOpenFileNameA
00401052  MOV EAX,DWORD PTR DS:[40404C]
00401057  MOV EAX,DWORD PTR DS:[EAX]
00401059  TEST EAX,EAX
0040105B  JE AsprDbgr.00402E3E
00401061  PUSH AsprDbgr.004041D3                                  ; /pStartupinfo = AsprDbgr.004041D3
00401066  CALL <JMP.&kernel32.GetStartupInfoA>                    ; \GetStartupInfoA
0040106B  PUSH AsprDbgr.00404217                                  ; /pProcessInfo = AsprDbgr.00404217
00401070  PUSH AsprDbgr.004041D3                                  ; |pStartupInfo = AsprDbgr.004041D3
00401075  PUSH 0                                                  ; |CurrentDir = NULL
00401077  PUSH 0                                                  ; |pEnvironment = NULL
00401079  PUSH 3                                                  ; |CreationFlags = DEBUG_PROCESS|DEBUG_ONLY_THIS_PROCESS
0040107B  PUSH 0                                                  ; |InheritHandles = FALSE
0040107D  PUSH 0                                                  ; |pThreadSecurity = NULL
0040107F  PUSH 0                                                  ; |pProcessSecurity = NULL
00401081  PUSH 0                                                  ; |CommandLine = NULL
00401083  PUSH AsprDbgr.0040407C                                  ; |ModuleFileName = ""
00401088  CALL <JMP.&kernel32.CreateProcessA>                     ; \CreateProcessA
0040108D  TEST EAX,EAX
0040108F  JE AsprDbgr.00402E3E
00401095  PUSH -1                                                 ; /Timeout = INFINITE
00401097  PUSH AsprDbgr.0040432C                                  ; |pDebugEvent = AsprDbgr.0040432C
0040109C  CALL <JMP.&kernel32.WaitForDebugEvent>                  ; \WaitForDebugEvent
004010A1  CMP DWORD PTR DS:[40432C],5
004010A8  JE AsprDbgr.00402E08
004010AE  CMP DWORD PTR DS:[40432C],3
004010B5  JE SHORT AsprDbgr.004010BC
004010B7  JMP AsprDbgr.00401141
004010BC  MOV EAX,DWORD PTR DS:[404354]
004010C1  MOV DWORD PTR DS:[404664],EAX
004010C6  PUSH 0                                                  ; /pBytesRead = NULL
004010C8  PUSH 1                                                  ; |BytesToRead = 1
004010CA  PUSH AsprDbgr.00404668                                  ; |Buffer = AsprDbgr.00404668
004010CF  PUSH DWORD PTR DS:[404664]                              ; |pBaseAddress = 0
004010D5  PUSH DWORD PTR DS:[404217]                              ; |hProcess = NULL
004010DB  CALL <JMP.&kernel32.ReadProcessMemory>                  ; \ReadProcessMemory
004010E0  MOV EAX,DWORD PTR DS:[404344]
004010E5  MOV DWORD PTR DS:[404669],EAX
004010EA  PUSH AsprDbgr.004046E4                                  ; /pOldProtect = AsprDbgr.004046E4
004010EF  PUSH 40                                                 ; |NewProtect = PAGE_EXECUTE_READWRITE
004010F1  PUSH 1                                                  ; |Size = 1
004010F3  PUSH DWORD PTR DS:[404664]                              ; |Address = NULL
004010F9  PUSH DWORD PTR DS:[404217]                              ; |hProcess = NULL
004010FF  CALL <JMP.&kernel32.VirtualProtectEx>                   ; \VirtualProtectEx
00401104  PUSH 0                                                  ; /pBytesWritten = NULL
00401106  PUSH 1                                                  ; |BytesToWrite = 1
00401108  PUSH AsprDbgr.0040466D                                  ; |Buffer = AsprDbgr.0040466D
0040110D  PUSH DWORD PTR DS:[404664]                              ; |Address = 0
00401113  PUSH DWORD PTR DS:[404217]                              ; |hProcess = NULL
00401119  CALL <JMP.&kernel32.WriteProcessMemory>                 ; \WriteProcessMemory
0040111E  PUSH AsprDbgr.004046E4                                  ; /pOldProtect = AsprDbgr.004046E4
00401123  PUSH DWORD PTR DS:[4046E4]                              ; |NewProtect = 0
00401129  PUSH 1                                                  ; |Size = 1
0040112B  PUSH DWORD PTR DS:[404664]                              ; |Address = NULL
00401131  PUSH DWORD PTR DS:[404217]                              ; |hProcess = NULL
00401137  CALL <JMP.&kernel32.VirtualProtectEx>                   ; \VirtualProtectEx
0040113C  JMP AsprDbgr.00402689
00401141  CMP DWORD PTR DS:[40432C],1
00401148  JNZ AsprDbgr.00402689
0040114E  CMP DWORD PTR DS:[404338],C0000005
00401158  JNZ AsprDbgr.0040122C
0040115E  CMP DWORD PTR DS:[4047C8],1
00401165  JE SHORT AsprDbgr.004011AA
00401167  CMP BYTE PTR DS:[404A33],0
0040116E  JE AsprDbgr.0040122C
00401174  MOV EAX,DWORD PTR DS:[404338]
00401179  MOV EBX,DWORD PTR DS:[404344]
0040117F  CMP EBX,0
00401182  JE AsprDbgr.0040122C
00401188  PUSH EBX                                                ; /<%lX> => 0
00401189  PUSH AsprDbgr.00404A08                                  ; |Format = "  Access Violation caused at adress: %lX
"
0040118E  PUSH AsprDbgr.00404227                                  ; |s = AsprDbgr.00404227
00401193  CALL <JMP.&user32.wsprintfA>                            ; \wsprintfA
00401198  ADD ESP,0C
0040119B  PUSH AsprDbgr.00404227                                  ; /Arg1 = 00404227
004011A0  CALL AsprDbgr.00402ED0                                  ; \AsprDbgr.00402ED0
004011A5  JMP AsprDbgr.0040122C
004011AA  MOV EAX,DWORD PTR DS:[404344]
004011AF  ADD EAX,2
004011B2  MOV DWORD PTR DS:[4047CC],EAX
004011B7  PUSH 0                                                  ; /pBytesRead = NULL
004011B9  PUSH 1                                                  ; |BytesToRead = 1
004011BB  PUSH AsprDbgr.004047D0                                  ; |Buffer = AsprDbgr.004047D0
004011C0  PUSH DWORD PTR DS:[4047CC]                              ; |pBaseAddress = 0
004011C6  PUSH DWORD PTR DS:[404217]                              ; |hProcess = NULL
004011CC  CALL <JMP.&kernel32.ReadProcessMemory>                  ; \ReadProcessMemory
004011D1  CMP BYTE PTR DS:[4047D0],0EB
004011D8  JE SHORT AsprDbgr.0040122C
004011DA  PUSH AsprDbgr.004046E4                                  ; /pOldProtect = AsprDbgr.004046E4
004011DF  PUSH 40                                                 ; |NewProtect = PAGE_EXECUTE_READWRITE
004011E1  PUSH 1                                                  ; |Size = 1



给你看一下这段代码
2004-4-26 18:03
0
雪    币: 217
活跃值: (70)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
7
能给介绍一下代码的运行背景吗?在PE文件的什么地方,何时运行,什么运行机制etc
2004-4-27 09:45
0
雪    币: 279
活跃值: (375)
能力值: ( LV9,RANK:250 )
在线值:
发帖
回帖
粉丝
8
这是AsprDbgr v1.0beta (:P) Made by me... Manko.的一段代码,你自己逆向一下吧
2004-4-27 12:40
0
游客
登录 | 注册 方可回帖
返回
//