Function at 0x40e420
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x43c
mov eax, dword [0x48a220]
xor eax, esp
mov dword [esp + 0x438], eax
push ebx
mov ebx, ecx
push esi
push edi
lea edi, [ebx + 8]
push edi
call fcn.0040f1a0
add esp, 4
lea eax, [esp + 0x10]
lea esi, [ebx + 0xc]
mov ecx, esi
push eax
call fcn.0040b6c0
mov eax, dword [0x48d6dc]
test eax, eax
je 0x40e489
lea ecx, [esp + 0x10]
push ecx
push dword [ebx + 0xa0]
push dword [ebx + 0xa8]
push dword [ebx + 0xa4]
push dword [ebx]
call eax
add esp, 0x14
test al, al
jne 0x40e5e2
cmp dword [ebx], 2
jl 0x40e4c9
cmp dword [esp + 0x24], 0x10
lea edi, [esp + 0x10]
mov esi, dword [esp + 0x20]
cmovae edi, dword [esp + 0x10]
call fcn.0044c5e8
add eax, 0x40
push eax
push 1
push esi
push edi
call fcn.0044ca0d
call fcn.0044c5e8
add eax, 0x40
push eax
call fcn.0044c777
add esp, 0x14
lea esi, [ebx + 0xc]
lea edi, [ebx + 8]
call fcn.0040e1a0
cmp dword [0x48d6e0], 0
jne 0x40e4e7
push 0xffffffffffffffff
push dword [0x48d6d0]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x40e4f3
push dword [0x48d6d4]
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
call fcn.0040e2b0
test al, al
je 0x40e534
push 2
push 0
push 0
push dword [0x48d6c8]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp dword [esp + 0x24], 0x10
lea ecx, [esp + 0xc]
push 0
push ecx
push dword [esp + 0x28]
lea eax, [esp + 0x1c]
cmovae eax, dword [esp + 0x1c]
push eax
push dword [0x48d6c8]
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [0x48d6e0], 0
jne 0x40e54b
push dword [0x48d6d0]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
jmp 0x40e557
push dword [0x48d6d4]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp dword [ebx], 3
jne 0x40e5e2
mov ecx, 0x400
lea eax, [esp + 0x10]
cmp dword [esp + 0x20], ecx
cmovb ecx, dword [esp + 0x20]
cmp dword [esp + 0x24], 0x10
cmovae eax, dword [esp + 0x10]
test ecx, ecx
je 0x40e58f
push ecx
push eax
lea eax, [esp + 0x48]
push eax
call fcn.00449e60
add esp, 0xc
lea eax, [esp + 0x40]
push eax
call fcn.0041ce40
add esp, 4
cmp dword [0x48d6d8], 0
je 0x40e5d4
lea eax, [esp + 0x28]
mov ecx, esi
push eax
call fcn.0040b6c0
lea eax, [esp + 0x28]
push eax
call dword [0x48d6d8]
add esp, 4
cmp dword [esp + 0x3c], 0x10
jb 0x40e5e2
push dword [esp + 0x28]
call fcn.004491f2
add esp, 4
jmp 0x40e5e2
cmp byte [0x48e7f0], 0
jne 0x40e665
int3
cmp dword [esp + 0x24], 0x10
jb 0x40e5f5
push dword [esp + 0x10]
call fcn.004491f2
add esp, 4
push dword [ebx + 0xac]
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [edi]
lea esi, [edi + 0x50]
mov eax, dword [eax + 4]
mov dword [eax + esi - 0x50], 0x483ed4
mov eax, dword [esi - 0x50]
mov ecx, dword [eax + 4]
lea eax, [ecx - 0x50]
mov dword [ecx + esi - 0x54], eax
lea ecx, [esi - 0x4c]
call fcn.0040a2b0
mov eax, dword [esi - 0x50]
push esi
mov eax, dword [eax + 4]
mov dword [eax + esi - 0x50], 0x47e740
mov eax, dword [esi - 0x50]
mov ecx, dword [eax + 4]
lea eax, [ecx - 8]
mov dword [ecx + esi - 0x54], eax
mov dword [esi], vtable.std::ios_base.0
call fcn.00448d6f
mov ecx, dword [esp + 0x448]
add esp, 4
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00449e44
mov esp, ebp
pop ebp
ret
push 1
call fcn.004495fc
int3