hey, well i was peeking over a few very old posts on making random files and i was wondering how exactly it works??
Also, is there anyway to find out what file was just made and execute it?
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?
Why not just using the APIs to get temp filenames?