Function at 0x50a5e0
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xa94
mov eax, dword [0x601018]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
mov ebx, dword [ebp + 0xc]
push esi
mov esi, ecx
xor ecx, ecx
push edi
mov dword [ebp - 0xa8c], esi
mov edi, edx
mov dword [ebp - 0xa90], eax
mov byte [ebx + 0x408], 0
mov byte [ebx], 0
mov dword [ebx + 0x400], ecx
mov dword [ebx + 0x404], ecx
cmp eax, ecx
je 0x50a6bc
mov eax, dword [esi + 0x40]
cmp eax, 0xffffffff
je 0x50a639
call fcn.0050aa00
push 0x400
lea eax, [ebp - 0x808]
push 0
push eax
call sub.MSVCR100.dll_memset
push 0x400
lea ecx, [ebp - 0x408]
push 0
push ecx
call sub.MSVCR100.dll_memset
add esp, 0x18
test edi, edi
jne 0x50a6d1
lea edx, [ebp - 0x408]
push 0x400
push edx
call dword [sym.imp.MSVCR100.dll__getcwd]
add esp, 8
test eax, eax
jne 0x50a6e7
push str.unable_to_get_currect_directory_while_finding_files
mov eax, 0x13d95
lea ecx, [ebp - 0xa88]
call fcn.005064b0
mov esi, eax
call dword [sym.imp.MSVCR100.dll__errno]
mov eax, dword [eax]
push eax
push str.errno
push str._s___d_
call fcn.00506600
add esp, 0xc
lea esi, [ebp - 0xa88]
call fcn.00506520
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00596083
mov esp, ebp
pop ebp
ret 8
push 0x3ff
lea eax, [ebp - 0x408]
push edi
push eax
call dword [sym.imp.MSVCR100.dll_strncpy]
add esp, 0xc
lea eax, [ebp - 0x408]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x50a6f0
sub eax, edx
test eax, eax
jle 0x50a710
cmp byte [ebp + eax - 0x409], 0x5c
lea eax, [ebp + eax - 0x409]
jne 0x50a710
mov byte [eax], cl
mov ecx, dword [ebp - 0xa90]
push ecx
lea edx, [ebp - 0x408]
push edx
lea eax, [ebp - 0x808]
push str._s_s
push eax
call dword [sym.imp.MSVCR100.dll_sprintf]
lea eax, [ebp - 0x408]
add esp, 0x10
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x50a740
sub eax, edx
mov edi, eax
add esi, 0x20
lea eax, [ebp - 0x408]
call fcn.00402fe0
mov eax, dword [ebp - 0xa90]
mov ecx, eax
lea esi, [ecx + 1]
mov dl, byte [ecx]
inc ecx
test dl, dl
jne 0x50a764
sub ecx, esi
mov esi, dword [ebp - 0xa8c]
add esi, 4
mov edi, ecx
call fcn.00402fe0
lea ecx, [ebp - 0x948]
push ecx
lea edx, [ebp - 0x808]
push edx
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
mov edi, eax
cmp edi, 0xffffffff
jne 0x50a848
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0xa90], eax
cmp eax, 2
je 0x50a826
cmp eax, 3
je 0x50a826
push str.unable_to_get_first_file_while_finding_files
mov eax, 0x13d96
lea ecx, [ebp - 0xa88]
call fcn.005064b0
mov ecx, 0x10
mov ebx, eax
cmp dword [esi + 0x14], ecx
jb 0x50a7d7
mov edi, dword [esi]
jmp 0x50a7d9
mov edi, esi
mov eax, dword [ebp - 0xa8c]
add eax, 0x20
cmp dword [eax + 0x14], ecx
jb 0x50a7e9
mov eax, dword [eax]
push eax
push str.directory
push str._s___s_
mov esi, ebx
call fcn.00506600
push edi
push str.filename
push str._s___s_
call fcn.00506600
mov edi, dword [ebp - 0xa90]
add esp, 0x18
mov ecx, ebx
call fcn.005067d0
lea esi, [ebp - 0xa88]
call fcn.00506520
mov eax, dword [ebp - 0xa8c]
mov dword [eax + 0x40], 0xffffffff
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00596083
mov esp, ebp
pop ebp
ret 8
mov ecx, dword [ebp - 0xa8c]
lea eax, [ebp - 0x91c]
mov dword [ecx + 0x40], edi
mov edx, ebx
mov ecx, eax
sub edx, ecx
lea ecx, [ecx]
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x50a860
mov edx, dword [ebp - 0x92c]
xor esi, esi
mov eax, edx
mov edx, esi
mov cl, 0x20
call fcn.00596f60
mov ecx, dword [ebp - 0x948]
mov dword [ebx + 0x400], eax
mov eax, dword [ebp - 0x928]
or dword [ebx + 0x400], eax
shr ecx, 4
and cl, 1
mov byte [ebx + 0x408], cl
mov ecx, dword [ebp - 4]
mov dword [ebx + 0x404], edx
or dword [ebx + 0x404], esi
mov eax, edi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00596083
mov esp, ebp
pop ebp
ret 8