Function at 0x406b65
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ecx
mov ecx, 1
dec ecx
mov dword [esp + ecx*4], 0xfffa5a5a
jne 0x406b6e
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
mov bl, byte [edi]
mov byte [ebp - 1], bl
cmp dword [0x42045c], 0
je 0x406bf8
mov edi, dword [ebp + 0x10]
cmp edi, 1
je 0x406b99
cmp edi, 2
jne 0x406bf8
cmp dword [0x420440], 0
jne 0x406bf8
cmp dword [0x420430], 0
je 0x406bb6
mov edi, dword [ebp + 0x10]
cmp dword [0x420424], edi
jne 0x406bbf
cmp dword [0x42043c], 0xffffffff
jne 0x406bf8
push dword [0x42045c]
push dword [0x42045c]
push 0xb1
push dword [0x4203f0]
call sub.USER32.DLL_SendMessageA
push 0x45ec88
push 0
push 0xc2
push dword [0x4203f0]
call sub.USER32.DLL_SendMessageA
inc dword [0x42045c]
mov edi, dword [ebp + 0x10]
cmp edi, 1
je 0x406c17
cmp edi, 2
je 0x406d4d
cmp edi, 3
je 0x406e0c
jmp 0x406e74
push dword [0x42045c]
push dword [0x42045c]
push 0xb1
push dword [0x4203f0]
call sub.USER32.DLL_SendMessageA
push dword [0x420450]
push dword [0x4203f0]
call fcn.00406a41
add esp, 8
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.00406a93
add esp, 8
jmp 0x406d2a
mov edi, dword [ebp + 8]
mov esi, edi
add esi, 1
mov dword [ebp + 8], esi
mov bl, byte [edi]
mov byte [ebp - 1], bl
cmp dword [0x423a80], 0
je 0x406c82
movzx ebx, byte [ebp - 1]
movsx ebx, byte [ebx + 0x42376c]
mov byte [ebp - 1], bl
cmp dword [0x45dd4c], 0
jle 0x406ce4
cmp dword [0x45ed30], 0
je 0x406cc1
cmp dword [0x45dd34], 0
je 0x406cb0
lea edi, [ebp - 1]
push edi
push 1
call fcn.0040daa5
add esp, 8
cmp eax, 0
jne 0x406d2a
push str._nTimeout_
push 0
call fcn.00406708
add esp, 8
jmp 0x406d2a
movsx ebx, byte [ebp - 1]
push ebx
call fcn.0040d149
add esp, 4
cmp eax, 1
je 0x406d2a
push str._nTimeout_CTS_
push 0
call fcn.00406708
add esp, 8
jmp 0x406d2a
cmp dword [0x424970], 0
jl 0x406d2a
push 0
mov edi, dword [0x424970]
shl edi, 7
lea edi, [edi + 0x4285ec]
push edi
call sub.USER32.DLL_FindWindowA
mov dword [0x4203dc], eax
cmp eax, 0
je 0x406d2a
push dword [0x4203ec]
movzx ebx, byte [ebp - 1]
push ebx
push 0x401
push dword [0x4203dc]
call sub.USER32.DLL_PostMessageA
mov edi, dword [ebp + 0xc]
mov esi, edi
sub esi, 1
mov dword [ebp + 0xc], esi
cmp edi, 0
jne 0x406c5a
mov dword [0x420424], 1
jmp 0x406e74
mov edi, dword [0x42045c]
add edi, 1
push edi
push dword [0x42045c]
push 0xb1
push dword [0x4203f0]
call sub.USER32.DLL_SendMessageA
push dword [0x420454]
push dword [0x4203f0]
call fcn.00406a41
add esp, 8
cmp dword [0x423760], 0
je 0x406da0
push dword [0x423760]
push dword [ebp + 0xc]
push 1
push dword [ebp + 8]
call sub.CRTDLL.DLL_fwrite
add esp, 0x10
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.00406a93
add esp, 8
push dword [0x42045c]
push dword [0x42045c]
push 0xb1
push dword [0x4203f0]
call sub.USER32.DLL_SendMessageA
mov dword [0x420424], 2
cmp dword [0x430f28], 0
je 0x406e74
jmp 0x406dfa
mov edi, dword [ebp + 8]
mov esi, edi
add esi, 1
mov dword [ebp + 8], esi
movzx ebx, byte [edi]
push ebx
call fcn.0040870c
add esp, 4
mov edi, dword [ebp + 0xc]
mov esi, edi
sub esi, 1
mov dword [ebp + 0xc], esi
cmp edi, 0
jne 0x406de3
jmp 0x406e74
mov edi, dword [0x42045c]
add edi, 1
push edi
push dword [0x42045c]
push 0xb1
push dword [0x4203f0]
call sub.USER32.DLL_SendMessageA
push dword [0x420458]
push dword [0x4203f0]
call fcn.00406a41
add esp, 8
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.00406a93
add esp, 8
push dword [0x42045c]
push dword [0x42045c]
push 0xb1
push dword [0x4203f0]
call sub.USER32.DLL_SendMessageA
mov dword [0x420424], 3
push 0
push 7
push 0x115
push dword [0x4203f0]
call sub.USER32.DLL_SendMessageA
mov edi, dword [0x420438]
mov dword [0x42043c], edi
pop edi
pop esi
pop ebx
leave
ret