Function at 0x40aff3
Capabilities:
Check if file exists
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x4219ec
mov eax, dword fs:[0]
push eax
sub esp, 0x68
mov eax, dword [0x433024]
xor eax, esp
mov dword [esp + 0x60], eax
push ebx
push esi
push edi
mov eax, dword [0x433024]
xor eax, esp
push eax
lea eax, [esp + 0x78]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
mov ebx, ecx
push ebx
push eax
push 0x428de4
mov esi, 0x4274c0
push esi
mov dword [esp + 0x24], eax
call fcn.004151bb
xor edi, edi
mov dword [esp + 0x2c], edi
mov dword [esp + 0x30], edi
mov dword [esp + 0x34], edi
mov dword [esp + 0x90], edi
mov dword [esp + 0x48], edi
mov dword [esp + 0x4c], edi
mov dword [esp + 0x50], edi
push ebx
lea eax, [esp + 0x48]
push eax
lea eax, [esp + 0x30]
push eax
mov byte [esp + 0x9c], 1
call fcn.004120c9
add esp, 0x1c
test eax, eax
je 0x40b25f
cmp dword [esp + 0x1c], edi
je 0x40b25f
mov eax, dword [esp + 0x20]
sub eax, dword [esp + 0x1c]
sar eax, 2
je 0x40b25f
push 0x428e64
push dword [esp + 0x18]
call dword [sym.imp.MSVCR80.dll__wfopen]
mov ebx, eax
cmp ebx, edi
pop ecx
pop ecx
mov dword [esp + 0x28], ebx
jne 0x40b0cd
push dword [esp + 0x14]
push str.open_file___s__failed
jmp 0x40b26e
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 0x40b108
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 0x40b13a
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 0x40b152
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov esi, dword [esp + 0x30]
cmp esi, dword [esp + 0x44]
je 0x40b211
cmp esi, dword [esp + 0x20]
jb 0x40b16c
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov eax, dword [esi]
sub eax, 0x10
call fcn.00405332
add eax, 0x10
mov dword [esp + 0x14], eax
lea ebx, [esp + 0x14]
mov byte [esp + 0x80], 3
call fcn.00404922
mov esi, dword [esp + 0x14]
cmp dword [esi - 0xc], 3
jl 0x40b1e3
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40b1e3
lea eax, [esp + 0x34]
push eax
lea eax, [esp + 0x4c]
push eax
push 0x40aca9
push 1
push 1
mov esi, ebx
call fcn.00404a9e
push eax
call fcn.0040a886
mov esi, dword [esp + 0x2c]
add esp, 0x18
cmp esi, edi
jne 0x40b1d2
xor eax, eax
jmp 0x40b1da
push esi
call dword [sym.imp.MSVCR80.dll_wcslen]
pop ecx
lea edx, [esp + 0x14]
call fcn.004014bc
lea eax, [esi - 0x10]
mov byte [esp + 0x80], 2
call fcn.004016a4
mov eax, dword [esp + 0x30]
cmp eax, dword [esp + 0x20]
jb 0x40b203
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
add dword [esp + 0x30], 4
mov ebx, dword [esp + 0x28]
jmp 0x40b152
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.00404d42
lea esi, [esp + 0x18]
call fcn.00404d42
xor eax, eax
inc eax
jmp 0x40b28b
cmp ebx, edi
jne 0x40b268
mov ebx, 0x428548
push ebx
push str.LogFilesMd5ToFile_failed__MD5_s
push esi
call fcn.004151bb
add esp, 0xc
lea esi, [esp + 0x34]
call fcn.00404d42
lea esi, [esp + 0x18]
call fcn.00404d42
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.0041ec06
mov esp, ebp
pop ebp
ret 4