Function at 0x40e2b0
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 0x4284d0
mov eax, dword fs:[0]
push eax
sub esp, 0x60
mov eax, dword [0x436024]
xor eax, esp
mov dword [esp + 0x58], eax
push ebx
push esi
push edi
mov eax, dword [0x436024]
xor eax, esp
push eax
lea eax, [esp + 0x70]
mov dword fs:[0], eax
xor ebx, ebx
mov edi, ecx
mov esi, edx
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x20], ebx
mov dword [esp + 0x24], ebx
mov dword [esp + 0x78], ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], ebx
mov dword [esp + 0x34], ebx
lea eax, [esp + 0x18]
push eax
lea ecx, [esp + 0x2c]
mov byte [esp + 0x7c], 1
call fcn.00415910
add esp, 4
test eax, eax
je 0x40e591
mov eax, dword [esp + 0x1c]
cmp eax, ebx
je 0x40e591
mov ecx, dword [esp + 0x20]
sub ecx, eax
sar ecx, 2
je 0x40e591
push 0x42ec68
push edi
call dword [sym.imp.MSVCR80.dll__wfopen]
mov esi, eax
add esp, 8
cmp esi, ebx
mov dword [esp + 0x38], esi
jne 0x40e372
lea esi, [esp + 0x28]
call fcn.00406530
lea esi, [esp + 0x18]
call fcn.00406530
jmp 0x40e5f5
push 2
push ebx
push esi
call dword [sym.imp.MSVCR80.dll_fseek]
add esp, 0xc
push esi
call dword [sym.imp.MSVCR80.dll_ftell]
add esp, 4
cmp eax, ebx
jne 0x40e3af
push esi
push 1
lea edx, [esp + 0x1c]
push 3
push edx
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 + 0x4c]
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 + 0x78], 2
mov eax, dword [esp + 0x1c]
cmp eax, dword [esp + 0x20]
mov dword [esp + 0x44], esi
mov dword [esp + 0x40], 1
mov dword [esp + 0x48], ebx
mov esi, eax
jbe 0x40e3e4
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x20]
cmp eax, ecx
mov edi, esi
mov dword [esp + 0x3c], ecx
jbe 0x40e400
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
jmp 0x40e400
cmp edi, dword [esp + 0x3c]
je 0x40e507
cmp edi, dword [esp + 0x20]
jb 0x40e416
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov eax, dword [edi]
sub eax, 0x10
call fcn.00406e20
add eax, 0x10
mov dword [esp + 0x14], eax
lea eax, [esp + 0x14]
push eax
mov byte [esp + 0x7c], 3
call fcn.00405f60
mov esi, dword [esp + 0x14]
cmp dword [esi - 0xc], 3
jl 0x40e4c8
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40e4c8
cmp dword [esi - 4], 1
jle 0x40e46b
mov ecx, dword [esi - 0xc]
push ecx
lea edx, [esp + 0x18]
push edx
call fcn.00401780
mov esi, dword [esp + 0x14]
lea eax, [esp + 0x28]
push eax
lea ecx, [esp + 0x44]
push ecx
push 0x40ded0
push 1
push 1
push esi
call fcn.0040d8a0
add esp, 0x18
cmp esi, ebx
jne 0x40e48f
xor eax, eax
jmp 0x40e4a5
mov eax, esi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x40e494
sub eax, edx
sar eax, 1
js 0x40e4fd
cmp eax, dword [esi - 8]
jg 0x40e4fd
mov dword [esi - 0xc], eax
mov word [esi + eax*2], bx
lea eax, [esi - 0x10]
mov byte [esp + 0x78], 2
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jmp 0x40e4dd
lea eax, [esi - 0x10]
mov byte [esp + 0x78], 2
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40e4e9
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
cmp edi, dword [esp + 0x20]
jb 0x40e4f5
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
add edi, 4
jmp 0x40e400
push 0x80070057
call fcn.004018a0
mov edi, dword [esp + 0x38]
mov esi, dword [sym.imp.MSVCR80.dll_fprintf]
push str._r_n_________________________________________r_n
push edi
call esi
mov ecx, dword [esp + 0x50]
push ecx
push str.Total_Files:__d
push edi
call esi
add esp, 0x14
push edi
call dword [sym.imp.MSVCR80.dll_fclose]
add esp, 4
lea ecx, [esp + 0x4c]
mov byte [esp + 0x78], 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_]
mov eax, dword [esp + 0x2c]
cmp eax, ebx
je 0x40e560
mov edi, dword [esp + 0x30]
call fcn.004072f0
mov edx, dword [esp + 0x2c]
push edx
call sub.MSVCR80.dll_void___cdecl_operator_delete_void__
add esp, 4
mov eax, dword [esp + 0x1c]
cmp eax, ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], ebx
mov dword [esp + 0x34], ebx
je 0x40e58a
mov edi, dword [esp + 0x20]
call fcn.004072f0
mov eax, dword [esp + 0x1c]
push eax
call sub.MSVCR80.dll_void___cdecl_operator_delete_void__
add esp, 4
mov eax, 1
jmp 0x40e5f7
cmp esi, ebx
jne 0x40e59a
mov esi, 0x42e550
push esi
push str.log_file_md5_fail._get_md5_fail__s
push 0x42d70c
call fcn.00419910
mov eax, dword [esp + 0x38]
add esp, 0xc
cmp eax, ebx
je 0x40e5cb
mov edi, dword [esp + 0x30]
call fcn.004072f0
mov ecx, dword [esp + 0x2c]
push ecx
call sub.MSVCR80.dll_void___cdecl_operator_delete_void__
add esp, 4
mov eax, dword [esp + 0x1c]
cmp eax, ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], ebx
mov dword [esp + 0x34], ebx
je 0x40e5f5
mov edi, dword [esp + 0x20]
call fcn.004072f0
mov edx, dword [esp + 0x1c]
push edx
call sub.MSVCR80.dll_void___cdecl_operator_delete_void__
add esp, 4
xor eax, eax
mov ecx, dword [esp + 0x70]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x58]
xor ecx, esp
call fcn.0042575e
mov esp, ebp
pop ebp
ret