ich wei?? das es überhaupt nicht hier hin gehört, aber in assembly ist es fast genauso gr0??:
@@:
;------------------------+
; Search for st0ph |
;________________________|
lea eax, root
invoke SetCurrentDirectoryA, eax
call find_files
jmp exit0
find_files:
invoke FindFirstFileA, ADDR fmask, ADDR W32_FIND_DATA
cmp eax, INVALID_HANDLE_VALUE
je find_ret
mov handleA, eax
handle_result:
mov ebx, W32_FIND_DATA.WIN32_FIND_DATA.dwFileAttributes
and ebx, FILE_ATTRIBUTE_DIRECTORY
cmp ebx, FILE_ATTRIBUTE_DIRECTORY
jne is_file
cmp byte ptr[W32_FIND_DATA.WIN32_FIND_DATA.cFileName], '.'
je find_next ; if so, continue the run
push handleA ; store search handle on stack
lea eax, W32_FIND_DATA
add eax, WIN32_FIND_DATA.cFileName ; pass file name
push eax
call SetCurrentDirectoryA
cmp eax, 1h
je search_dir
pop eax ; removing saved search handle
find_next:
invoke FindNextFile, handleA, ADDR W32_FIND_DATA
cmp eax, 0
jne handle_result
find_exit:
invoke FindClose, handleA
find_ret:
ret
search_dir:
call find_files
pop handleA ; removing saved search handle
lea esi, dots
invoke SetCurrentDirectoryA, esi
jmp find_next
is_file:
lea esi, W32_FIND_DATA
add esi, WIN32_FIND_DATA.cFileName
invoke lstrlenA, esi
mov eax, dword ptr[esi+eax-4] ; load file extension into eax
pushad
; hier den kram mit der datei, bzw. datierweiterung machen....
popad
jmp find_next