首页
社区
课程
招聘
[原创]病毒技术之搜索(一)
2010-5-19 09:52 6750

[原创]病毒技术之搜索(一)

2010-5-19 09:52
6750
;这个没意思,先热热身,主要是看下一个。
;made by correy
;Email:leguanyuan@163.com
;QQ:112426112
;rc me.rc
;ml /coff test.asm /link /subsystem:windows me.res
.386
.model flat,stdcall
option casemap:none
include windows.inc
include kernel32.inc
include user32.inc
includelib user32.lib
includelib kernel32.lib

.data
correy db "made by correy",0
filename db "*",0
found WIN32_FIND_DATA <>
d db "c:",92,0

.data?
buffer db 256 dup(?)
hfindfile dd ?

.code

searchfile proc lpszPath
local stFindFile:WIN32_FIND_DATA
local hFindFile
local szPath[260]:byte
local szSearch[260]:byte
local szFindFile[260]:byte
pushad
invoke lstrcpy,addr szPath,lpszPath
invoke lstrlen,addr szPath
lea esi,szPath
add esi,eax

cmp byte ptr [esi-1],92
je next
mov word ptr [esi],0092
next:

invoke lstrcpy,addr szSearch,addr szPath
invoke lstrlen,addr szSearch
lea esi,szSearch
add esi,eax
mov word ptr [esi],0042

invoke FindFirstFile,addr szSearch,addr stFindFile
cmp eax,0
je exit
mov hFindFile,eax

begin:
invoke lstrcpy,addr szFindFile,addr szPath
invoke lstrcat,addr szFindFile,addr stFindFile.cFileName

test stFindFile.dwFileAttributes,10h ;test dword ptr stFindFile,10h
je processfile
cmp stFindFile.cFileName,46
je findfile
invoke searchfile,addr szFindFile
jmp findfile

processfile:
invoke MessageBox,0,addr szFindFile,addr correy,0
invoke MessageBox,0,addr stFindFile.cFileName,addr correy,0
findfile:
invoke FindNextFile,hFindFile,addr stFindFile

cmp eax,0
jne begin

invoke FindClose,hFindFile
exit:
popad
ret
searchfile endp

start:

invoke searchfile,addr d

invoke FindFirstFile,addr filename,addr found
.if   eax != INVALID_HANDLE_VALUE
    mov hfindfile,eax
    begin:
    mov eax,offset found
    add eax,sizeof WIN32_FIND_DATA
    sub eax,274
    invoke MessageBox,0,eax,addr correy,0
    invoke FindNextFile,hfindfile,addr found
    cmp eax,0
    jne begin
    invoke FindClose,hfindfile
.endif

ret
end start

[CTF入门培训]顶尖高校博士及硕士团队亲授《30小时教你玩转CTF》,视频+靶场+题目!助力进入CTF世界

收藏
点赞6
打赏
分享
最新回复 (4)
雪    币: 284
活跃值: (42)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
zhxhong 2010-5-19 11:49
2
0
vvvvvvvvvvvv
雪    币: 679
活跃值: (3960)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
kagayaki 2010-5-22 05:30
3
0
现在我看到的大多是注入了....
雪    币: 411
活跃值: (46)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
cuixzuo 2010-5-22 06:24
4
0
学习了lstrcat。不错。
雪    币: 577
活跃值: (168)
能力值: ( LV6,RANK:90 )
在线值:
发帖
回帖
粉丝
金罡 1 2010-5-22 08:45
5
0
怎么一听病毒木马之类的就那么多人关注
游客
登录 | 注册 方可回帖
返回