Function at 0x410380
Capabilities:
Print debug messages
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x440
mov eax, dword [0x4d2f14]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov esi, ecx
push 0xa
lea ecx, [esi + 8]
call fcn.0040f8f0
lea ecx, [esi + 8]
call fcn.00401a90
lea eax, [ebp - 0x420]
push eax
lea ecx, [esi + 0xc]
call fcn.0040bd10
mov eax, dword [0x4d4504]
test eax, eax
je 0x410403
mov edx, dword [esi + 0xa0]
lea ecx, [ebp - 0x420]
push ecx
mov ecx, dword [esi + 0xa8]
push edx
mov edx, dword [esi + 0xa4]
push ecx
mov ecx, dword [esi]
push edx
push ecx
call eax
add esp, 0x14
test al, al
je 0x410403
cmp dword [ebp - 0x40c], 0x10
jb 0x410617
mov edx, dword [ebp - 0x420]
push edx
jmp 0x41060f
mov eax, dword [section..data]
cmp eax, 2
je 0x410419
cmp eax, 3
je 0x410419
cmp dword [esi], 2
jl 0x41046f
jmp 0x410435
cmp dword [ebp - 0x40c], 0x10
mov eax, dword [ebp - 0x420]
jae 0x41042e
lea eax, [ebp - 0x420]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
cmp dword [ebp - 0x40c], 0x10
mov eax, dword [ebp - 0x420]
jae 0x41044a
lea eax, [ebp - 0x420]
push eax
push 0x494884
call fcn.00470137
add eax, 0x40
push eax
call fcn.00472188
call fcn.00470137
add eax, 0x40
push eax
call fcn.00470476
add esp, 0x10
push 0
push 0
call fcn.00410150
mov eax, dword [section..data]
add esp, 8
test eax, eax
je 0x410526
cmp eax, 2
je 0x410526
cmp dword [0x4d4510], 0
jne 0x4104aa
mov eax, dword [0x4d4514]
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x4104b5
mov ecx, dword [0x4d450c]
call fcn.00413e80
call fcn.004102c0
test al, al
je 0x410504
mov ecx, dword [0x4d44f4]
push 2
push 0
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp dword [ebp - 0x40c], 0x10
mov eax, dword [ebp - 0x420]
jae 0x4104e6
lea eax, [ebp - 0x420]
mov ecx, dword [ebp - 0x410]
push 0
lea edx, [ebp - 0x440]
push edx
mov edx, dword [0x4d44f4]
push ecx
push eax
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [0x4d4510], 0
jne 0x41051b
mov eax, dword [0x4d4514]
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
jmp 0x410526
mov ecx, dword [0x4d450c]
call fcn.00413e90
mov eax, dword [esi]
cmp eax, 4
jne 0x4105a7
mov ecx, dword [ebp - 0x410]
mov eax, 0x400
cmp ecx, eax
jae 0x41053e
mov eax, ecx
cmp dword [ebp - 0x40c], 0x10
mov ecx, dword [ebp - 0x420]
jae 0x410553
lea ecx, [ebp - 0x420]
push eax
push ecx
lea ecx, [ebp - 0x404]
push ecx
call fcn.0046f1f0
lea edx, [ebp - 0x404]
push edx
call fcn.0041c1c0
add esp, 0x10
call fcn.0041c170
test al, al
je 0x410580
call fcn.0041c180
jmp 0x4105ff
cmp dword [0x4d44fc], 0
je 0x410579
lea eax, [ebp - 0x43c]
push eax
lea ecx, [esi + 0xc]
call fcn.0040bd10
lea ecx, [ebp - 0x43c]
push ecx
call dword [0x4d44fc]
jmp 0x4105e4
cmp eax, 3
jne 0x4105ff
cmp dword [0x4d4500], 0
lea eax, [ebp - 0x43c]
lea ecx, [esi + 0xc]
push eax
je 0x4105d3
call fcn.0040bd10
lea ecx, [ebp - 0x43c]
push ecx
call dword [0x4d4500]
jmp 0x4105e4
call fcn.0040bd10
lea ecx, [ebp - 0x43c]
push ecx
call fcn.0040f590
add esp, 4
cmp dword [ebp - 0x428], 0x10
jb 0x4105ff
mov edx, dword [ebp - 0x43c]
push edx
call fcn.0046f1de
add esp, 4
cmp dword [ebp - 0x40c], 0x10
jb 0x410617
mov eax, dword [ebp - 0x420]
push eax
call fcn.0046f1de
add esp, 4
mov ecx, dword [esi + 0xac]
push ecx
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov edx, dword [esi + 8]
mov eax, dword [edx + 4]
add esi, 0x58
mov dword [eax + esi - 0x50], 0x4923e4
lea ecx, [esi - 0x4c]
mov dword [esi - 0x4c], 0x4923a8
call fcn.0040aa50
lea ecx, [esi - 0x4c]
call fcn.0040ad50
mov ecx, dword [esi - 0x50]
mov edx, dword [ecx + 4]
mov dword [edx + esi - 0x50], 0x4c6588
push esi
mov dword [esi], vtable.std::ios_base.0
call fcn.0046e926
mov ecx, dword [ebp - 4]
add esp, 4
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0046fb84
mov esp, ebp
pop ebp
ret