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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
mov eax, dword [0x43e044]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
push ebx
mov dword [ebp - 0x20], eax
push esi
mov eax, 0xb5a9e0
push edi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4037b1
sub eax, edx
sar eax, 1
cmp eax, 2
jb 0x4039d7
push 0
push 0xb5a9e0
call fcn.0041ad6e
add esp, 8
cmp eax, 0xffffffff
jne 0x4037ef
mov ecx, 0xb5a9e0
call fcn.004042f0
test eax, eax
je 0x4038cf
push 0x208
mov dword [ebp - 0x1c], 0
call fcn.0041ba5f
add esp, 4
push 0x208
mov esi, eax
push 0
push esi
call fcn.00422210
add esp, 0xc
lea ecx, [ebp - 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
movzx edx, word [ebp - 0x12]
movzx ecx, word [ebp - 0x18]
push 0xb59160
push edx
mov dword [ebp - 0x24], eax
movzx eax, word [ebp - 0x16]
push eax
push ecx
push 0xb5a9e0
push str._s_04u__02u__02u__s.log
push esi
call dword [sym.imp.USER32.dll_wsprintfW]
mov edx, 0xb5abe8
add esp, 0x1c
mov eax, esi
sub edx, esi
lea esp, [esp]
movzx ecx, word [eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x403860
mov edi, dword [sym.imp.KERNEL32.dll_CreateFileW]
push 0
push 0x8000080
push 3
push 0
push 1
push SysReAllocString
push esi
call edi
cmp eax, 0xffffffff
jne 0x4038ab
push 0
push 0x8000080
push 1
push 0
push 1
push SysReAllocString
push esi
call edi
mov dword [ebp - 0x1c], 1
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push str.ab___ccsUNICODE
push esi
call fcn.0041aabe
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x4038e2
push esi
call fcn.0041ae84
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0041a70e
mov esp, ebp
pop ebp
ret
cmp dword [ebp - 0x1c], 1
jne 0x403901
push ebx
push 2
lea edx, [ebp - 0x1c]
push 1
push edx
mov word [ebp - 0x1c], 0xfeff
call fcn.0041be5e
add esp, 0x10
jmp 0x40390e
push 2
push 0
push ebx
call fcn.0041b2d4
add esp, 0xc
push 0x800
call fcn.0041ba5f
add esp, 4
push 0x800
mov edi, eax
push 0
push edi
call fcn.00422210
add esp, 0xc
lea eax, [ebp - 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
cmp dword [0xb543cc], 0
mov ecx, dword [ebp - 0x20]
mov edx, dword [ebp - 0x24]
movzx eax, word [ebp - 0xa]
push ecx
movzx ecx, word [ebp - 0xc]
push edx
movzx edx, word [ebp - 0xe]
push eax
movzx eax, word [ebp - 0x10]
push ecx
movzx ecx, word [ebp - 0x12]
push edx
movzx edx, word [ebp - 0x16]
push eax
movzx eax, word [ebp - 0x18]
push ecx
push edx
push eax
jne 0x403972
push str._r_n_r_n_04u__02u__02u__02u:_02u:_02u__03u__lu_
jmp 0x403977
push str._04u__02u__02u__02u:_02u:_02u__03u__lu_
push edi
call dword [sym.imp.USER32.dll_wsprintfW]
mov eax, edi
add esp, 0x2c
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x403986
sub eax, edx
push ebx
sar eax, 1
push eax
push 2
push edi
call fcn.0041be5e
add esp, 0x10
cmp dword [0xb5915c], 0
mov dword [0xb543cc], 1
je 0x4039bc
push edi
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
push edi
call fcn.0041ae84
add esp, 4
push ebx
call fcn.0041b46b
add esp, 4
push esi
call fcn.0041ae84
add esp, 4
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
mov eax, 1
pop ebx
call fcn.0041a70e
mov esp, ebp
pop ebp
ret