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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
mov eax, dword [0x44c044]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
push ebx
mov dword [ebp - 0x1c], eax
push esi
mov eax, 0x48e780
push edi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x406891
sub eax, edx
sar eax, 1
cmp eax, 2
jb 0x406b09
push 0
push 0x48e780
call fcn.00422520
add esp, 8
cmp eax, 0xffffffff
jne 0x4068cf
mov ecx, 0x48e780
call fcn.00408090
test eax, eax
je 0x406a66
push 0x208
mov dword [ebp - 0x20], 0
call fcn.004238bf
add esp, 4
push 0x208
mov esi, eax
push 0
push esi
call fcn.00428450
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 0x48cf00
push edx
mov edi, eax
movzx eax, word [ebp - 0x16]
push eax
push ecx
push 0x48e780
push str._s_04u__02u__02u__s.log
push esi
call dword [sym.imp.USER32.dll_wsprintfW]
mov edx, 0x48e988
add esp, 0x1c
mov eax, esi
sub edx, esi
jmp 0x406940
movzx ecx, word [eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x406940
push 0x800
call fcn.004238bf
add esp, 4
push 0x800
mov ebx, eax
push 0
push ebx
call fcn.00428450
add esp, 0xc
lea edx, [ebp - 0x18]
push edx
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
cmp dword [0x48614c], 0
jne 0x4069b0
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 0x4069dd
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 0x44f2f8
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 0x406a2e
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.00421c9a
mov edi, eax
add esp, 8
test edi, edi
jne 0x406a79
push esi
call fcn.00421799
add esp, 4
push ebx
call fcn.00421799
add esp, 4
push 0x44f2f8
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.004217a4
mov esp, ebp
pop ebp
ret
cmp dword [ebp - 0x20], 1
jne 0x406a98
push edi
push 2
lea ecx, [ebp - 0x1c]
push 1
push ecx
mov word [ebp - 0x1c], 0xfeff
call fcn.0042272e
add esp, 0x10
jmp 0x406aa5
push 2
push 0
push edi
call fcn.00422a2b
add esp, 0xc
mov eax, ebx
lea edx, [eax + 2]
lea ebx, [ebx]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x406ab0
sub eax, edx
push edi
sar eax, 1
push eax
push 2
push ebx
call fcn.0042272e
push edi
call fcn.00422b65
add esp, 0x14
push 0x44f2f8
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp dword [0x48cefc], 0
mov dword [0x48614c], 1
je 0x406af7
push ebx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
push ebx
call fcn.00421799
add esp, 4
push esi
call fcn.00421799
add esp, 4
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
mov eax, 1
pop ebx
call fcn.004217a4
mov esp, ebp
pop ebp
ret