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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x834
mov eax, dword [0x42e00c]
xor eax, esp
mov dword [esp + 0x830], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov dword [esp + 8], eax
mov eax, dword [ebp + 0xc]
push edi
mov dword [esp + 0x14], eax
mov eax, dword [ebp + 0x14]
push 0x800
mov dword [esp + 0x14], eax
lea eax, [esp + 0x3c]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
mov dword [esp + 0x18], 0
lea eax, [esp + 0x28]
xor esi, esi
lea ebx, [esp + 0x38]
push eax
call dword [sym.imp.api_ms_win_crt_time_l1_1_0.dll__ftime64]
add esp, 4
lea eax, [esp + 0x28]
push eax
call dword [sym.imp.api_ms_win_crt_time_l1_1_0.dll__localtime64]
add esp, 4
mov edi, eax
test byte [0x42e128], 1
je 0x40415a
mov eax, dword [esp + 0xc]
shl eax, 4
add eax, str.FATAL
push eax
mov eax, ebx
push str.____5s_
push eax
call fcn.00404080
add esp, 0xc
mov esi, eax
test byte [0x42e128], 2
je 0x40418a
push dword [edi + 0xc]
mov eax, dword [edi + 0x10]
inc eax
push eax
mov eax, dword [edi + 0x14]
add eax, 0x76c
push eax
lea eax, [esp + 0x44]
add eax, esi
push str._04d__02d__02d
push eax
call fcn.00404080
add esp, 0x14
add esi, eax
test byte [0x42e128], 4
je 0x4041b7
movzx eax, word [esp + 0x30]
push eax
push dword [edi]
lea eax, [esp + 0x40]
push dword [edi + 4]
add eax, esi
push dword [edi + 8]
push str._02d:_02d:_02d:_03d
push eax
call fcn.00404080
add esp, 0x18
add esi, eax
cmp byte [0x42ed74], 0
je 0x4041db
push 0x42ed74
lea eax, [esp + 0x3c]
add eax, esi
push 0x429e84
push eax
call fcn.00404080
add esp, 0xc
add esi, eax
test byte [0x42e128], 0x20
je 0x40420a
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessId]
push eax
lea eax, [esp + 0x40]
add eax, esi
push str.pid_d_tid_d
push eax
call fcn.00404080
add esp, 0x10
add esi, eax
test byte [0x42e128], 8
je 0x404230
push dword [ebp + 0x10]
lea eax, [esp + 0x3c]
push dword [esp + 0x18]
add eax, esi
push str._s__d_
push eax
call fcn.00404080
add esp, 0x10
add esi, eax
test byte [0x42e128], 0x10
je 0x404253
push dword [esp + 0x10]
lea eax, [esp + 0x3c]
add eax, esi
push str.__s_
push eax
call fcn.00404080
add esp, 0xc
add esi, eax
call fcn.004010d0
mov ecx, eax
lea eax, [ebp + 0x1c]
push eax
push 0
push dword [ebp + 0x18]
mov eax, dword [ecx]
push 0
push 0
push dword [ecx + 4]
or eax, 2
mov dword [esp + 0x34], ecx
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___stdio_common_vsprintf]
mov edi, eax
add esp, 0x1c
or eax, 0xffffffff
test edi, edi
cmovs edi, eax
mov eax, 0x7fe
sub eax, esi
cmp edi, eax
jle 0x4042cc
xor ecx, ecx
lea eax, [edi + 2]
add eax, esi
add eax, 1
setb cl
neg ecx
or ecx, eax
push ecx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
lea edx, [esp + 0x3c]
add esp, 4
mov ecx, edx
mov ebx, eax
sub eax, ecx
mov cl, byte [edx]
lea edx, [edx + 1]
mov byte [eax + edx - 1], cl
test cl, cl
jne 0x4042b7
mov dword [esp + 0x18], 1
lea eax, [ebp + 0x1c]
push eax
push 0
push dword [ebp + 0x18]
lea eax, [edi + 1]
push eax
lea ecx, [esi + ebx]
push ecx
mov dword [esp + 0x34], ecx
mov ecx, dword [esp + 0x30]
mov eax, dword [ecx]
push dword [ecx + 4]
or eax, 2
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___stdio_common_vsprintf]
mov eax, dword [0x42eb30]
add esi, edi
mov edi, dword [esp + 0x28]
add esp, 0x1c
test eax, eax
je 0x404320
push dword [esp + 0x20]
push dword [esp + 0x14]
push dword [ebp + 0x10]
push dword [esp + 0x20]
push 0x42ed74
push edi
call eax
add esp, 0x18
mov eax, dword [0x42e12c]
mov word [esi + ebx], 0xa
test al, 4
je 0x40433b
push ebx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, dword [0x42e12c]
test al, 3
je 0x404475
test al, 1
je 0x4043a5
mov eax, 7
cmp edi, 5
ja case.0x404351.3
jmp dword [edi*4 + 0x40449c]
mov eax, 4
jmp case.0x404351.3
mov eax, 6
jmp case.0x404351.3
mov eax, 5
jmp case.0x404351.3
mov eax, 1
mov edi, dword [sym.imp.KERNEL32.dll_GetStdHandle]
or eax, 8
push eax
push 0xfffffffffffffff5
call edi
mov esi, dword [sym.imp.KERNEL32.dll_SetConsoleTextAttribute]
push eax
call esi
push ebx
push 0x429c3c
call fcn.004010e0
add esp, 8
push 7
push 0xfffffffffffffff5
call edi
push eax
call esi
mov eax, dword [0x42e12c]
test al, 2
je 0x404475
push 0
call dword [sym.imp.api_ms_win_crt_time_l1_1_0.dll__time64]
add esp, 4
mov dword [esp + 0x20], eax
lea eax, [esp + 0x20]
mov dword [esp + 0x24], edx
push eax
call dword [sym.imp.api_ms_win_crt_time_l1_1_0.dll__localtime64]
mov esi, eax
add esp, 4
mov edx, dword [esi + 0x14]
cmp dword [0x42ec60], edx
jne 0x4043f1
mov ecx, dword [0x42ec5c]
cmp ecx, dword [esi + 0x10]
jne 0x4043f1
mov ecx, dword [0x42ec58]
cmp ecx, dword [esi + 0xc]
je 0x404439
push dword [esi + 0xc]
mov eax, dword [esi + 0x10]
inc eax
push eax
lea eax, [edx + 0x76c]
push eax
push 0x42ec70
push str.C:ProgramData
push str._s_log__s__04d_02d_02d.log
push 0x42eb48
call fcn.00404080
movups xmm0, xmmword [esi]
add esp, 0x1c
movups xmmword [0x42ec4c], xmm0
movups xmm0, xmmword [esi + 0x10]
movups xmmword [0x42ec5c], xmm0
mov eax, dword [esi + 0x20]
mov dword [0x42ec6c], eax
push 0x429e4c
push 0x42eb48
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
mov esi, eax
add esp, 8
test esi, esi
je 0x404475
mov ecx, ebx
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x404457
push esi
sub ecx, edx
push 1
push ecx
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
push esi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 0x14
cmp dword [esp + 0x18], 0
je 0x404486
push ebx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
mov ecx, dword [esp + 0x83c]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0040ce19
mov esp, ebp
pop ebp
ret