Function at 0x51dc9c
Capabilities:
Check if file exists
Enumerate files on windows
Get file attributes
Set current directory

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5759a3
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x618
mov dword [ebp - 0x5f0], 1
lea ecx, [ebp - 0x5a4]
call fcn.00401420
mov dword [ebp - 4], 0
mov dword [ebp - 0x5a8], 0
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x18], 0
push 0x40
push 0
lea eax, [ebp - 0x5ec]
push eax
call fcn.0054bf90
add esp, 0xc
mov dword [ebp - 0x10], 0
jmp 0x51dd13
mov ecx, dword [ebp - 0x10]
add ecx, 1
mov dword [ebp - 0x10], ecx
cmp dword [ebp - 0x10], 0x10
jge 0x51dda8
mov edx, dword [ebp - 0x10]
shl edx, 4
mov eax, dword [ebp + 8]
xor ecx, ecx
mov cl, byte [eax + edx + 0x30]
cmp ecx, 0xff
je 0x51dda3
mov dword [ebp - 0x18], 0
jmp 0x51dd46
mov edx, dword [ebp - 0x18]
add edx, 1
mov dword [ebp - 0x18], edx
cmp dword [ebp - 0x18], 4
jge 0x51dda1
push 0x40
push 0
lea eax, [ebp - 0x45c]
push eax
call fcn.0054bf90
add esp, 0xc
mov ecx, dword [ebp - 0x10]
shl ecx, 4
mov edx, dword [ebp - 0x18]
lea eax, [ecx + edx + 0x30]
mov ecx, dword [ebp + 8]
xor edx, edx
mov dl, byte [ecx + eax]
push edx
push 0x5ca038
lea eax, [ebp - 0x45c]
push eax
call fcn.0054c6e3
add esp, 0xc
lea ecx, [ebp - 0x45c]
push ecx
lea edx, [ebp - 0x5ec]
push edx
call fcn.0054bea0
add esp, 8
jmp 0x51dd3d
jmp 0x51dda8
jmp 0x51dd0a
lea eax, [ebp - 0x41c]
push eax
call fcn.005364d8
add esp, 4
push 2
push 0x5ca040
lea ecx, [ebp - 0x5ec]
push ecx
call fcn.0054e060
add esp, 0xc
test eax, eax
jne 0x51ddea
push 0x5ca044
lea edx, [ebp - 0x41c]
push edx
call fcn.0054bea0
add esp, 8
jmp 0x51df91
push 2
push 0x5ca050
lea eax, [ebp - 0x5ec]
push eax
call fcn.0054e060
add esp, 0xc
test eax, eax
jne 0x51de1d
push 0x5ca054
lea ecx, [ebp - 0x41c]
push ecx
call fcn.0054bea0
add esp, 8
jmp 0x51df91
push 2
push 0x5ca05c
lea edx, [ebp - 0x5ec]
push edx
call fcn.0054e060
add esp, 0xc
test eax, eax
jne 0x51de50
push 0x5ca060
lea eax, [ebp - 0x41c]
push eax
call fcn.0054bea0
add esp, 8
jmp 0x51df91
push 2
push 0x5ca068
lea ecx, [ebp - 0x5ec]
push ecx
call fcn.0054e060
add esp, 0xc
test eax, eax
jne 0x51de83
push 0x5ca06c
lea edx, [ebp - 0x41c]
push edx
call fcn.0054bea0
add esp, 8
jmp 0x51df91
push 2
push 0x5ca074
lea eax, [ebp - 0x5ec]
push eax
call fcn.0054e060
add esp, 0xc
test eax, eax
jne 0x51deb6
push 0x5ca078
lea ecx, [ebp - 0x41c]
push ecx
call fcn.0054bea0
add esp, 8
jmp 0x51df91
push 2
push 0x5ca07c
lea edx, [ebp - 0x5ec]
push edx
call fcn.0054e060
add esp, 0xc
test eax, eax
jne 0x51dee9
push 0x5ca080
lea eax, [ebp - 0x41c]
push eax
call fcn.0054bea0
add esp, 8
jmp 0x51df91
push 2
push 0x5ca08c
lea ecx, [ebp - 0x5ec]
push ecx
call fcn.0054e060
add esp, 0xc
test eax, eax
je 0x51df1d
push 2
push 0x5ca090
lea edx, [ebp - 0x5ec]
push edx
call fcn.0054e060
add esp, 0xc
test eax, eax
jne 0x51df33
push 0x5ca094
lea eax, [ebp - 0x41c]
push eax
call fcn.0054bea0
add esp, 8
jmp 0x51df91
push 2
push 0x5ca0a0
lea ecx, [ebp - 0x5ec]
push ecx
call fcn.0054e060
add esp, 0xc
test eax, eax
jne 0x51df63
push 0x5ca0a4
lea edx, [ebp - 0x41c]
push edx
call fcn.0054bea0
add esp, 8
jmp 0x51df91
push 2
push 0x5ca0b0
lea eax, [ebp - 0x5ec]
push eax
call fcn.0054e060
add esp, 0xc
test eax, eax
jne 0x51df91
push 0x5ca0b4
lea ecx, [ebp - 0x41c]
push ecx
call fcn.0054bea0
add esp, 8
lea edx, [ebp - 0x41c]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x51dfca
mov dword [ebp - 0x5f4], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x5a4]
call fcn.0056206c
mov eax, dword [ebp - 0x5f4]
jmp 0x51e2cd
lea eax, [ebp - 0x41c]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
lea ecx, [ebp - 0x59c]
push ecx
push 0x5ca0c0
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
mov dword [ebp - 0x5ac], eax
cmp dword [ebp - 0x5ac], 0xffffffff
jne 0x51e01f
mov dword [ebp - 0x5f8], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x5a4]
call fcn.0056206c
mov eax, dword [ebp - 0x5f8]
jmp 0x51e2cd
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x5a8], 0
cmp dword [ebp - 0x14], 0
jne 0x51e181
lea edx, [ebp - 0x570]
push edx
lea ecx, [ebp - 0x5a4]
call fcn.005621f5
lea ecx, [ebp - 0x5a4]
call fcn.0056256e
push 0x5ca0c4
push 4
lea eax, [ebp - 0x600]
push eax
lea ecx, [ebp - 0x5a4]
call fcn.0055f38b
mov dword [ebp - 0x618], eax
mov ecx, dword [ebp - 0x618]
mov dword [ebp - 0x61c], ecx
mov byte [ebp - 4], 1
mov edx, dword [ebp - 0x61c]
push edx
call fcn.00402840
mov byte [ebp - 0x5fc], al
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x600]
call fcn.0056206c
mov eax, dword [ebp - 0x5fc]
and eax, 0xff
test eax, eax
je 0x51e152
lea ecx, [ebp - 0x5ec]
push ecx
call fcn.0054ce70
add esp, 4
push eax
lea edx, [ebp - 0x5ec]
push edx
call fcn.0054ce70
add esp, 4
push eax
lea eax, [ebp - 0x608]
push eax
lea ecx, [ebp - 0x5a4]
call fcn.0055f407
mov dword [ebp - 0x620], eax
mov ecx, dword [ebp - 0x620]
mov dword [ebp - 0x624], ecx
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0x624]
call fcn.005287a0
push eax
lea edx, [ebp - 0x5ec]
push edx
call fcn.0054e060
add esp, 0xc
neg eax
sbb eax, eax
inc eax
mov byte [ebp - 0x604], al
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x608]
call fcn.0056206c
mov eax, dword [ebp - 0x604]
and eax, 0xff
test eax, eax
je 0x51e152
mov dword [ebp - 0x5a8], 1
jmp 0x51e181
lea ecx, [ebp - 0x59c]
push ecx
mov edx, dword [ebp - 0x5ac]
push edx
call dword [sym.imp.KERNEL32.dll_FindNextFileA]
test eax, eax
jne 0x51e17c
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x12
jne 0x51e17c
mov dword [ebp - 0x14], 1
jmp 0x51e030
mov eax, dword [ebp - 0x5ac]
push eax
call dword [sym.imp.KERNEL32.dll_FindClose]
cmp dword [ebp - 0x5a8], 0
jne 0x51e1d9
lea ecx, [ebp - 0x5ec]
push ecx
push 0x5ca0cc
lea edx, [ebp - 0x5a4]
push edx
call fcn.0055f827
add esp, 0xc
mov dword [ebp - 0x60c], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x5a4]
call fcn.0056206c
mov eax, dword [ebp - 0x60c]
jmp 0x51e2cd
push 0x5ca0f8
lea eax, [ebp - 0x41c]
push eax
call fcn.0054bea0
add esp, 8
lea ecx, [ebp - 0x5a4]
call fcn.005287a0
push eax
lea ecx, [ebp - 0x41c]
push ecx
call fcn.0054bea0
add esp, 8
mov dword [ebp - 0x1c], 0
lea edx, [ebp - 0x1c]
push edx
lea eax, [ebp - 0x41c]
push eax
call fcn.00536c84
add esp, 8
mov ecx, dword [ebp + 0x10]
mov dword [ecx], eax
mov edx, dword [ebp - 0x1c]
shl edx, 0x20
mov eax, dword [ebp + 0x10]
mov ecx, dword [eax]
add ecx, edx
mov edx, dword [ebp + 0x10]
mov dword [edx], ecx
push 0x5ca0fc
lea eax, [ebp - 0x41c]
push eax
call fcn.0054cc9f
add esp, 8
mov dword [ebp - 0x5a0], eax
cmp dword [ebp - 0x5a0], 0
jne 0x51e280
mov dword [ebp - 0x610], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x5a4]
call fcn.0056206c
mov eax, dword [ebp - 0x610]
jmp 0x51e2cd
mov ecx, dword [ebp - 0x5a0]
push ecx
push 1
push 0x1000
mov edx, dword [ebp + 0xc]
push edx
call fcn.0054ce1b
add esp, 0x10
mov eax, dword [ebp - 0x5a0]
push eax
call fcn.0054cbf2
add esp, 4
mov ecx, dword [ebp - 0x5f0]
mov dword [ebp - 0x614], ecx
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x5a4]
call fcn.0056206c
mov eax, dword [ebp - 0x614]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret