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

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff8
sub esp, 0x838
mov eax, dword [0x56600c]
mov esi, ecx
lea edi, [ecx + 8]
lea ebx, [esp + 0x20]
mov ecx, edi
xor eax, ebp
mov dword [esp + 0x830], eax
push ebx
call fcn.00410840
mov eax, dword [esp + 0x28]
add eax, dword [esp + 0x20]
cmp dword [esi], 3
mov dword [esp + 8], eax
jne 0x40f7f7
call fcn.00428750
test al, al
jne 0x40f7f7
lea ecx, [esp + 0x440]
call fcn.00428780
mov eax, dword [edi]
mov eax, dword [eax + 4]
mov eax, dword [edi + eax + 0x30]
mov ecx, dword [eax + 4]
mov dword [esp + 0x24], ecx
mov eax, dword [ecx]
call dword [eax + 4]
push ebx
call fcn.00407630
add esp, 4
mov edx, dword [eax]
mov ecx, eax
push 0xa
call dword [edx + 0x20]
mov ecx, dword [esp + 0x24]
mov ebx, eax
test ecx, ecx
je 0x40f6ae
mov eax, dword [ecx]
call dword [eax + 8]
test eax, eax
je 0x40f6ae
mov edx, dword [eax]
mov ecx, eax
push 1
call dword [edx]
movsx eax, bl
mov ecx, edi
push eax
call fcn.00411830
mov ecx, edi
call fcn.004587fe
lea ecx, [esp + 0x440]
push edi
call fcn.004287e0
lea ebx, [esp + 0x20]
mov ecx, ebx
call fcn.00428850
mov ecx, ebx
call fcn.00428920
test al, al
jne 0x40f6ed
lea ecx, [esp + 0x20]
push edi
call fcn.00428930
call fcn.00428a60
test eax, eax
je 0x40f7f3
cmp dword [eax + 0x38], 0
mov ebx, eax
je 0x40f7f3
push str.IPC_message_handler_context:
push edi
call fcn.0045905b
add esp, 8
mov dword [esp], eax
lea eax, [esp + 0x428]
push dword [ebx + 0x38]
mov ebx, eax
push str.0x_08X
push eax
call fcn.00417610
add esp, 0xc
mov eax, dword [esp + 0x438]
cmp dword [esp + 0x43c], 0xf
jbe 0x40f749
mov ebx, dword [esp + 0x428]
push eax
push ebx
push dword [esp + 8]
call fcn.00411650
add esp, 0xc
mov ebx, eax
mov eax, dword [eax]
mov eax, dword [eax + 4]
mov eax, dword [ebx + eax + 0x30]
mov ecx, dword [eax + 4]
mov dword [esp + 0x1c], ecx
mov eax, dword [ecx]
call dword [eax + 4]
lea eax, [esp + 0x18]
push eax
call fcn.00407630
add esp, 4
mov edx, dword [eax]
mov ecx, eax
push 0xa
call dword [edx + 0x20]
mov ecx, dword [esp + 0x1c]
mov byte [esp], al
test ecx, ecx
je 0x40f7a0
mov eax, dword [ecx]
call dword [eax + 8]
test eax, eax
je 0x40f7a0
mov edx, dword [eax]
mov ecx, eax
push 1
call dword [edx]
movsx eax, byte [esp]
mov ecx, ebx
push eax
call fcn.00411830
mov ecx, ebx
call fcn.004587fe
mov eax, dword [esp + 0x43c]
cmp eax, 0x10
jb 0x40f7f3
mov ecx, dword [esp + 0x428]
lea ebx, [eax + 1]
cmp ebx, 0x1000
jb 0x40f7e9
mov edx, dword [ecx - 4]
add ecx, 0xfffffffc
sub ecx, edx
cmp ecx, 0x20
jae 0x40fdc4
add eax, 0x24
mov ecx, edx
mov ebx, eax
push ebx
push ecx
call fcn.0047834a
add esp, 8
lea ebx, [esp + 0x20]
mov eax, dword [edi]
mov eax, dword [eax + 4]
mov eax, dword [edi + eax + 0x30]
mov ecx, dword [eax + 4]
mov dword [esp + 0x24], ecx
mov eax, dword [ecx]
call dword [eax + 4]
push ebx
call fcn.00407630
add esp, 4
mov edx, dword [eax]
mov ecx, eax
push 0xa
call dword [edx + 0x20]
mov ecx, dword [esp + 0x24]
mov ebx, eax
test ecx, ecx
je 0x40f839
mov eax, dword [ecx]
call dword [eax + 8]
test eax, eax
je 0x40f839
mov edx, dword [eax]
mov ecx, eax
push 1
call dword [edx]
movsx eax, bl
mov ecx, edi
push eax
call fcn.00411830
mov ecx, edi
call fcn.004587fe
lea ebx, [esi + 0xc]
lea edi, [esp + 0x428]
mov ecx, ebx
push edi
call fcn.0040ada0
test byte [0x566370], 0x19
jne 0x40fc23
mov eax, dword [0x568674]
test eax, eax
je 0x40f89c
lea ecx, [esp + 0x428]
push ecx
push dword [esi + 0xa0]
push dword [esi + 0xa8]
push dword [esi + 0xa4]
push dword [esi]
call eax
add esp, 0x14
test al, al
jne 0x40fb58
mov eax, dword [0x566028]
lea edi, [esp + 0x20]
test al, 2
je 0x40f8cf
cmp dword [esp + 0x43c], 0xf
jbe 0x40f8bc
mov eax, dword [esp + 0x428]
jmp 0x40f8c3
lea eax, [esp + 0x428]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, dword [0x566028]
test al, 4
jne 0x40f8dd
cmp eax, 1
ja 0x40f92d
cmp dword [esi], 2
jl 0x40f92d
push 2
call fcn.004e0a0d
add esp, 4
mov ecx, dword [esp + 0x438]
cmp dword [esp + 0x43c], 0xf
jbe 0x40f901
mov edx, dword [esp + 0x428]
jmp 0x40f908
lea edx, [esp + 0x428]
push eax
push 1
push ecx
push edx
call fcn.004e0cf6
add esp, 0x10
push 2
call fcn.004e0a0d
add esp, 4
push eax
call fcn.004e104c
add esp, 4
mov eax, dword [0x566028]
test al, 1
je 0x40f96c
call fcn.0040fdd0
test al, al
je 0x40f96c
mov eax, dword [esp + 0x438]
cmp dword [esp + 0x43c], 0xf
jbe 0x40f954
mov ecx, dword [esp + 0x428]
jmp 0x40f95b
lea ecx, [esp + 0x428]
push 0
push edi
push eax
push ecx
push dword [0x568680]
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [esi], 3
jne 0x40fb58
mov ecx, dword [0x568778]
test ecx, ecx
je 0x40f9a7
mov eax, dword [esp + 0x438]
cmp dword [esp + 0x43c], 0xf
jbe 0x40f999
mov edx, dword [esp + 0x428]
jmp 0x40f9a0
lea edx, [esp + 0x428]
push eax
push edx
call fcn.0041f9a0
cmp dword [esp + 0x43c], 0xf
mov dword [esp + 0x20], 0xbedead01
mov dword [esp + 0x424], 0x5050dead
jbe 0x40f9cd
mov eax, dword [esp + 0x428]
jmp 0x40f9d4
lea eax, [esp + 0x428]
lea ecx, [esp + 0x24]
push 0x400
push eax
push ecx
call fcn.004190e0
add esp, 0xc
push edi
call fcn.00407af0
add esp, 4
mov ecx, dword [0x5684f8]
mov edx, dword fs:[0x2c]
mov eax, dword [0x568694]
mov ecx, dword [edx + ecx*4]
cmp eax, dword [ecx + 4]
jg 0x40fd1c
mov eax, dword [0x56868c]
cmp eax, dword [0x568690]
jne 0x40fa28
call fcn.00428760
jmp 0x40fb58
mov ecx, dword [0x5684f8]
mov edx, dword fs:[0x2c]
mov eax, dword [0x568694]
mov ecx, dword [edx + ecx*4]
cmp eax, dword [ecx + 4]
jg 0x40fd70
mov eax, dword [0x568690]
mov ecx, dword [0x568688]
test eax, eax
cmove eax, ecx
dec eax
cmp eax, ecx
mov dword [esp + 0x18], eax
jbe 0x40fa9e
lea eax, [esp + 0x18]
push str.i___capacity_
push 0x568688
push eax
call fcn.0040f2e0
add esp, 0xc
test eax, eax
je 0x40fa9e
mov edi, ebx
lea ebx, [esp + 0x440]
mov ecx, ebx
push eax
push 0x55
push str..._.._base_containers_vector_buffer.h
call fcn.004106c0
mov ecx, ebx
mov ebx, edi
call fcn.0040f610
mov eax, dword [esp + 0x18]
lea ecx, [esp + 0x10]
shl eax, 2
add eax, dword [0x568684]
push eax
call fcn.00428bd0
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40fb4f
cmp dword [esp + 0x43c], 0xf
mov dword [esp + 4], eax
jbe 0x40fad8
mov edi, dword [esp + 0x428]
jmp 0x40fadf
lea edi, [esp + 0x428]
mov eax, dword [esp + 8]
test edi, edi
mov dword [esp], ebx
lea eax, [edi + eax]
mov dword [esp + 0xc], eax
je 0x40fafc
push eax
call fcn.004dd150
add esp, 4
jmp 0x40fafe
xor eax, eax
mov ecx, dword [esi + 0xa0]
mov ebx, dword [esp + 8]
mov edx, dword [esi + 0xa8]
add edi, ecx
sub ebx, ecx
mov ecx, dword [esi + 0xa4]
mov dword [esp + 0x440], edi
mov edi, dword [esp + 0xc]
mov dword [esp + 0x444], ebx
mov dword [esp + 0x18], edi
mov dword [esp + 0x1c], eax
lea eax, [esp + 0x18]
lea edi, [esp + 0x440]
push eax
push edi
push edx
push ecx
mov eax, dword [esp + 0x14]
push eax
call dword [eax + 4]
add esp, 0x14
mov ebx, dword [esp]
lea ecx, [esp + 0x10]
call fcn.00428bb0
mov eax, dword [esp + 0x43c]
cmp eax, 0x10
jb 0x40fb98
mov ecx, dword [esp + 0x428]
lea edi, [eax + 1]
cmp edi, 0x1000
jb 0x40fb8e
mov edx, dword [ecx - 4]
add ecx, 0xfffffffc
sub ecx, edx
cmp ecx, 0x20
jae 0x40fdc4
add eax, 0x24
mov ecx, edx
mov edi, eax
push edi
push ecx
call fcn.0047834a
add esp, 8
lea ecx, [esi + 0xb0]
call fcn.00428730
mov eax, dword [esi + 8]
mov eax, dword [eax + 4]
mov dword [esi + eax + 8], 0x516f1c
mov eax, dword [esi + 8]
mov eax, dword [eax + 4]
lea ecx, [eax - 0x50]
mov dword [esi + eax + 4], ecx
mov ecx, ebx
mov dword [esi + 0xc], 0x516f30
call fcn.00408370
mov dword [esi + 0xc], vtable.std::basic_streambuf_char__struct_std::char_traits_char__.0
mov edi, dword [esi + 0x40]
add esi, 0x58
test edi, edi
je 0x40fbfe
mov ecx, dword [edi + 4]
test ecx, ecx
je 0x40fbf5
mov eax, dword [ecx]
call dword [eax + 8]
test eax, eax
je 0x40fbf5
mov edx, dword [eax]
mov ecx, eax
push 1
call dword [edx]
push edi
call fcn.004783ab
add esp, 4
mov dword [esi], vtable.std::ios_base.0
push esi
call fcn.004fa3c3
add esp, 4
mov ecx, dword [esp + 0x830]
xor ecx, ebp
call fcn.00478339
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
mov eax, dword [esp + 0x438]
cmp dword [esp + 0x43c], 0xf
mov dword [esp], ebx
jbe 0x40fc3e
mov edi, dword [esp + 0x428]
mov dword [esp + 0x10], edi
mov dword [esp + 0x14], eax
lea eax, [esp + 0x10]
lea ecx, [esp + 0x18]
push 0xffffffffffffffff
push dword [esi + 0xa0]
push eax
push ecx
call fcn.00418880
add esp, 0x10
push 0x24
call fcn.00478358
add esp, 4
mov ebx, eax
mov ecx, eax
push dword [esi + 0xa8]
push dword [esp + 0x20]
push dword [esp + 0x20]
push dword [esi + 0xa4]
call fcn.00428c60
call fcn.00406cd0
lea edi, [esp + 0x440]
mov dword [esp + 4], eax
push edi
call fcn.0041b0b0
add esp, 4
mov word [esp + 0x20], 0x801
mov dword [esp + 0x24], str.message
mov dword [esp + 0x30], ebx
push 0x8010
lea eax, [esp + 0x24]
push eax
push edi
push dword [esp + 0x10]
push 0
push 0
push 0
push 0
push 0
push str.LogMessage
push 0x566370
push 0x49
call fcn.0042caf0
add esp, 0x30
mov al, byte [esp + 0x20]
test al, al
je 0x40fd14
xor ebx, ebx
cmp byte [esp + ebx + 0x21], 8
je 0x40fd00
inc ebx
movzx ecx, al
cmp ebx, ecx
jae 0x40fd14
cmp byte [esp + ebx + 0x21], 8
jne 0x40fcf1
mov ecx, dword [esp + ebx*8 + 0x30]
test ecx, ecx
je 0x40fcf1
mov eax, dword [ecx]
push 1
call dword [eax]
mov al, byte [esp + 0x20]
jmp 0x40fcf1
mov ebx, dword [esp]
jmp 0x40f86a
push 0x568694
call fcn.00478734
add esp, 4
cmp dword [0x568694], 0xffffffff
jne 0x40fa11
mov dword [0x568688], 0
mov dword [0x568684], 0
mov dword [0x568690], 0
mov dword [0x56868c], 0
push 0x568694
call fcn.004786ea
add esp, 4
jmp 0x40fa11
push 0x568694
call fcn.00478734
add esp, 4
cmp dword [0x568694], 0xffffffff
jne 0x40fa49
mov dword [0x568688], 0
mov dword [0x568684], 0
mov dword [0x568690], 0
mov dword [0x56868c], 0
push 0x568694
call fcn.004786ea
add esp, 4
jmp 0x40fa49
call fcn.004d7bfa
int3