Function at 0x40e9fb
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
sub esp, 0xa8
mov eax, dword [0x47b014]
xor eax, esp
mov dword [esp + 0xa4], eax
mov eax, ecx
mov dword [esp + 0x34], 0
push esi
push edi
xorps xmm0, xmm0
mov dword [esp + 0x20], eax
mov edi, dword [eax + 0x3fa0]
mov dword [esp + 0x40], 0
movaps xmmword [esp + 0x70], xmm0
movaps xmmword [esp + 0x80], xmm0
movq qword [esp + 0x90], xmm0
mov eax, dword [edi]
mov dword [esp + 0x1c], edx
mov dword [esp + 0x18], edi
cmp eax, 0xffffffff
je 0x40e8cd
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [edi], 0xffffffff
lea esi, [edi + 4]
mov dword [esp + 0x38], 0
cmp byte [esi], 0
je 0x40e901
lea eax, [edi + 0x14]
mov edx, esi
push eax
call fcn.0040e5b0
add esp, 4
lea eax, [esp + 0x38]
push eax
mov eax, dword [0x481aa8]
push esi
mov eax, dword [eax + 0x3c]
call eax
add esp, 8
mov byte [esi], 0
mov eax, dword [esp + 0x20]
mov edx, dword [eax + 8]
mov ecx, edx
mov esi, dword [eax + 0xc]
mov eax, esi
shrd ecx, eax, 8
mov eax, esi
mov byte [esp + 0x6d], dl
mov esi, dword [esp + 0x20]
mov byte [esp + 0x6c], cl
mov ecx, edx
shrd ecx, eax, 0x10
mov byte [esp + 0x6b], cl
mov ecx, dword [esi + 0xc]
mov eax, ecx
shrd edx, eax, 0x18
mov byte [esp + 0x69], cl
shr ecx, 8
mov byte [esp + 0x6a], dl
mov byte [esp + 0x68], cl
cmp dword [edi + 0x14], 0
je 0x40e953
mov esi, 6
jmp 0x40ecf6
mov edx, dword [esp + 0x1c]
lea eax, [esp + 0x24]
push eax
mov dword [esp + 0x28], 0
call fcn.0040e5b0
add esp, 4
test al, al
je 0x40ecf1
call dword [sym.imp.WINMM.dll_timeGetTime]
mov dword [esp + 0x30], eax
nop
mov ecx, dword [esi + 8]
xor edi, edi
mov eax, dword [esi + 0xc]
push 0x21
push 0x42
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x34], eax
mov byte [esp + 0x1b], 0
mov dword [esp + 0x3c], 0
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov esi, eax
mov dword [esp + 0x28], esi
test esi, esi
je 0x40ead1
lea eax, [esp + 0x34]
push eax
mov eax, dword [0x481aa8]
push esi
mov eax, dword [eax + 0x60]
call eax
add esp, 8
test eax, eax
jne 0x40e9ea
mov eax, dword [esp + 0x34]
add eax, 0xb
cmp eax, 0xd
ja case.0x40e9e3.11
movzx eax, byte [eax + 0x40ed74]
jmp dword [eax*4 + 0x40ed68]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov edi, eax
test edi, edi
je case.0x40e9e3.11
mov eax, dword [esp + 0x14]
xor esi, esi
mov edx, dword [esp + 0x2c]
mov ecx, eax
mov byte [esp + 0x65], al
mov eax, edx
shrd ecx, eax, 8
mov eax, edx
mov byte [esp + 0x61], dl
mov byte [esp + 0x64], cl
mov ecx, dword [esp + 0x14]
shrd ecx, eax, 0x10
mov eax, edx
shr edx, 8
mov byte [esp + 0x63], cl
mov ecx, dword [esp + 0x14]
shrd ecx, eax, 0x18
mov eax, dword [edi]
mov byte [esp + 0x62], cl
mov byte [esp + 0x60], dl
mov dword [esp + 0x14], eax
test eax, eax
je 0x40ea82
mov cl, byte [esp + 0x13]
lea edx, [edi + 4]
nop dword [eax]
test cl, cl
jne 0x40ea7e
mov eax, dword [edx]
lea edi, [esp + 0x60]
cmp eax, dword [edi]
mov edi, dword [esp + 0x14]
jne 0x40ea76
movzx eax, word [edx + 4]
lea edi, [esp + 0x60]
cmp ax, word [edi + 4]
mov edi, dword [esp + 0x14]
jne 0x40ea76
mov cl, 1
inc esi
add edx, 0xc
cmp esi, edi
jb 0x40ea50
mov byte [esp + 0x13], cl
mov esi, dword [esp + 0x28]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
cmp byte [esp + 0x13], 0
je 0x40ead1
call dword [sym.imp.WINMM.dll_timeGetTime]
sub eax, dword [esp + 0x30]
cmp eax, 0x3e8
jae 0x40eac0
push 0x14d
call dword [sym.imp.KERNEL32.dll_Sleep]
mov esi, dword [esp + 0x20]
jmp 0x40e980
mov esi, 0x1a
jmp 0x40ecf6
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push 1
lea edx, [esp + 0x6c]
call fcn.0040e670
mov esi, eax
add esp, 4
test esi, esi
jne 0x40ecf6
call dword [sym.imp.WINMM.dll_timeGetTime]
mov edi, eax
mov edx, dword [esp + 0x1c]
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x40]
push eax
push ecx
lea eax, [esp + 0x4c]
push eax
sub esp, 8
lea eax, [esp + 0x80]
push eax
call fcn.0040e3a0
mov esi, eax
add esp, 0x1c
test esi, esi
je 0x40eb44
cmp esi, 0xa
je 0x40eb44
cmp esi, 0xd
je 0x40eb44
call dword [sym.imp.WINMM.dll_timeGetTime]
sub eax, edi
cmp eax, 0x1388
jae 0x40eb44
push 0x14d
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x40eaf1
mov ecx, dword [0x481aa8]
mov dword [esp + 0x30], 0
cmp dword [ecx + 0x54], 0
jne 0x40eb6a
lea eax, [esp + 0x30]
push eax
movzx eax, word [ecx + 0x20]
push eax
mov eax, dword [ecx + 0x5c]
call eax
add esp, 8
test esi, esi
jne 0x40ecf6
mov eax, dword [esp + 0x18]
push 0x10
push dword [esp + 0x20]
add eax, 4
push eax
call fcn.004317f0
mov edx, dword [esp + 0x24]
add esp, 0xc
mov edi, dword [esp + 0x1c]
xor ecx, ecx
mov eax, dword [esp + 0x24]
mov dword [edx + 0x14], eax
lea edx, [esp + 0x78]
lea eax, [edi + 0xf]
mov dword [esp + 0x70], 0x5c005c
cmp edx, eax
mov dword [esp + 0x74], 0x5c002e
mov edx, dword [esp + 0x18]
ja 0x40ebe0
lea eax, [esp + 0x96]
cmp eax, edi
jb 0x40ebe0
movsx ax, byte [edi + ecx]
mov word [esp + ecx*2 + 0x78], ax
inc ecx
cmp ecx, 0x10
jl 0x40ebc3
jmp 0x40ebfb
movq xmm0, qword [edi + ecx]
punpcklbw xmm0, xmm0
psraw xmm0, 8
movups xmmword [esp + ecx*2 + 0x78], xmm0
add ecx, 8
cmp ecx, 0x10
jl 0x40ebe0
mov dword [edx], 0xffffffff
xor edi, edi
cmp dword [edx], 0xffffffff
jne 0x40ec45
push 0x12c
call dword [sym.imp.KERNEL32.dll_Sleep]
push 0
push 0
push 3
push 0
push 0
push 0xc0000000
lea eax, [esp + 0x88]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edx, dword [esp + 0x18]
inc edi
mov dword [edx], eax
cmp edi, 0x1e
jl 0x40ec03
cmp eax, 0xffffffff
je 0x40ecf1
lea eax, [esp + 0x44]
push eax
push dword [edx]
call dword [sym.imp.KERNEL32.dll_GetCommState]
test eax, eax
je 0x40ecf1
mov edi, dword [esp + 0x18]
lea eax, [esp + 0x44]
push eax
mov dword [esp + 0x4c], 0x1c200
mov word [esp + 0x5a], 8
push dword [edi]
mov byte [esp + 0x60], 0
call dword [sym.imp.KERNEL32.dll_SetCommState]
test eax, eax
je 0x40ecf1
lea eax, [esp + 0x44]
push eax
push dword [edi]
call dword [sym.imp.KERNEL32.dll_GetCommTimeouts]
test eax, eax
je 0x40ecf1
lea eax, [esp + 0x44]
mov dword [esp + 0x44], 0
push eax
push dword [edi]
mov dword [esp + 0x54], 0x2710
mov dword [esp + 0x50], 0
mov dword [esp + 0x5c], 0x2710
mov dword [esp + 0x58], 0
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
test eax, eax
je 0x40ecf1
push 0xf
push dword [edi]
call dword [sym.imp.KERNEL32.dll_PurgeComm]
test eax, eax
je 0x40ecf1
push 0x1022
push 0x1022
push dword [edi]
call dword [sym.imp.KERNEL32.dll_SetupComm]
test eax, eax
jne 0x40ed50
mov esi, 0xf
mov eax, dword [esp + 0x20]
mov edi, dword [eax + 0x3fa0]
mov eax, dword [edi]
cmp eax, 0xffffffff
je 0x40ed14
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [edi], 0xffffffff
lea ecx, [edi + 4]
mov dword [esp + 0x30], 0
cmp byte [ecx], 0
mov dword [esp + 0x28], ecx
je 0x40ed50
lea eax, [edi + 0x14]
mov edx, ecx
push eax
call fcn.0040e5b0
mov edi, dword [esp + 0x2c]
lea eax, [esp + 0x34]
add esp, 4
push eax
mov eax, dword [0x481aa8]
push edi
mov eax, dword [eax + 0x3c]
call eax
add esp, 8
mov byte [edi], 0
mov ecx, dword [esp + 0xac]
mov eax, esi
pop edi
pop esi
xor ecx, esp
call fcn.00422009
mov esp, ebp
pop ebp
ret