Function at 0x404fc0
Capabilities:
Create thread

Disassembly:
push 0xffffffffffffffff
push 0x407ac0
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x34
push ebx
push ebp
push esi
push edi
mov esi, ecx
mov ax, word [esp + 0x68]
mov edi, dword [sym.imp.KERNEL32.dll_CreateEventA]
xor ebx, ebx
mov word [esi + 0x38], ax
push ebx
push ebx
push 1
push ebx
mov dword [esp + 0x5c], ebx
mov dword [esi + 8], ebx
mov dword [esi + 0x14], ebx
mov dword [esi + 0x18], ebx
call edi
cmp eax, ebx
mov dword [esi + 0x1c], eax
jne 0x405022
lea ecx, [esp + 0x54]
mov dword [esp + 0x4c], 0xffffffff
call fcn.00406896
xor eax, eax
jmp 0x4051c9
push ebx
push ebx
push 1
push ebx
mov dword [esi + 0x28], ebx
mov dword [esi + 0x2c], ebx
call edi
cmp eax, ebx
mov dword [esi + 0x30], eax
jne 0x40504e
lea ecx, [esp + 0x54]
mov dword [esp + 0x4c], 0xffffffff
call fcn.00406896
xor eax, eax
jmp 0x4051c9
mov ecx, dword [esp + 0x54]
cmp dword [ecx - 8], 4
jg 0x405069
lea edi, [esi + 4]
lea edx, [esp + 0x54]
push edx
mov ecx, edi
call fcn.00406920
jmp 0x40509a
lea eax, [esp + 0x54]
lea ecx, [esp + 0x68]
push eax
push str.._
push ecx
call sub.MFC42.DLL_operator_2
lea edi, [esi + 4]
push eax
mov ecx, edi
mov byte [esp + 0x50], 1
call fcn.00406920
lea ecx, [esp + 0x68]
mov byte [esp + 0x4c], bl
call fcn.00406896
mov edi, dword [edi]
push ebx
push 0x40000080
push 3
push ebx
push ebx
push 0xc0000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
or ebp, 0xffffffff
mov dword [esi], eax
cmp eax, ebp
je 0x4051a6
push 1
push eax
call dword [sym.imp.KERNEL32.dll_SetCommMask]
mov edx, dword [esi]
push 0x1000
push 0x1000
push edx
call dword [sym.imp.KERNEL32.dll_SetupComm]
mov eax, dword [esi]
push 0xf
push eax
call dword [sym.imp.KERNEL32.dll_PurgeComm]
mov edi, dword [esp + 0x58]
mov eax, 0x4b00
xor edx, edx
lea ecx, [esp + 0x14]
div edi
mov edx, dword [esi]
push ecx
push edx
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x20], ebx
mov dword [esp + 0x24], ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x28], eax
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
mov ecx, dword [esi]
lea eax, [esp + 0x28]
push eax
push ecx
mov dword [esp + 0x30], 0x1c
call dword [sym.imp.KERNEL32.dll_GetCommState]
mov al, byte [esp + 0x5c]
mov dl, byte [esp + 0x64]
mov byte [esp + 0x3b], al
mov eax, dword [esp + 0x30]
mov cl, byte [esp + 0x60]
or ah, 3
mov dword [esp + 0x30], eax
mov eax, 0x64
mov byte [esp + 0x3a], dl
mov word [esp + 0x36], ax
mov word [esp + 0x38], ax
mov eax, dword [esi]
lea edx, [esp + 0x28]
mov dword [esp + 0x2c], edi
push edx
push eax
mov byte [esp + 0x44], cl
mov byte [esp + 0x45], 0x11
mov byte [esp + 0x46], 0x13
call dword [sym.imp.KERNEL32.dll_SetCommState]
test eax, eax
je 0x4051a6
lea ecx, [esp + 0x10]
mov dword [esi + 8], 1
push ecx
push ebx
push esi
push 0x404e50
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_CreateThread]
cmp eax, ebx
mov dword [esi + 0x34], eax
jne 0x4051b7
mov ecx, esi
call fcn.00404cb0
lea ecx, [esp + 0x54]
mov dword [esp + 0x4c], ebp
call fcn.00406896
xor eax, eax
jmp 0x4051c9
lea ecx, [esp + 0x54]
mov dword [esp + 0x4c], ebp
call fcn.00406896
mov eax, 1
mov ecx, dword [esp + 0x44]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x40
ret 0x18