Function at 0x40a280
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 [0x519058]
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.0040b4a0
mov eax, dword [esp + 0x28]
add eax, dword [esp + 0x20]
cmp dword [esi], 3
mov dword [esp + 8], eax
jne 0x40a467
call fcn.004210d0
test al, al
jne 0x40a467
lea ecx, [esp + 0x440]
call fcn.00421100
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.00451990
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 0x40a31e
mov eax, dword [ecx]
call dword [eax + 8]
test eax, eax
je 0x40a31e
mov edx, dword [eax]
mov ecx, eax
push 1
call dword [edx]
movsx eax, bl
mov ecx, edi
push eax
call fcn.0040c500
mov ecx, edi
call fcn.00455ea0
lea ecx, [esp + 0x440]
push edi
call fcn.00421160
lea ebx, [esp + 0x20]
mov ecx, ebx
call fcn.004211a0
mov ecx, ebx
call fcn.00421270
test al, al
jne 0x40a35d
lea ecx, [esp + 0x20]
push edi
call fcn.00421280
call fcn.004213b0
test eax, eax
je 0x40a463
cmp dword [eax + 0x38], 0
mov ebx, eax
je 0x40a463
push str.IPC_message_handler_context:
push edi
call fcn.0045e430
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.00412620
add esp, 0xc
mov eax, dword [esp + 0x438]
cmp dword [esp + 0x43c], 0xf
jbe 0x40a3b9
mov ebx, dword [esp + 0x428]
push eax
push ebx
push dword [esp + 8]
call fcn.0040c320
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.00451990
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 0x40a410
mov eax, dword [ecx]
call dword [eax + 8]
test eax, eax
je 0x40a410
mov edx, dword [eax]
mov ecx, eax
push 1
call dword [edx]
movsx eax, byte [esp]
mov ecx, ebx
push eax
call fcn.0040c500
mov ecx, ebx
call fcn.00455ea0
mov eax, dword [esp + 0x43c]
cmp eax, 0x10
jb 0x40a463
mov ecx, dword [esp + 0x428]
lea ebx, [eax + 1]
cmp ebx, 0x1000
jb 0x40a459
mov edx, dword [ecx - 4]
add ecx, 0xfffffffc
sub ecx, edx
cmp ecx, 0x20
jae 0x40aa34
add eax, 0x24
mov ecx, edx
mov ebx, eax
push ebx
push ecx
call fcn.0049a588
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.00451990
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 0x40a4a9
mov eax, dword [ecx]
call dword [eax + 8]
test eax, eax
je 0x40a4a9
mov edx, dword [eax]
mov ecx, eax
push 1
call dword [edx]
movsx eax, bl
mov ecx, edi
push eax
call fcn.0040c500
mov ecx, edi
call fcn.00455ea0
lea ebx, [esi + 0xc]
lea edi, [esp + 0x428]
mov ecx, ebx
push edi
call fcn.0045ee60
test byte [0x518518], 0x19
jne 0x40a893
mov eax, dword [0x51b93c]
test eax, eax
je 0x40a50c
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 0x40a7c8
mov eax, dword [0x5181dc]
lea edi, [esp + 0x20]
test al, 2
je 0x40a53f
cmp dword [esp + 0x43c], 0xf
jbe 0x40a52c
mov eax, dword [esp + 0x428]
jmp 0x40a533
lea eax, [esp + 0x428]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, dword [0x5181dc]
test al, 4
jne 0x40a54d
cmp eax, 1
ja 0x40a59d
cmp dword [esi], 2
jl 0x40a59d
push 2
call fcn.004abea4
add esp, 4
mov ecx, dword [esp + 0x438]
cmp dword [esp + 0x43c], 0xf
jbe 0x40a571
mov edx, dword [esp + 0x428]
jmp 0x40a578
lea edx, [esp + 0x428]
push eax
push 1
push ecx
push edx
call fcn.004ac1a6
add esp, 0x10
push 2
call fcn.004abea4
add esp, 4
push eax
call fcn.004ac38c
add esp, 4
mov eax, dword [0x5181dc]
test al, 1
je 0x40a5dc
call fcn.0040aa40
test al, al
je 0x40a5dc
mov eax, dword [esp + 0x438]
cmp dword [esp + 0x43c], 0xf
jbe 0x40a5c4
mov ecx, dword [esp + 0x428]
jmp 0x40a5cb
lea ecx, [esp + 0x428]
push 0
push edi
push eax
push ecx
push dword [0x51b948]
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [esi], 3
jne 0x40a7c8
mov ecx, dword [0x51ba40]
test ecx, ecx
je 0x40a617
mov eax, dword [esp + 0x438]
cmp dword [esp + 0x43c], 0xf
jbe 0x40a609
mov edx, dword [esp + 0x428]
jmp 0x40a610
lea edx, [esp + 0x428]
push eax
push edx
call fcn.0041a890
cmp dword [esp + 0x43c], 0xf
mov dword [esp + 0x20], 0xbedead01
mov dword [esp + 0x424], 0x5050dead
jbe 0x40a63d
mov eax, dword [esp + 0x428]
jmp 0x40a644
lea eax, [esp + 0x428]
lea ecx, [esp + 0x24]
push 0x400
push eax
push ecx
call fcn.00414180
add esp, 0xc
push edi
call fcn.00421450
add esp, 4
mov ecx, dword [0x51cb2c]
mov edx, dword fs:[0x2c]
mov eax, dword [0x51b95c]
mov ecx, dword [edx + ecx*4]
cmp eax, dword [ecx + 4]
jg 0x40a98c
mov eax, dword [0x51b954]
cmp eax, dword [0x51b958]
jne 0x40a698
call fcn.004210e0
jmp 0x40a7c8
mov ecx, dword [0x51cb2c]
mov edx, dword fs:[0x2c]
mov eax, dword [0x51b95c]
mov ecx, dword [edx + ecx*4]
cmp eax, dword [ecx + 4]
jg 0x40a9e0
mov eax, dword [0x51b958]
mov ecx, dword [0x51b950]
test eax, eax
cmove eax, ecx
dec eax
cmp eax, ecx
mov dword [esp + 0x18], eax
jbe 0x40a70e
lea eax, [esp + 0x18]
push str.i___capacity_
push 0x51b950
push eax
call fcn.0040c130
add esp, 0xc
test eax, eax
je 0x40a70e
mov edi, ebx
lea ebx, [esp + 0x440]
mov ecx, ebx
push eax
push 0x55
push str..._.._base_containers_vector_buffer.h
call fcn.0040b320
mov ecx, ebx
mov ebx, edi
call fcn.0040a280
mov eax, dword [esp + 0x18]
lea ecx, [esp + 0x10]
shl eax, 2
add eax, dword [0x51b94c]
push eax
call fcn.00421530
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40a7bf
cmp dword [esp + 0x43c], 0xf
mov dword [esp + 4], eax
jbe 0x40a748
mov edi, dword [esp + 0x428]
jmp 0x40a74f
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 0x40a76c
push eax
call fcn.004abcf0
add esp, 4
jmp 0x40a76e
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.00421510
mov eax, dword [esp + 0x43c]
cmp eax, 0x10
jb 0x40a808
mov ecx, dword [esp + 0x428]
lea edi, [eax + 1]
cmp edi, 0x1000
jb 0x40a7fe
mov edx, dword [ecx - 4]
add ecx, 0xfffffffc
sub ecx, edx
cmp ecx, 0x20
jae 0x40aa34
add eax, 0x24
mov ecx, edx
mov edi, eax
push edi
push ecx
call fcn.0049a588
add esp, 8
lea ecx, [esi + 0xac]
call fcn.004210b0
mov eax, dword [esi + 8]
mov eax, dword [eax + 4]
mov dword [esi + eax + 8], 0x4dfe8c
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], 0x4df8d0
call fcn.004551a0
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 0x40a86e
mov ecx, dword [edi + 4]
test ecx, ecx
je 0x40a865
mov eax, dword [ecx]
call dword [eax + 8]
test eax, eax
je 0x40a865
mov edx, dword [eax]
mov ecx, eax
push 1
call dword [edx]
push edi
call fcn.0049a583
add esp, 4
mov dword [esi], vtable.std::ios_base.0
push esi
call fcn.0049d84c
add esp, 4
mov ecx, dword [esp + 0x830]
xor ecx, ebp
call fcn.0049a81b
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 0x40a8ae
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.00413850
add esp, 0x10
push 0x24
call fcn.0049a550
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.004215c0
call fcn.00406a70
lea edi, [esp + 0x440]
mov dword [esp + 4], eax
push edi
call fcn.00415ca0
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 0x518518
push 0x49
call fcn.00425440
add esp, 0x30
mov al, byte [esp + 0x20]
test al, al
je 0x40a984
xor ebx, ebx
cmp byte [esp + ebx + 0x21], 8
je 0x40a970
inc ebx
movzx ecx, al
cmp ebx, ecx
jae 0x40a984
cmp byte [esp + ebx + 0x21], 8
jne 0x40a961
mov ecx, dword [esp + ebx*8 + 0x30]
test ecx, ecx
je 0x40a961
mov eax, dword [ecx]
push 1
call dword [eax]
mov al, byte [esp + 0x20]
jmp 0x40a961
mov ebx, dword [esp]
jmp 0x40a4da
push 0x51b95c
call fcn.0049a94c
add esp, 4
cmp dword [0x51b95c], 0xffffffff
jne 0x40a681
mov dword [0x51b950], 0
mov dword [0x51b94c], 0
mov dword [0x51b958], 0
mov dword [0x51b954], 0
push 0x51b95c
call fcn.0049a90d
add esp, 4
jmp 0x40a681
push 0x51b95c
call fcn.0049a94c
add esp, 4
cmp dword [0x51b95c], 0xffffffff
jne 0x40a6b9
mov dword [0x51b950], 0
mov dword [0x51b94c], 0
mov dword [0x51b958], 0
mov dword [0x51b954], 0
push 0x51b95c
call fcn.0049a90d
add esp, 4
jmp 0x40a6b9
call fcn.004a49d8
int3