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

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x4c
mov edi, ecx
call fcn.00564085
mov eax, dword [eax]
mov dword [ebp - 0x3c], eax
call fcn.00564085
xor esi, esi
mov dword [eax], esi
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x38], eax
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [edi + 0x3c]
test al, 0x10
mov dword [ebp - 0x10], edi
je 0x40835d
mov eax, dword [edi + 0x24]
mov ebx, dword [edi + 0x38]
cmp ebx, eax
jae 0x40806b
mov dword [edi + 0x38], eax
mov ebx, eax
mov esi, dword [edi + 0x20]
sub ebx, esi
js 0x408318
cmp ebx, 0x7ffffff8
jae 0x408327
cmp ebx, 0xa
ja 0x4082e9
lea eax, [ebp - 0x20]
mov byte [eax + 0xb], bl
lea edi, [eax + ebx]
cmp eax, esi
ja 0x4080a0
cmp edi, esi
ja 0x408311
test ebx, ebx
je 0x4080af
push ebx
push esi
push eax
call fcn.00568550
add esp, 0xc
mov eax, dword [ebp - 0x10]
lea esi, [eax + 8]
mov byte [edi], 0
movsx eax, byte [ebp - 0x15]
test eax, eax
jns 0x4080c3
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x30], eax
jns 0x4080d3
push dword [ebp - 0x20]
call fcn.00564050
add esp, 4
mov eax, dword [esi]
mov eax, dword [eax + 4]
mov ebx, dword [esi + eax + 0x1c]
cmp ebx, 0x64ad98
jne 0x40832f
mov dword [ebp - 0x34], esi
mov dword [ebp - 0x54], 0x64b444
mov eax, dword [0x64b444]
cmp eax, 0xffffffff
jne 0x4083d7
mov eax, dword [0x64b448]
lea edx, [eax - 1]
mov ecx, dword [ebx + 8]
mov esi, dword [ebx + 0xc]
sub esi, ecx
sar esi, 2
cmp esi, edx
jbe 0x40830c
mov edi, dword [ecx + eax*4 - 4]
test edi, edi
je 0x40830c
mov eax, dword [edi]
mov esi, dword [eax + 0x1c]
mov ecx, esi
call dword [0x6401dc]
mov ecx, edi
push 0xa
call esi
cmp ebx, 0x64ad98
jne 0x4083ab
movsx eax, al
mov esi, dword [ebp - 0x34]
mov ecx, esi
push eax
call fcn.004086a0
mov ecx, esi
call fcn.00408550
xor eax, eax
dec eax
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x24], eax
mov ecx, dword [ebp - 0x10]
mov eax, dword [ecx + 0x3c]
test al, 0x10
je 0x408378
mov eax, dword [ecx + 0x24]
mov ebx, dword [ecx + 0x38]
cmp ebx, eax
jae 0x408184
mov dword [ecx + 0x38], eax
mov ebx, eax
mov esi, dword [ecx + 0x20]
sub ebx, esi
js 0x408318
cmp ebx, 0x7ffffff8
jae 0x408338
cmp ebx, 0xa
ja 0x4082c6
lea eax, [ebp - 0x2c]
mov byte [eax + 0xb], bl
lea edi, [eax + ebx]
cmp eax, esi
ja 0x4081b9
cmp edi, esi
ja 0x408311
test ebx, ebx
je 0x4081c8
push ebx
push esi
push eax
call fcn.00568550
add esp, 0xc
mov byte [edi], 0
lea eax, [ebp - 0x20]
lea ebx, [ebp - 0x2c]
lea esi, [ebp - 0x54]
mov ecx, esi
push eax
push 0xffffffffffffffff
mov edi, dword [ebp - 0x10]
push dword [edi + 0x90]
push ebx
call fcn.005419a0
mov eax, dword [edi + 0x94]
mov ecx, dword [edi + 0x98]
mov dword [ebp - 0x48], ecx
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x40], 0x57
mov al, byte [0x64b4a3]
test al, al
jne 0x408439
cmp byte [ebp - 0x49], 0
jns 0x40821f
push dword [ebp - 0x54]
call fcn.00564050
add esp, 4
cmp dword [edi + 4], 3
je 0x408469
mov eax, dword [0x6480b4]
test al, 2
jne 0x408340
test al, 4
jne 0x408247
test eax, 0xfffffffa
jne 0x408288
cmp dword [edi + 4], 2
jl 0x408288
lea esi, [ebp - 0x2c]
movsx ebx, byte [esi + 0xb]
test ebx, ebx
cmovs ebx, dword [esi + 4]
cmovs esi, dword [esi]
test ebx, ebx
je 0x408288
xor edi, edi
mov eax, ebx
sub eax, edi
lea ecx, [esi + edi]
push eax
push ecx
push 2
call fcn.005659de
add esp, 0xc
test eax, eax
setns cl
add edi, eax
cmp edi, ebx
setb al
test cl, al
jne 0x40825d
mov eax, dword [0x6480b4]
mov edi, dword [ebp - 0x10]
test al, 1
jne 0x4083fc
cmp dword [edi + 4], 3
je 0x408395
cmp byte [ebp - 0x21], 0
jns 0x4082ab
push dword [ebp - 0x2c]
call fcn.00564050
add esp, 4
push dword [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_SetLastError]
call fcn.00564085
mov ecx, dword [ebp - 0x3c]
mov dword [eax], ecx
add esp, 0x4c
pop esi
pop edi
pop ebx
pop ebp
ret
mov edi, ebx
or edi, 7
inc edi
push edi
call fcn.00564055
add esp, 4
mov dword [ebp - 0x2c], eax
or edi, 0x80000000
mov dword [ebp - 0x24], edi
mov dword [ebp - 0x28], ebx
jmp 0x4081aa
mov edi, ebx
or edi, 7
inc edi
push edi
call fcn.00564055
add esp, 4
mov dword [ebp - 0x20], eax
or edi, 0x80000000
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x1c], ebx
jmp 0x408091
call fcn.005912b0
push str....._third_partylibc_srcinclude__stringchar_traits.h:145:_assertion__std::__is_pointer_in_range___s1____s1____n____s2__failed:_char_traits::copy:_source_and_destination_ranges_overlap_n
jmp 0x40831d
push str....._third_partylibc_srcinclude_string_view:330:_assertion____end_____begin____0_failed:_std::string_view::string_view_iterator__sentinel__received_invalid_range_n
push 0x624e92
call fcn.005912b0
lea ecx, [ebp - 0x20]
call fcn.00591860
lock inc dword [ebx + 4]
jmp 0x4080e8
lea ecx, [ebp - 0x2c]
call fcn.00591860
cmp byte [ebp - 0x21], 0
jns 0x408349
mov ebx, dword [ebp - 0x2c]
push ebx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, dword [0x6480b4]
mov edi, dword [ebp - 0x10]
jmp 0x408236
mov ebx, 0
test al, 8
je 0x40808b
mov eax, dword [ebp - 0x10]
mov esi, dword [eax + 0x14]
mov ebx, dword [eax + 0x1c]
jmp 0x40806e
xor esi, esi
mov ebx, 0
test al, 8
je 0x4081a4
mov eax, dword [ebp - 0x10]
mov esi, dword [eax + 0x14]
mov ebx, dword [eax + 0x1c]
jmp 0x408187
lea eax, [ebp - 0x2c]
mov ecx, edi
mov edx, dword [ebp - 0x30]
push eax
call fcn.005baf40
add esp, 4
jmp 0x40829a
xor ecx, ecx
dec ecx
lock xadd dword [ebx + 4], ecx
test ecx, ecx
jne 0x408146
mov ecx, dword [ebx]
mov esi, dword [ecx + 4]
mov byte [ebp - 0x11], al
mov ecx, esi
call dword [0x6401dc]
mov ecx, ebx
call esi
mov al, byte [ebp - 0x11]
jmp 0x408146
lea eax, [ebp - 0x54]
lea ecx, [ebp - 0x20]
mov dword [ecx], eax
lea eax, [ebp - 0x2c]
mov dword [eax], ecx
push 0x4f0410
push eax
push 0x64b444
call fcn.0040bcf0
add esp, 0xc
jmp 0x408100
call fcn.005babd0
test al, al
je 0x408290
lea eax, [ebp - 0x2c]
movsx ecx, byte [eax + 0xb]
test ecx, ecx
cmovs ecx, dword [eax + 4]
mov dword [ebp - 0x20], 0xffffffff
cmovs eax, dword [eax]
push 0
lea edx, [ebp - 0x20]
push edx
push ecx
push eax
push dword [0x64c794]
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x408290
movzx ecx, al
lea eax, [ebp - 0x44]
mov dword [ebp - 0x20], eax
lea eax, [ebp - 0x48]
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], esi
lea eax, [ebp - 0x58]
mov dword [eax], str.LogMessage
lea edx, [ebp - 0x40]
lea esi, [ebp - 0x20]
push esi
push eax
call fcn.005bb2f0
add esp, 8
jmp 0x40820e
cmp byte [0x64c7b8], 0
jne 0x408229
mov byte [0x64c7b8], 1
mov eax, dword [0x64c7c0]
mov ecx, dword [0x64984c]
mov edx, dword fs:[0x2c]
mov ecx, dword [edx + ecx*4]
cmp eax, dword [ecx + 4]
jg 0x40850a
mov ecx, dword [ebp - 0x10]
lea esi, [ebp - 0x20]
push esi
call fcn.005bae90
movsx eax, byte [ebp - 0x15]
mov ecx, esi
test eax, eax
jns 0x4084b6
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x20]
test eax, eax
js 0x4084f6
sete dl
test ecx, ecx
setne dh
or dh, dl
je 0x408500
push eax
push ecx
push dword [0x64c7bc]
call fcn.00406fe0
add esp, 0xc
cmp byte [ebp - 0x15], 0
jns 0x4084e7
push dword [ebp - 0x20]
call fcn.00564050
add esp, 4
mov byte [0x64c7b8], 0
mov edi, dword [ebp - 0x10]
jmp 0x408229
push str....._third_partylibc_srcinclude_string_view:318:_assertion___len___static_cast_size_type__numeric_limits_difference_type_::max____failed:_string_view::string_view__CharT___size_t_:_length_does_not_fit_in_difference_type_n
jmp 0x40831d
push str....._third_partylibc_srcinclude_string_view:320:_assertion___len__0____s___nullptr_failed:_string_view::string_view__CharT___size_t_:_received_nullptr_n
jmp 0x40831d
push 0x64c7c0
call fcn.00565714
add esp, 4
cmp dword [0x64c7c0], 0xffffffff
jne 0x40849a
push 0x400
push str.LOG_FATAL
call fcn.00408690
add esp, 8
mov dword [0x64c7bc], eax
push 0x64c7c0
call fcn.00565763
add esp, 4
jmp 0x40849a