麻痹,估计是我人品问题,道德不好,我首先FindFirstFile成功,然后删除windows目录下的1.txt代码:
.386
.model flat, stdcall
option casemap :none
include windows.inc
include user32.inc
includelib user32.lib
include kernel32.inc
includelib kernel32.lib
.data
FileNamePattern db "C:\WINDOWS\1.txt",0
.code
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
FillFileInfo proc uses edi
LOCAL finddata:WIN32_FIND_DATA
LOCAL hFindFile:DWORD
invoke FindFirstFile,addr FileNamePattern,addr finddata
.if eax!=INVALID_HANDLE_VALUE
mov hFindFile,eax
invoke DeleteFile,addr FileNamePattern
invoke FindClose,hFindFile
.endif
ret
FillFileInfo endp
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
start:
call FillFileInfo
invoke ExitProcess,NULL
end start
现在在windows目录下建几个txt试验,想一起删除它们,代码:
.386
.model flat, stdcall
option casemap :none
include windows.inc
include user32.inc
includelib user32.lib
include kernel32.inc
includelib kernel32.lib
.data
FileNamePattern db "C:\WINDOWS\*.txt",0
.code
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
FillFileInfo proc uses edi
LOCAL finddata:WIN32_FIND_DATA
LOCAL hFindFile:DWORD
invoke FindFirstFile,addr FileNamePattern,addr finddata
.if eax!=INVALID_HANDLE_VALUE
mov hFindFile,eax
.repeat
invoke DeleteFile,addr FileNamePattern
invoke FindNextFile,hFindFile,addr finddata
.until eax == FALSE
invoke FindClose,hFindFile
.endif
ret
FillFileInfo endp
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
start:
call FillFileInfo
invoke ExitProcess,NULL
end start
编译执行后一看windows目录,傻眼了,都该乖乖躺在那里呢。。。
请朋友们支招
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)