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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
and dword [ebp - 0x10], 0
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
push 4
xor edi, edi
mov byte [ebp - 3], 0
mov dl, byte [esi + 2]
mov byte [ebp - 4], 0
mov byte [ebp - 2], 0
mov word [ebp - 8], di
mov byte [ebp + 0xb], dl
pop eax
mov dword [ebp - 0x1c], eax
cmp dl, 0x28
jne 0x40675b
xor ecx, ecx
xor bl, bl
mov dword [ebp - 0xc], ecx
cmp dword [esi + 0x14], ecx
jne 0x406761
and dword [ebp - 0x14], ecx
mov ecx, dword [esi + 0x38]
mov dword [ebp - 0x18], ecx
test ecx, ecx
je 0x406757
lea eax, [esi + 0x5c]
mov edx, ecx
mov dword [ebp - 0x20], eax
mov ecx, dword [eax]
cmp ecx, 0x60
jb 0x406702
mov edx, dword [esi + 0x10]
cmp ecx, edx
jae 0x4066ff
mov eax, dword [ecx + esi]
sub eax, 0x40
je 0x40673a
sub eax, 1
je 0x40671e
sub eax, 1
jne 0x4066f5
lea eax, [ecx + 0x20]
cmp eax, edx
jbe 0x40673f
mov ecx, dword [ebp - 0xc]
test bl, bl
jne 0x406716
mov eax, dword [ebp - 0x20]
mov edx, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x14]
add eax, 4
inc ecx
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x14], ecx
cmp ecx, edx
jb 0x4066ce
mov ecx, dword [ebp - 0xc]
mov dl, byte [ebp + 0xb]
push 4
pop eax
jmp 0x406761
lea eax, [ecx + 0x34]
cmp eax, edx
ja 0x4066f5
xor eax, eax
lea ebx, [eax + 1]
cmp byte [ecx + esi + 0xa], al
jbe 0x406713
add ecx, 0x14
add ecx, esi
mov dword [ebp - 0xc], ecx
jmp 0x4066f8
lea eax, [ecx + 0x24]
jmp 0x406721
mov dl, byte [ebp + 0xb]
push 4
pop eax
cmp dword [ecx + esi + 0xc], edi
jbe 0x406752
add ecx, 0x1c
add ecx, esi
jmp 0x40675e
mov ecx, dword [ebp - 0xc]
jmp 0x406761
mov ecx, edi
jmp 0x406761
lea ecx, [esi + 0x30]
mov dword [ebp - 0xc], ecx
cmp dl, 0x28
jne 0x40680a
xor ebx, ebx
mov byte [ebp - 1], bl
cmp dword [esi + 0x14], ebx
jne 0x40680d
mov ecx, dword [esi + 0x38]
xor edx, edx
mov dword [ebp - 0x18], edx
mov dword [ebp - 0x14], ecx
test ecx, ecx
je 0x406802
lea ecx, [esi + 0x5c]
mov dword [ebp - 0x20], ecx
mov ecx, dword [ecx]
cmp ecx, 0x60
jb 0x4067f1
mov edx, dword [esi + 0x10]
cmp ecx, edx
jae 0x4067ee
mov eax, dword [ecx + esi]
sub eax, 0x40
je 0x4067cc
sub eax, 1
je 0x4067c7
sub eax, 1
jne 0x4067e5
lea eax, [ecx + 0x20]
cmp eax, edx
ja 0x4067e5
mov dl, byte [ebp + 0xb]
cmp dword [ecx + esi + 0xc], edi
jbe 0x4067c2
lea ebx, [esi + 0x1c]
add ebx, ecx
mov ecx, dword [ebp - 0xc]
jmp 0x40680d
lea eax, [ecx + 0x34]
jmp 0x4067cf
lea eax, [ecx + 0x24]
cmp eax, edx
ja 0x4067e5
xor eax, eax
inc eax
cmp byte [ecx + esi + 0xa], 0
mov byte [ebp - 1], al
jbe 0x406802
lea ebx, [esi + 0x14]
add ebx, ecx
cmp byte [ebp - 1], 0
jne 0x406802
push 4
pop eax
mov edx, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x20]
inc edx
add ecx, eax
mov dword [ebp - 0x18], edx
mov dword [ebp - 0x20], ecx
cmp edx, dword [ebp - 0x14]
jb 0x40678d
mov ecx, dword [ebp - 0xc]
mov dl, byte [ebp + 0xb]
jmp 0x40680d
lea ebx, [esi + 0x30]
movzx ecx, byte [ecx + 3]
movzx eax, byte [ebx + 4]
shl cx, 8
or cx, ax
movzx eax, cx
mov dword [ebp - 0xc], eax
cmp dl, 0x28
jne 0x40682c
mov eax, dword [esi + 0x54]
jmp 0x40682f
mov eax, dword [esi + 0x28]
mov ebx, dword [eax]
lea ecx, [ebp - 0x10]
push ecx
push eax
mov dword [ebp - 0x14], ebx
call fcn.00403bb0
test eax, eax
je 0x40684e
push eax
push esi
call fcn.0040515e
jmp 0x406a53
mov eax, dword [ebx]
push 8
pop ecx
add eax, ecx
push eax
push ebx
call sub.storport.sys_StorPortReadRegisterUlong
xor ebx, ebx
mov ecx, eax
shr ecx, 0x10
inc ebx
cmp cx, bx
jne 0x406870
mov dl, bl
test ax, ax
je 0x406873
mov dl, byte [ebp - 2]
mov ecx, dword [ebp - 0x10]
mov dh, bl
mov eax, dword [ecx + 0x78]
or eax, dword [ecx + 0x7c]
jne 0x406883
mov dh, byte [ebp - 3]
mov eax, dword [ecx + 0x70]
or eax, dword [ecx + 0x74]
jne 0x406893
mov eax, dword [ecx + 0x68]
or eax, dword [ecx + 0x6c]
je 0x406897
mov cl, bl
jmp 0x40689a
mov cl, byte [ebp - 4]
push 4
pop eax
mov ebx, eax
test dh, dh
je 0x4068aa
xor ebx, ebx
lea edi, [ebx + 1]
jmp 0x4068b2
cmp dl, 1
jne 0x4068c7
push 2
pop edi
mov word [ebp - 8], di
push 0x18
pop ebx
cmp dl, 1
jne 0x4068c7
push 0x4d
or di, 0x10
pop ebx
jmp 0x4068e2
cmp cl, 1
jne 0x4068d7
push 8
pop eax
or di, ax
add ebx, 0x3c
jmp 0x4068ed
cmp dh, 1
jne 0x4068e6
or di, ax
add ebx, 0x2c
mov word [ebp - 8], di
xor eax, eax
inc eax
cmp cl, al
jne 0x406900
push 0x40
pop eax
or di, ax
mov eax, 0x200
or di, ax
add ebx, 0x3c
jmp 0x406924
cmp dh, al
jne 0x406915
or di, 0x20
mov eax, 0x100
or di, ax
add ebx, 0x24
jmp 0x406924
cmp dl, al
jne 0x406928
mov eax, 0x80
or di, ax
add ebx, 0x48
mov word [ebp - 8], di
movzx eax, bx
push eax
push dword [ebp - 0x14]
mov dword [ebp + 8], eax
call fcn.00401562
mov edi, eax
test edi, edi
jne 0x406944
push 5
jmp 0x406843
push dword [ebp + 8]
push 0
push edi
call fcn.00413c50
add esp, 0xc
mov word [edi], 0x8300
lea eax, [edi + 4]
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0xc]
push 4
pop edx
mov dword [ebp + 8], edx
cmp dx, ax
jae 0x4069fb
push dword [ebp - 0x14]
lea ecx, [ebp - 0x18]
push dword [ebp - 0x10]
push ecx
push eax
lea eax, [ebp + 8]
push eax
lea eax, [ebp - 8]
push eax
call fcn.00404008
xor ecx, ecx
inc ecx
cmp al, cl
jne 0x4069f2
push dword [ebp - 0x14]
lea eax, [ebp - 0x18]
push dword [ebp - 0x10]
push eax
push dword [ebp - 0xc]
lea eax, [ebp + 8]
push eax
lea eax, [ebp - 8]
push eax
call fcn.00404630
xor ecx, ecx
inc ecx
cmp al, cl
jne 0x4069f2
push dword [ebp - 0x14]
lea eax, [ebp - 0x18]
push dword [ebp - 0x10]
push eax
push dword [ebp - 0xc]
lea eax, [ebp + 8]
push eax
lea eax, [ebp - 8]
push eax
call fcn.004043da
xor ecx, ecx
inc ecx
cmp al, cl
jne 0x4069f2
push dword [ebp - 0x14]
lea eax, [ebp - 0x18]
push dword [ebp - 0x10]
push eax
push dword [ebp - 0xc]
lea eax, [ebp + 8]
push eax
lea eax, [ebp - 8]
push eax
call fcn.00403d0e
mov edx, dword [ebp + 8]
mov dword [ebp - 0x1c], edx
jmp 0x4069f8
mov eax, dword [ebp + 8]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0xc]
mov cl, byte [esi + 2]
mov byte [ebp + 0xb], cl
cmp cl, 0x28
jne 0x406a0b
mov edx, dword [esi + 0x40]
jmp 0x406a0e
mov edx, dword [esi + 0x18]
mov ecx, dword [ebp - 0x1c]
cmp cx, ax
movzx ecx, cx
jb 0x406a1c
movzx ecx, ax
cmp byte [ebp + 0xb], 0x28
movzx eax, cx
jne 0x406a2a
mov dword [esi + 0x3c], eax
jmp 0x406a2d
mov dword [esi + 0x10], eax
sub bl, 4
mov byte [edi + 3], bl
test cx, cx
je 0x406a43
push eax
push edi
push edx
call fcn.00413910
add esp, 0xc
push edi
push dword [ebp - 0x14]
xor eax, eax
inc eax
push eax
call sub.storport.sys_StorPortExtendedFunction
add esp, 0xc
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4