Function at 0x409bcd
Capabilities:
Check if file exists
Resolve function by parsing pe exports
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x41bd60
mov eax, dword fs:[0]
push eax
sub esp, 0x68
mov eax, dword [0x429024]
xor eax, esp
mov dword [esp + 0x60], eax
push ebx
push esi
push edi
mov eax, dword [0x429024]
xor eax, esp
push eax
lea eax, [esp + 0x78]
mov dword fs:[0], eax
xor edi, edi
mov ebx, ecx
mov esi, edx
mov dword [esp + 0x1c], edi
mov dword [esp + 0x20], edi
mov dword [esp + 0x24], edi
mov dword [esp + 0x80], edi
mov dword [esp + 0x38], edi
mov dword [esp + 0x3c], edi
mov dword [esp + 0x40], edi
push esi
lea eax, [esp + 0x38]
push eax
lea eax, [esp + 0x20]
push eax
mov byte [esp + 0x8c], 1
call fcn.0040f121
add esp, 0xc
test eax, eax
je 0x409e1f
cmp dword [esp + 0x1c], edi
je 0x409e1f
mov eax, dword [esp + 0x20]
sub eax, dword [esp + 0x1c]
sar eax, 2
je 0x409e1f
push 0x422930
push ebx
call dword [sym.imp.MSVCR80.dll__wfopen]
mov ebx, eax
cmp ebx, edi
pop ecx
pop ecx
mov dword [esp + 0x28], ebx
je 0x409e3b
push 2
push edi
push ebx
call dword [sym.imp.MSVCR80.dll_fseek]
add esp, 0xc
push ebx
call dword [sym.imp.MSVCR80.dll_ftell]
cmp eax, edi
pop ecx
jne 0x409cbe
push ebx
push 1
lea eax, [esp + 0x1c]
push 3
push eax
mov byte [esp + 0x24], 0xef
mov byte [esp + 0x25], 0xbb
mov byte [esp + 0x26], 0xbf
call dword [sym.imp.MSVCR80.dll_fwrite]
add esp, 0x10
lea ecx, [esp + 0x54]
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::constructor_void_]
mov byte [esp + 0x80], 2
mov esi, dword [esp + 0x1c]
cmp esi, dword [esp + 0x20]
mov dword [esp + 0x48], 1
mov dword [esp + 0x50], edi
mov dword [esp + 0x4c], ebx
jbe 0x409cf0
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov eax, dword [esp + 0x20]
cmp dword [esp + 0x1c], eax
mov dword [esp + 0x30], esi
mov dword [esp + 0x44], eax
jbe 0x409d08
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov esi, dword [esp + 0x30]
cmp esi, dword [esp + 0x44]
je 0x409dd1
cmp esi, dword [esp + 0x20]
jb 0x409d22
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov eax, dword [esi]
sub eax, 0x10
call fcn.00404f08
add eax, 0x10
mov dword [esp + 0x14], eax
lea ebx, [esp + 0x14]
mov byte [esp + 0x80], 3
call fcn.0040467c
mov esi, dword [esp + 0x14]
cmp dword [esi - 0xc], 3
jl 0x409da3
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x409da3
cmp dword [esi - 4], 1
jle 0x409d6e
push dword [esi - 0xc]
mov eax, ebx
push eax
call fcn.004015ba
mov esi, dword [esp + 0x14]
lea eax, [esp + 0x34]
push eax
lea eax, [esp + 0x4c]
push eax
push 0x409883
push 1
push 1
push esi
call fcn.00409456
add esp, 0x18
cmp esi, edi
jne 0x409d92
xor eax, eax
jmp 0x409d9a
push esi
call dword [sym.imp.MSVCR80.dll_wcslen]
pop ecx
lea edx, [esp + 0x14]
call fcn.004014c5
lea eax, [esi - 0x10]
mov byte [esp + 0x80], 2
call fcn.004016a2
mov eax, dword [esp + 0x30]
cmp eax, dword [esp + 0x20]
jb 0x409dc3
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
add dword [esp + 0x30], 4
mov ebx, dword [esp + 0x28]
jmp 0x409d08
mov esi, dword [sym.imp.MSVCR80.dll_fprintf]
push str._r_n_________________________________________r_n
push ebx
call esi
push dword [esp + 0x58]
push str.Total_Files:__d
push ebx
call esi
add esp, 0x14
push ebx
call dword [sym.imp.MSVCR80.dll_fclose]
pop ecx
lea ecx, [esp + 0x54]
mov byte [esp + 0x80], 1
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
lea esi, [esp + 0x34]
call fcn.0040497b
lea esi, [esp + 0x18]
call fcn.0040497b
xor eax, eax
inc eax
jmp 0x409e4f
cmp esi, edi
jne 0x409e28
mov esi, 0x4221c8
push esi
push str.log_file_md5_fail._get_md5_fail__s
push 0x421388
call fcn.0041209a
add esp, 0xc
lea esi, [esp + 0x34]
call fcn.0040497b
lea esi, [esp + 0x18]
call fcn.0040497b
xor eax, eax
mov ecx, dword [esp + 0x78]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x60]
xor ecx, esp
call fcn.00419804
mov esp, ebp
pop ebp
ret