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

Disassembly:
sub esp, 0x418
mov eax, dword [esp + 0x41c]
push ebx
xor edx, edx
push ebp
push esi
sub eax, edx
push edi
mov dword [esp + 0x10], ecx
mov dword [esp + 0x1c], edx
je 0x4065d6
dec eax
jne 0x4067da
mov eax, dword [ecx + 0x284]
mov dword [esp + 0x14], edx
cmp eax, edx
jbe 0x4067da
mov ebx, dword [sym.imp.USER32.dll_wsprintfA]
lea eax, [ecx + 0x288]
mov dword [esp + 0x18], eax
lea edi, [ecx + 0x64c]
mov edx, dword [eax + 0x248]
test edx, edx
je 0x4065a4
mov eax, dword [eax]
mov dword [esp + 0x1c], eax
push eax
lea eax, [esp + 0x2c]
push str.Port__04x:_Device_Action.
push eax
call ebx
lea ecx, [esp + 0x34]
push 2
push ecx
call fcn.00402a00
mov eax, dword [edi]
add esp, 0x14
test eax, eax
jne 0x40652c
xor ebp, ebp
jmp 0x406534
mov ebp, dword [edi + 4]
sub ebp, eax
sar ebp, 2
xor esi, esi
test ebp, ebp
jle 0x40659c
mov edx, dword [edi]
lea ecx, [esp + 0x28]
mov eax, dword [edx + esi*4]
push eax
push esi
push str.Expression__d____s
push ecx
call ebx
lea edx, [esp + 0x38]
push 2
push edx
call fcn.00402a00
mov eax, dword [edi]
add esp, 0x18
lea ecx, [esp + 0x20]
mov edx, dword [eax + esi*4]
mov eax, dword [esp + 0x10]
push ecx
push edx
lea ecx, [eax + 0x2eec]
call fcn.00402860
call sub.MSVCRT.dll__ftol
push eax
lea ecx, [esp + 0x2c]
push str.Result___d
push ecx
call ebx
lea edx, [esp + 0x34]
push 2
push edx
call fcn.00402a00
add esp, 0x14
inc esi
cmp esi, ebp
jl 0x40653a
mov ecx, dword [esp + 0x10]
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x14]
mov esi, dword [ecx + 0x284]
inc edx
add eax, 4
add edi, 0x10
cmp edx, esi
mov dword [esp + 0x14], edx
mov dword [esp + 0x18], eax
jb 0x4064f2
mov eax, dword [esp + 0x1c]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x418
ret 4
mov eax, dword [ecx + 0x284]
mov dword [esp + 0x14], edx
cmp eax, edx
jbe 0x4067da
mov edi, dword [sym.imp.USER32.dll_wsprintfA]
lea eax, [ecx + 0x490]
mov dword [esp + 0x18], eax
lea ebp, [ecx + 0x54c]
cmp dword [eax], 0
je 0x4067a4
mov dword [eax], 0
mov eax, dword [eax - 0x208]
mov dword [esp + 0x1c], eax
push eax
lea eax, [esp + 0x2c]
push str.Port__04x:_Presence_Action.
push eax
call edi
lea ecx, [esp + 0x34]
push 2
push ecx
call fcn.00402a00
mov eax, dword [ebp]
add esp, 0x14
test eax, eax
jne 0x40663e
xor ebx, ebx
jmp 0x406646
mov ebx, dword [ebp + 4]
sub ebx, eax
sar ebx, 2
xor esi, esi
test ebx, ebx
jle 0x4066b0
mov edx, dword [ebp]
lea ecx, [esp + 0x28]
mov eax, dword [edx + esi*4]
push eax
push esi
push str.Expression__d____s
push ecx
call edi
lea edx, [esp + 0x38]
push 2
push edx
call fcn.00402a00
mov eax, dword [ebp]
add esp, 0x18
lea ecx, [esp + 0x20]
mov edx, dword [eax + esi*4]
mov eax, dword [esp + 0x10]
push ecx
push edx
lea ecx, [eax + 0x2eec]
call fcn.00402860
call sub.MSVCRT.dll__ftol
push eax
lea ecx, [esp + 0x2c]
push str.Result___d
push ecx
call edi
lea edx, [esp + 0x34]
push 2
push edx
call fcn.00402a00
add esp, 0x14
inc esi
cmp esi, ebx
jl 0x40664c
mov esi, dword [esp + 0x10]
mov eax, dword [esp + 0x14]
mov edx, dword [esp + 0x1c]
mov bl, byte [eax + esi + 0x2d8]
lea eax, [esp + 0x28]
mov byte [esp + 0x24], bl
mov ecx, dword [esp + 0x24]
and ecx, 0xff
push ecx
push edx
push str.Port__04x:_Plugged_In___d
push eax
call edi
lea ecx, [esp + 0x38]
push 1
push ecx
call fcn.00402a00
mov eax, dword [esi + 0x24c]
add esp, 0x18
test bl, bl
jne 0x406760
test eax, eax
je 0x40672a
lea edx, [esp + 0x28]
push str.SetPortVerified_0_
push edx
call edi
lea eax, [esp + 0x30]
push 1
push eax
call fcn.00402a00
mov eax, dword [esi + 0x24c]
mov edx, dword [esp + 0x2c]
add esp, 0x10
mov ecx, dword [eax]
push 0
push edx
push eax
call dword [ecx + 0x3c]
mov eax, dword [esp + 0x18]
mov ecx, dword [eax - 0x118]
push ecx
call fcn.0040ffc0
add esp, 4
test eax, eax
je 0x406752
mov edx, dword [esp + 0x14]
lea eax, [esi + 0x78]
push edx
push eax
call fcn.0040fff0
add esp, 8
mov ecx, dword [esp + 0x14]
push ecx
mov ecx, esi
call fcn.00406280
jmp 0x4067a0
test eax, eax
je 0x4067a0
mov edx, dword [esp + 0x18]
cmp dword [edx - 0x48], 2
jge 0x4067a0
lea eax, [esp + 0x28]
push str.SetPortVerified_1_
push eax
call edi
lea ecx, [esp + 0x30]
push 1
push ecx
call fcn.00402a00
mov edx, dword [esp + 0x20]
add esp, 0x10
mov eax, dword [edx + 0x24c]
mov edx, dword [esp + 0x1c]
push 1
push edx
mov ecx, dword [eax]
push eax
call dword [ecx + 0x3c]
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
mov esi, dword [ecx + 0x284]
inc edx
add eax, 4
add ebp, 0x10
cmp edx, esi
mov dword [esp + 0x14], edx
mov dword [esp + 0x18], eax
jb 0x4065fe
mov eax, dword [esp + 0x1c]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x418
ret 4
pop edi
pop esi
pop ebp
mov eax, edx
pop ebx
add esp, 0x418
ret 4