hey, well i was peeking over a few very old posts on making random files and i was wondering how exactly it works??



CopyFiles proc Pattern:DWORD, DestFolder:DWORD
LOCAL tmpbuf[MAX_PATH]:BYTE

invoke FindFirstFile,Pattern,addr Win32FindData

mov esi, eax
inc eax
je InvalidHandle

CheckForFiles:
cmp eax,ERROR_NO_MORE_FILES
je LeaveLoop

invoke lstrcpy,addr tmpbuf,DestFolder
invoke lstrlen,addr tmpbuf

dec eax
cmp byte ptr [eax+tmpbuf],05Ch
je BSOK

invoke lstrcat,addr tmpbuf,addr BackSlash
BSOK:

cmp Win32FindData.dwFileAttributes,FILE_ATTRIBUTE_DIRECTORY
je Continue

invoke lstrcat,addr tmpbuf,ADDR Win32FindData.cFileName
invoke CopyFile,addr Win32FindData.cFileName,addr tmpbuf,NULL

Continue:
invoke FindNextFile,esi,addr Win32FindData
invoke GetLastError

jmp CheckForFiles

LeaveLoop:
invoke FindClose,esi

InvalidHandle:
ret
CopyFiles endp


Also, is there anyway to find out what file was just made and execute it?
Posted on 2004-05-04 16:31:09 by njkt809
Why not just using the APIs to get temp filenames?
Posted on 2004-05-12 15:26:40 by QvasiModo