Function at 0xf01791b
Capabilities:
Create thread

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x44
mov eax, dword [ebp + 8]
push ebx
mov ebx, dword [eax*4 + 0xf063a6c]
cmp dword [ebx + 4], 1
push edi
jne 0xf01793a
xor eax, eax
inc eax
jmp 0xf0179ac
push esi
xor esi, esi
cmp dword [ebx + 0x1cc], esi
jne 0xf0179a9
cmp dword [eax*4 + 0xf06c318], esi
jne 0xf0179a9
cmp eax, 3
jg 0xf01799c
cmp eax, esi
jl 0xf01799c
push esi
push 0x40000080
push 3
push esi
add al, 0x54
push esi
push 0xc0000000
push esi
mov byte [ebp - 0x14], al
push eax
call fcn.0f010c71
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebx], eax
jne 0xf0179b2
cmp dword [ebx + 0x3c], esi
je 0xf01799c
push esi
push dword [ebp - 0x14]
call fcn.0f010c71
push eax
push 0x3ec
call fcn.0f034086
mov dword [ebx + 0x3c], esi
mov dword [ebx + 0x1cc], 0x24
mov dword [ebx + 4], esi
xor eax, eax
pop esi
pop edi
pop ebx
leave
ret 4
push 0x4000
call fcn.0f006f83
cmp eax, esi
pop ecx
mov dword [ebx + 0x40], eax
jne 0xf0179ce
push dword [ebx]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0xf0179a6
lea edi, [ebx + 0x38]
push edi
lea eax, [ebx + 0x34]
push eax
push dword [ebp + 8]
mov dword [ebx + 0x50], 0x100
mov dword [ebx + 0x54], esi
call fcn.0f0099aa
push 1
push dword [edi]
push dword [ebx + 0x34]
call fcn.0f01e065
mov edi, dword [sym.imp.KERNEL32.dll_CreateEventA]
push esi
push esi
push 1
push esi
call edi
push esi
push esi
push esi
push esi
mov dword [ebx + 0x30], eax
call edi
push esi
push esi
push 1
push esi
mov dword [ebx + 0x68], eax
call edi
push esi
push esi
push 1
push esi
mov dword [ebx + 0x1e4], eax
call edi
mov dword [ebx + 0x1f4], eax
lea eax, [ebx + 0x164]
mov dword [ebp - 0x10], eax
lea eax, [ebx + 0x1e8]
mov dword [ebx + 0x190], esi
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x14], 3
push esi
push 1
push 1
push esi
call edi
mov ecx, dword [ebp - 0xc]
add dword [ebp - 0xc], 4
mov dword [ecx], eax
mov eax, dword [ebp - 0x10]
add dword [ebp - 0x10], 0x14
dec dword [ebp - 0x14]
mov dword [eax], esi
jne 0xf017a46
push 0xf0021e4
mov dword [ebx + 0x48], esi
mov dword [ebx + 0x44], esi
mov dword [ebx + 0x138], esi
mov dword [ebx + 0x4c], esi
mov dword [ebx + 0x58], esi
mov dword [ebx + 0x60], esi
mov dword [ebx + 0x64], 0x24
mov dword [ebx + 0x1d0], 1
mov dword [ebx + 0x6c], esi
call fcn.0f01b3b0
test eax, eax
pop ecx
je 0xf017ab1
push 0xf0021e4
call fcn.0f01b3b0
push eax
call fcn.0f01e00c
pop ecx
pop ecx
jmp 0xf017ab6
mov eax, 0xc8
mov edx, 0xc8
cmp eax, edx
lea ecx, [ebx + 0x140]
mov dword [ecx], eax
jle 0xf017ac9
mov dword [ecx], edx
push esi
xor eax, eax
inc eax
push esi
push eax
push esi
mov dword [ebx + 0x13c], eax
mov dword [ebx + 0x144], esi
mov dword [ebx + 4], eax
mov dword [ebx + 0x1c8], esi
mov dword [ebx + 0x1d8], esi
call edi
mov edi, dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov dword [ebx + 0x1d4], eax
lea eax, [ebx + 0x194]
push eax
mov dword [ebx + 0x1e0], esi
mov dword [ebx + 0x1dc], esi
call edi
lea eax, [ebx + 0x1ac]
push eax
call edi
mov dword [ebx + 0x1c4], esi
mov dword [ebx + 0x1fc], esi
mov dword [ebx + 0xc], esi
lea esi, [ebx + 0x10]
push esi
push dword [ebx]
call dword [sym.imp.KERNEL32.dll_GetCommState]
test eax, eax
je 0xf017c13
push 7
pop ecx
mov dword [ebx + 0xc], 1
lea edi, [ebp - 0x44]
rep movsd dword es:[edi], dword [esi]
mov eax, dword [ebp - 0x3c]
and eax, 0xffffccc3
or eax, 1
and eax, 0xfffffbff
mov dword [ebp - 0x3c], eax
lea eax, [ebp - 1]
push eax
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 0x44]
push eax
xor edi, edi
push edi
mov byte [ebp - 0x2f], 0x11
mov byte [ebp - 0x2e], 0x13
call fcn.0f0390ee
test eax, eax
je 0xf017c13
lea eax, [ebp - 1]
push eax
lea eax, [ebp - 8]
push eax
push dword [ebp + 8]
call fcn.0f02863f
lea eax, [ebp - 0x44]
push eax
push dword [ebx]
call dword [sym.imp.KERNEL32.dll_SetCommState]
test eax, eax
je 0xf017c13
push 0xff
push dword [ebx + 0x30]
push dword [ebx]
call fcn.0f03e0e5
test eax, eax
je 0xf017c13
push 0x64
mov esi, 0x2000
push esi
push dword [ebx]
call dword [sym.imp.KERNEL32.dll_SetupComm]
test eax, eax
je 0xf017c13
lea eax, [ebp - 0x28]
push eax
push dword [ebx]
call dword [sym.imp.KERNEL32.dll_GetCommTimeouts]
or dword [ebp - 0x28], 0xffffffff
lea eax, [ebp - 0x28]
push eax
mov dword [ebp - 0x24], edi
mov dword [ebp - 0x20], edi
push dword [ebx]
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
push dword [ebp + 8]
call fcn.0f0286a7
lea eax, [ebx + 0x1f8]
push eax
push edi
push dword [ebp + 8]
push 0xf0353ab
push esi
push edi
call dword [sym.imp.KERNEL32.dll_CreateThread]
cmp eax, edi
mov dword [ebx + 0x1fc], eax
jne 0xf017c2a
push dword [ebp + 8]
call sym.ntvdm.exe_host_com_close
mov dword [ebx + 0x1cc], 0x24
jmp 0xf0179a9
xor eax, eax
inc eax
jmp 0xf0179ab