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

Disassembly:
sub esp, 0x578
mov eax, dword [0x4382c4]
xor eax, esp
mov dword [esp + 0x570], eax
push ebp
mov ebp, dword [esp + 0x580]
push esi
mov esi, ecx
cmp ebp, dword [esi + 0x18]
push edi
mov dword [esp + 0x24], str.debug
mov dword [esp + 0x28], str.info
mov dword [esp + 0x2c], str.warn
mov dword [esp + 0x30], 0x42f43c
mov dword [esp + 0x34], str.fatal
jl 0x40a795
cmp ebp, 5
jge 0x40a795
cmp dword [esi + 4], 0
jne 0x40a4d3
push str.CNEM:__IsLogAvailable___
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
pop edi
pop esi
pop ebp
mov ecx, dword [esp + 0x570]
xor ecx, esp
call fcn.0041aec3
add esp, 0x578
ret
push 0xff
lea eax, [esp + 0x7d]
push 0
push eax
mov byte [esp + 0x84], 0
call fcn.00420f50
mov ecx, dword [esi]
and ecx, 1
lea eax, [esi + ecx*4 + 0xc]
add esp, 0xc
cmp dword [eax], 0
jne 0x40a520
push str.NULL__m_pszLogFileName
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
pop edi
pop esi
pop ebp
mov ecx, dword [esp + 0x570]
xor ecx, esp
call fcn.0041aec3
add esp, 0x578
ret
mov edx, dword [eax]
mov eax, edx
lea edi, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x40a527
sub eax, edi
je 0x40a795
push 0x42f39c
push edx
lea edx, [esp + 0x18]
push edx
call fcn.0041c26b
add esp, 0xc
test eax, eax
je 0x40a5a5
mov eax, dword [esi]
mov ecx, eax
and ecx, 1
mov edx, dword [esi + ecx*4 + 0xc]
push edx
push eax
lea eax, [esp + 0x180]
push str.CNEM:m_ulLogFileIndex_:_d_m_pszLogFileName:_s
push eax
mov eax, 0x400
call fcn.0040a7b0
mov esi, dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
add esp, 0x10
lea ecx, [esp + 0x178]
push ecx
call esi
push str.CNEM:_fLogger__fopen
call esi
pop edi
pop esi
pop ebp
mov ecx, dword [esp + 0x570]
xor ecx, esp
call fcn.0041aec3
add esp, 0x578
ret
xor eax, eax
push 0x3f
push eax
lea edx, [esp + 0x41]
push edx
mov word [esp + 0x20], 0
mov dword [esp + 0x22], eax
mov dword [esp + 0x26], eax
mov dword [esp + 0x2a], eax
mov word [esp + 0x2e], ax
mov byte [esp + 0x44], al
call fcn.00420f50
add esp, 0xc
lea eax, [esp + 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
mov ecx, dword [esp + ebp*4 + 0x24]
push ecx
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
movzx edx, word [esp + 0x24]
movzx ecx, word [esp + 0x20]
push eax
movzx eax, word [esp + 0x26]
push edx
movzx edx, word [esp + 0x26]
push eax
movzx eax, word [esp + 0x26]
push ecx
movzx ecx, word [esp + 0x28]
push edx
push eax
push ecx
push str._d__2d__2d__2d:_2d:_2d____lu___s_
lea edx, [esp + 0x5c]
push 0x40
push edx
call fcn.0041af4d
lea eax, [esp + 0x64]
add esp, 0x2c
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x40a630
mov ecx, dword [esp + 0x10]
push ecx
sub eax, edx
push 1
push eax
lea edx, [esp + 0x44]
push edx
call fcn.0041c9b0
mov ecx, dword [esp + 0x59c]
lea eax, [esp + 0x5a0]
push eax
push ecx
call fcn.0041ca92
mov esi, eax
add esi, 1
add esp, 0x18
cmp esi, 0x100
jg 0x40a6c1
mov eax, dword [esp + 0x58c]
lea edx, [esp + 0x590]
push edx
push eax
lea ecx, [esp + 0x80]
push 0x100
push ecx
call fcn.0041b615
lea eax, [esp + 0x88]
add esp, 0x10
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x40a6a1
sub eax, edx
mov edx, dword [esp + 0x10]
push edx
push 1
push eax
lea eax, [esp + 0x84]
push eax
jmp 0x40a76d
cmp esi, 0x400
jge 0x40a731
push esi
call fcn.0041ae22
mov edi, eax
add esp, 4
test edi, edi
je 0x40a724
push esi
push 0
push edi
call fcn.00420f50
mov edx, dword [esp + 0x598]
lea ecx, [esp + 0x59c]
push ecx
push edx
push esi
push edi
call fcn.0041b615
mov eax, edi
add esp, 0x1c
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x40a700
mov ecx, dword [esp + 0x10]
push ecx
sub eax, edx
push 1
push eax
push edi
call fcn.0041c9b0
push edi
call fcn.0041b96e
add esp, 0x14
jmp 0x40a775
push str.writelog_exception:_out_of_memory.
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
jmp 0x40a775
push str.writelog_exception:_buffer_too_small.
lea edx, [esp + 0x7c]
push 0x100
push edx
call fcn.0041aff9
lea eax, [esp + 0x84]
add esp, 0xc
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x40a752
mov ecx, dword [esp + 0x10]
push ecx
sub eax, edx
push 1
push eax
lea edx, [esp + 0x84]
push edx
call fcn.0041c9b0
add esp, 0x10
mov eax, dword [esp + 0x10]
push eax
push 1
push 1
push 0x42f4f0
call fcn.0041c9b0
mov ecx, dword [esp + 0x20]
push ecx
call fcn.0041c32e
add esp, 0x14
mov ecx, dword [esp + 0x57c]
pop edi
pop esi
pop ebp
xor ecx, esp
call fcn.0041aec3
add esp, 0x578
ret