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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x417006
mov eax, dword fs:[0]
push eax
mov eax, 0x3930
call fcn.00416fa0
mov eax, dword [0x418064]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x3928], edx
mov edi, ecx
mov eax, dword [ebp + 0xc]
lea ecx, [ebp - 0x3900]
mov ebx, dword [ebp + 0x10]
or dword [ebp - 0x390c], 0xffffffff
or dword [ebp - 0x3930], 0xffffffff
or dword [ebp - 0x3910], 0xffffffff
mov dword [ebp - 0x392c], eax
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x3918], eax
xor eax, eax
mov dword [ebp - 0x3924], ebx
mov dword [ebp - 0x393c], eax
mov dword [ebp - 0x391c], eax
mov dword [ebp - 0x3908], eax
mov dword [ebp - 0x3914], eax
mov dword [ebp - 0x3934], eax
mov dword [ebp - 0x414], eax
mov byte [ebp - 0x1018], al
mov byte [ebp - 0x415], al
call fcn.00407319
xor ecx, ecx
mov dword [ebp - 4], ecx
mov esi, ecx
mov eax, dword [ebx]
mov ebx, ecx
mov dword [ebp - 0x3920], eax
mov eax, dword [0x41806c]
mov dword [ebp - 0x3904], esi
cmp eax, 0xffffffff
jne 0x4065e4
push 0xfffffffffffffff4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [0x418070], eax
test eax, eax
je 0x406acf
cmp eax, 0xffffffff
je 0x406acf
push 0x40149c
push eax
call fcn.00406002
push 0x4015d4
push dword [0x418070]
call fcn.00406002
mov edx, dword [ebp - 0x3928]
lea eax, [ebp - 0x3934]
add esp, 0x10
mov ecx, edi
push eax
lea eax, [ebp - 0x3914]
push eax
lea eax, [ebp - 0x3910]
push eax
lea eax, [ebp - 0x3908]
push eax
lea eax, [ebp - 0x3930]
push eax
lea eax, [ebp - 0x391c]
push eax
lea eax, [ebp - 0x390c]
push eax
call fcn.00406171
mov edi, eax
test edi, edi
js 0x40688b
push ecx
push ecx
push dword [ebp - 0x3914]
mov ecx, dword [ebp - 0x3934]
lea edx, [ebp - 0x3900]
push dword [ebp - 0x3910]
push dword [ebp - 0x3908]
push dword [ebp - 0x3930]
call fcn.00406323
mov edi, eax
test edi, edi
js 0x40688b
mov edi, dword [0x4193d4]
lea ecx, [ebp - 0x1018]
push dword [ebp - 0x392c]
push dword [ebp + 8]
mov eax, dword [edi]
push ecx
mov esi, dword [eax + 8]
mov ecx, esi
call dword [0x41a198]
mov ecx, edi
call esi
mov edi, eax
test edi, edi
js 0x40688b
mov edi, dword [0x4193d0]
push dword [ebp - 0x3918]
mov ecx, dword [ebp - 0x3924]
push ecx
mov eax, dword [edi]
lea ecx, [ebp - 0x1018]
push ecx
mov esi, dword [eax + 0x2c]
mov ecx, esi
call dword [0x41a198]
mov ecx, edi
call esi
mov edi, eax
test edi, edi
js 0x40688b
cmp dword [ebp - 0x390c], 1
jle 0x40688b
mov ebx, dword [ebp - 0x391c]
xor eax, eax
mov esi, 0x401378
mov ecx, eax
mov edx, dword [ebx + 4]
movzx eax, byte [esi + ecx]
cmp al, byte [edx + ecx]
jne 0x40688b
inc ecx
cmp ecx, 7
jne 0x40671a
push 0x32000
call fcn.0041630b
mov esi, eax
pop ecx
test esi, esi
jne 0x406748
mov edi, 0x8007000e
jmp 0x40688b
cmp dword [ebp - 0x390c], 3
mov dword [ebp - 0x3938], 0x31ffe
jl 0x406ac5
mov ecx, dword [ebx + 8]
test ecx, ecx
je 0x406ac5
lea eax, [ebp - 0x3938]
mov edx, esi
push eax
call fcn.00405edc
mov edi, eax
test edi, edi
jns 0x4067a5
mov eax, dword [0x418070]
test eax, eax
je 0x40688b
cmp eax, 0xffffffff
je 0x40688b
push 0x4015d8
push eax
call fcn.00406002
pop ecx
jmp 0x40688a
mov eax, dword [ebp - 0x3938]
lea edx, [ebp - 0x3904]
shr eax, 1
xor ecx, ecx
mov word [esi + eax*2], cx
mov ecx, esi
call fcn.004104af
mov edi, eax
test edi, edi
js 0x40688b
mov edi, dword [ebp - 0x3904]
xor ecx, ecx
push 4
pop edx
lea eax, [edi + 1]
mov dword [ebp - 0x3928], eax
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0041630b
mov ebx, eax
pop ecx
test ebx, ebx
je 0x40673e
lea eax, [edi*4 + 4]
push eax
xor eax, eax
push eax
push ebx
call sub.msvcrt.dll_memset
mov edi, dword [ebp - 0x3924]
xor edx, edx
mov ecx, dword [ebp - 0x3918]
push 2
mov eax, dword [edi]
mov word [ecx + eax*2], dx
xor ecx, ecx
mov eax, dword [edi]
pop edx
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0041630b
add esp, 0x10
mov dword [ebp - 0x392c], eax
mov dword [ebx], eax
test eax, eax
jne 0x406939
mov edi, 0x8007000e
mov dword [ebp - 0x3908], edi
mov esi, dword [ebp - 0x3904]
test ebx, ebx
je 0x40688b
lea eax, [esi + 1]
xor ecx, ecx
mov dword [ebp - 0x3920], eax
mov esi, ecx
test eax, eax
je 0x406883
mov edi, eax
push dword [ebx + esi*4]
call dword [sym.imp.msvcrt.dll_void___cdecl_operator_delete_void__]
inc esi
pop ecx
cmp esi, edi
jb 0x40686e
mov edi, dword [ebp - 0x3908]
push ebx
call dword [sym.imp.msvcrt.dll_void___cdecl_operator_delete_void__]
pop ecx
mov eax, dword [0x4193d4]
test eax, eax
je 0x4068a2
push eax
mov dword [eax], 0x401014
call dword [sym.imp.msvcrt.dll_void___cdecl_operator_delete_void__]
pop ecx
mov eax, dword [0x4193d0]
test eax, eax
je 0x4068b9
push eax
mov dword [eax], 0x40102c
call dword [sym.imp.msvcrt.dll_void___cdecl_operator_delete_void__]
pop ecx
test edi, edi
jns 0x406910
cmp edi, 0x8004930f
je 0x406910
push ecx
lea eax, [ebp - 0x410]
xor ebx, ebx
push eax
mov edx, edi
mov dword [ebp - 0x3920], ebx
lea ecx, [ebp - 0x1018]
call fcn.00406caa
mov esi, eax
lea eax, [ebp - 0x410]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push ebx
lea eax, [ebp - 0x3920]
push eax
push esi
lea eax, [ebp - 0x410]
push eax
push 0xfffffffffffffff4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
lea ecx, [ebp - 0x3900]
call fcn.00407149
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00416650
leave
ret 0x14
push 2
pop eax
cmp dword [edi], eax
jbe 0x406abb
mov ecx, dword [ebp - 0x3918]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, word [ebp - 0x393c]
jne 0x40694d
sub ecx, edx
sar ecx, 1
cmp ecx, 4
jbe 0x406abb
mov eax, dword [ebp - 0x3918]
mov edx, dword [edi]
add eax, 2
mov ecx, dword [ebp - 0x392c]
push eax
call fcn.00406d90
mov edi, eax
mov dword [ebp - 0x3908], edi
test edi, edi
js 0x406851
xor edx, edx
mov eax, edx
mov dword [ebp - 0x3910], eax
cmp dword [ebp - 0x3904], eax
jbe 0x406a5f
lea ecx, [ebx + 4]
mov dword [ebp - 0x3914], ecx
push edx
lea ecx, [ebp - 0x390c]
mov dword [ebp - 0x390c], edx
push ecx
mov edx, eax
mov ecx, esi
call fcn.0041033b
mov edi, eax
mov dword [ebp - 0x3908], edi
test edi, edi
js 0x406851
mov eax, dword [ebp - 0x390c]
xor ecx, ecx
push 2
inc eax
pop edx
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0041630b
pop ecx
mov ecx, dword [ebp - 0x3914]
mov dword [ecx], eax
test eax, eax
je 0x406846
mov edx, dword [ebp - 0x3910]
mov ecx, esi
push eax
lea eax, [ebp - 0x390c]
push eax
call fcn.0041033b
mov edi, eax
mov dword [ebp - 0x3908], edi
test edi, edi
js 0x406851
mov edx, dword [ebp - 0x3914]
xor edi, edi
mov eax, dword [ebp - 0x390c]
push edi
mov ecx, dword [edx]
add edx, 4
mov dword [ebp - 0x3914], edx
pop edx
mov word [ecx + eax*2], di
mov eax, dword [ebp - 0x3910]
inc eax
mov dword [ebp - 0x3910], eax
cmp eax, dword [ebp - 0x3904]
jb 0x4069af
mov ecx, dword [ebp - 0x3918]
mov eax, 0xfeff
mov edx, ebx
mov word [ecx], ax
mov eax, dword [ebp - 0x3920]
dec eax
mov dword [ebp - 0x391c], eax
lea eax, [ecx + 2]
mov ecx, dword [ebp - 0x3928]
push eax
lea eax, [ebp - 0x391c]
push eax
call fcn.004102cf
mov esi, dword [ebp - 0x3904]
mov edi, eax
mov dword [ebp - 0x3908], edi
test edi, edi
js 0x406857
mov ecx, dword [ebp - 0x3924]
mov eax, dword [ebp - 0x391c]
mov dword [ecx], eax
jmp 0x406857
mov edi, 0x80070057
jmp 0x40684b
mov edi, 0x80070057
jmp 0x40688b
mov edi, 0x80004005
mov dword [ebp - 0x3908], edi
jmp 0x406857