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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
mov eax, dword [0x446044]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
push ebx
mov dword [ebp - 0x1c], eax
push esi
mov eax, 0xc9fb70
push edi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x403981
sub eax, edx
sar eax, 1
cmp eax, 2
jb 0x403bf9
push 0
push 0xc9fb70
call fcn.0041ee1e
add esp, 8
cmp eax, 0xffffffff
jne 0x4039bf
mov ecx, 0xc9fb70
call fcn.00405200
test eax, eax
je 0x403b56
push 0x208
mov dword [ebp - 0x20], 0
call fcn.0041fb0f
add esp, 4
push 0x208
mov esi, eax
push 0
push esi
call fcn.00426670
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 0xc9e2f0
push edx
mov edi, eax
movzx eax, word [ebp - 0x16]
push eax
push ecx
push 0xc9fb70
push str._s_04u__02u__02u__s.log
push esi
call dword [sym.imp.USER32.dll_wsprintfW]
mov edx, 0xc9fd78
add esp, 0x1c
mov eax, esi
sub edx, esi
jmp 0x403a30
movzx ecx, word [eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x403a30
push 0x800
call fcn.0041fb0f
add esp, 4
push 0x800
mov ebx, eax
push 0
push ebx
call fcn.00426670
add esp, 0xc
lea edx, [ebp - 0x18]
push edx
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
cmp dword [0xc97514], 0
jne 0x403aa0
mov eax, dword [ebp - 0x1c]
movzx ecx, word [ebp - 0xa]
movzx edx, word [ebp - 0xc]
push eax
movzx eax, word [ebp - 0xe]
push edi
push ecx
movzx ecx, word [ebp - 0x10]
push edx
movzx edx, word [ebp - 0x12]
push eax
movzx eax, word [ebp - 0x16]
push ecx
movzx ecx, word [ebp - 0x18]
push edx
push eax
push ecx
push str._r_n_r_n_04u__02u__02u__02u:_02u:_02u__03u__lu_
jmp 0x403acd
mov edx, dword [ebp - 0x1c]
movzx eax, word [ebp - 0xa]
movzx ecx, word [ebp - 0xc]
push edx
movzx edx, word [ebp - 0xe]
push edi
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
push str._04u__02u__02u__02u:_02u:_02u__03u__lu_
push ebx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x2c
push 0xc606c0
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
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 0x403b1e
push 0
push 0x8000080
push 1
push 0
push 1
push SysReAllocString
push esi
call edi
mov dword [ebp - 0x20], 1
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push str.ab___ccsUNICODE
push esi
call fcn.0041eb6e
mov edi, eax
add esp, 8
test edi, edi
jne 0x403b69
push esi
call fcn.0041ef34
add esp, 4
push ebx
call fcn.0041ef34
add esp, 4
push 0xc606c0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0041e7be
mov esp, ebp
pop ebp
ret
cmp dword [ebp - 0x20], 1
jne 0x403b88
push edi
push 2
lea ecx, [ebp - 0x1c]
push 1
push ecx
mov word [ebp - 0x1c], 0xfeff
call fcn.0041ff0e
add esp, 0x10
jmp 0x403b95
push 2
push 0
push edi
call fcn.0041f384
add esp, 0xc
mov eax, ebx
lea edx, [eax + 2]
lea ebx, [ebx]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x403ba0
sub eax, edx
push edi
sar eax, 1
push eax
push 2
push ebx
call fcn.0041ff0e
push edi
call fcn.0041f51b
add esp, 0x14
push 0xc606c0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp dword [0xc9e2ec], 0
mov dword [0xc97514], 1
je 0x403be7
push ebx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
push ebx
call fcn.0041ef34
add esp, 4
push esi
call fcn.0041ef34
add esp, 4
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
mov eax, 1
pop ebx
call fcn.0041e7be
mov esp, ebp
pop ebp
ret