Function at 0x4154d0
Capabilities:
Query or enumerate registry value
Resolve function by parsing pe exports

Disassembly:
push ebp
push edi
mov ebp, edx
push esi
push ebx
mov edi, eax
mov ebx, ecx
sub esp, 0x27c
mov dword [esp + 4], 0x47ade8
mov dword [esp], str.detect_ports_NT.log
mov dword [esp + 0x4c], 0
call sub.msvcrt.dll_fopen
test eax, eax
mov esi, eax
je 0x4155e2
mov dword [esp + 0x14], 4
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], ebp
mov dword [esp + 8], edi
mov dword [esp + 4], str.Enter_DetectPortsNT__s___s___p___d__n
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
lea edx, [ebx + 4]
mov eax, ebx
mov dword [ebx], 0
mov dword [ebx + 0x1c], 0
xor ecx, ecx
and edx, 0xfffffffc
sub eax, edx
add eax, 0x20
and eax, 0xfffffffc
mov dword [edx + ecx], 0
add ecx, 4
cmp ecx, eax
jb 0x415549
lea eax, [esp + 0x50]
mov dword [esp + 0xc], 9
mov dword [esp + 8], 0
mov dword [esp + 4], str.SYSTEMCurrentControlSet
mov dword [esp], 0x80000002
mov dword [esp + 0x10], eax
mov eax, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
mov dword [esp + 0x2c], eax
call eax
sub esp, 0x14
test eax, eax
je 0x4156b5
mov dword [esp + 8], eax
mov dword [esp + 4], str.RegOpenKeyEx_HKEY_LOCAL_MACHINE__SYSTEMCurrentControlSet__Failed_with_code__ld_n
mov dword [esp], esi
call sub.msvcrt.dll_fprintf
mov eax, dword [esp + 0x4c]
mov dword [esp + 4], str.Enter_DetectPortsNT____Count___d_n
mov dword [esp], esi
mov dword [esp + 8], eax
call sub.msvcrt.dll_fprintf
mov dword [esp], esi
call sub.msvcrt.dll_fclose
mov eax, dword [esp + 0x4c]
mov edx, 4
cmp eax, 4
cmovge eax, edx
add esp, 0x27c
pop ebx
pop esi
pop edi
pop ebp
ret
lea edx, [ebx + 4]
mov eax, ebx
mov dword [ebx], 0
mov dword [ebx + 0x1c], 0
xor ecx, ecx
and edx, 0xfffffffc
sub eax, edx
add eax, 0x20
and eax, 0xfffffffc
mov dword [edx + ecx], 0
add ecx, 4
cmp ecx, eax
jb 0x415601
lea eax, [esp + 0x50]
mov dword [esp + 0xc], 9
mov dword [esp + 8], 0
mov dword [esp + 4], str.SYSTEMCurrentControlSet
mov dword [esp], 0x80000002
mov dword [esp + 0x10], eax
mov eax, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
mov dword [esp + 0x2c], eax
call eax
sub esp, 0x14
test eax, eax
jne 0x4155c8
mov eax, dword [sym.imp.msvcrt.dll__snprintf]
mov dword [esp + 0xc], edi
lea edi, [esp + 0x68]
mov dword [esp + 8], str.Services_sEnum
mov dword [esp + 4], 0x104
mov dword [esp], edi
mov dword [esp + 0x34], eax
call eax
lea eax, [esp + 0x54]
mov dword [esp + 0xc], 9
mov dword [esp + 8], 0
mov dword [esp + 4], edi
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x50]
mov dword [esp], eax
call dword [esp + 0x2c]
sub esp, 0x14
test eax, eax
je 0x415740
mov eax, dword [esp + 0x50]
mov dword [esp], eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
sub esp, 4
jmp 0x4155c8
mov eax, dword [sym.imp.msvcrt.dll__snprintf]
mov dword [esp + 0xc], edi
lea edi, [esp + 0x68]
mov dword [esp + 8], str.Services_sEnum
mov dword [esp + 4], 0x104
mov dword [esp], edi
mov dword [esp + 0x34], eax
call eax
lea eax, [esp + 0x54]
mov dword [esp + 0xc], 9
mov dword [esp + 8], 0
mov dword [esp + 4], edi
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x50]
mov dword [esp], eax
call dword [esp + 0x2c]
sub esp, 0x14
test eax, eax
je 0x415740
mov dword [esp + 0xc], eax
mov dword [esp + 8], edi
mov dword [esp + 4], str.RegOpenKeyEx__s__Failed_with_code__ld_n
mov dword [esp], esi
call sub.msvcrt.dll_fprintf
mov eax, dword [esp + 0x50]
mov dword [esp], eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
sub esp, 4
jmp 0x4155a8
lea eax, [esp + 0x58]
mov dword [esp + 0x58], 4
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], str.Count
mov dword [esp + 0x14], eax
lea eax, [esp + 0x4c]
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x54]
mov dword [esp], eax
mov eax, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
mov dword [esp + 0x30], eax
call eax
sub esp, 0x18
test eax, eax
jne 0x415970
test esi, esi
je 0x4157a9
mov eax, dword [esp + 0x4c]
mov dword [esp + 4], str.Port_count:__d__n
mov dword [esp], esi
mov dword [esp + 8], eax
call sub.msvcrt.dll_fprintf
mov edx, dword [esp + 0x4c]
xor eax, eax
test edx, edx
jle 0x4159b0
mov dword [esp + 0x38], ebp
mov dword [esp + 0x3c], ebx
mov ebx, eax
mov ebp, dword [esp + 0x34]
jmp 0x41585b
mov dword [esp + 8], ebx
mov dword [esp + 4], str.Cycle:__d__PNPPath:__s_n
mov dword [esp], esi
call sub.msvcrt.dll_fprintf
lea eax, [esp + 0x16c]
mov dword [esp + 8], str.Enum_sDevice_Parameters
mov dword [esp + 4], 0x104
mov dword [esp], edi
mov dword [esp + 0xc], eax
call ebp
lea eax, [esp + 0x5c]
mov dword [esp + 0xc], 9
mov dword [esp + 8], 0
mov dword [esp + 4], edi
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x50]
mov dword [esp], eax
call dword [esp + 0x2c]
sub esp, 0x14
test eax, eax
je 0x41590f
mov dword [esp + 0xc], eax
mov dword [esp + 8], edi
mov dword [esp + 4], str.RegOpenKeyEx__s__Failed_with_code__ld_n
mov dword [esp], esi
call sub.msvcrt.dll_fprintf
add ebx, 1
cmp dword [esp + 0x4c], ebx
jle 0x4159b0
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 0x47ae55
mov dword [esp + 4], 0x104
mov dword [esp], edi
call ebp
lea eax, [esp + 0x58]
mov dword [esp + 0x58], 0x104
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], edi
mov dword [esp + 0x14], eax
lea eax, [esp + 0x16c]
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x54]
mov dword [esp], eax
call dword [esp + 0x30]
sub esp, 0x18
test eax, eax
jne 0x41584e
lea eax, [esp + 0x16c]
test esi, esi
mov dword [esp + 0xc], eax
jne 0x4157d0
mov dword [esp + 8], str.Enum_sDevice_Parameters
mov dword [esp + 4], 0x104
mov dword [esp], edi
call ebp
lea eax, [esp + 0x5c]
mov dword [esp + 0xc], 9
mov dword [esp + 8], 0
mov dword [esp + 4], edi
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x50]
mov dword [esp], eax
call dword [esp + 0x2c]
sub esp, 0x14
test eax, eax
jne 0x41584e
lea eax, [esp + 0x58]
mov dword [esp + 0x58], 0x104
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x5c]
mov dword [esp + 4], str.PortName
mov dword [esp], eax
call dword [esp + 0x30]
sub esp, 0x18
test eax, eax
je 0x4159e0
mov eax, dword [esp + 0x5c]
mov dword [esp], eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
sub esp, 4
jmp 0x41584e
test esi, esi
je 0x415a90
mov dword [esp + 8], eax
mov dword [esp + 4], str.RegQueryValueEx_Count__Failed_with_code__ld_n
mov dword [esp], esi
call sub.msvcrt.dll_fprintf
mov eax, dword [esp + 0x54]
mov ebx, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov dword [esp], eax
call ebx
sub esp, 4
mov eax, dword [esp + 0x50]
mov dword [esp], eax
call ebx
sub esp, 4
jmp 0x4155a8
mov eax, dword [esp + 0x54]
mov dword [esp], eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
sub esp, 4
mov eax, dword [esp + 0x50]
mov dword [esp], eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
sub esp, 4
test esi, esi
jne 0x4155a8
jmp 0x4155c8
lea eax, [esp + 0x60]
mov dword [esp], edi
mov dword [esp + 8], eax
mov eax, dword [esp + 0x38]
mov dword [esp + 4], eax
call sub.msvcrt.dll_sscanf
cmp eax, 1
jne 0x415951
mov eax, dword [esp + 0x60]
sub eax, 1
cmp eax, 3
mov dword [esp + 0x60], eax
ja 0x415951
lea eax, [esp + 0x16c]
mov dword [esp + 8], str.Enum_sControl
mov dword [esp + 4], 0x104
mov dword [esp], edi
mov dword [esp + 0xc], eax
call ebp
lea eax, [esp + 0x64]
mov dword [esp + 0xc], 9
mov dword [esp + 8], 0
mov dword [esp + 4], edi
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x50]
mov dword [esp], eax
call dword [esp + 0x2c]
sub esp, 0x14
test eax, eax
je 0x415ab3
test esi, esi
je 0x415951
mov dword [esp + 0xc], eax
mov dword [esp + 8], edi
mov dword [esp + 4], str.RegOpenKeyEx__s__Failed_with_code__ld_n
mov dword [esp], esi
call sub.msvcrt.dll_fprintf
jmp 0x415951
mov eax, dword [esp + 0x54]
mov ebx, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov dword [esp], eax
call ebx
sub esp, 4
mov eax, dword [esp + 0x50]
mov dword [esp], eax
call ebx
sub esp, 4
jmp 0x4155c8
lea eax, [esp + 0x58]
mov dword [esp + 0x58], 0x104
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x64]
mov dword [esp + 4], str.AllocConfig
mov dword [esp], eax
call dword [esp + 0x30]
sub esp, 0x18
test eax, eax
jne 0x415bb4
mov edx, dword [esp + 0x78]
lea eax, [edx - 2]
cmp eax, 3
ja 0x415b9f
mov eax, dword [esp + 0x80]
mov ecx, eax
mov dword [esp + 0x34], eax
shr ecx, 0x10
test ecx, ecx
jne 0x415b9f
cmp eax, 0x100
jbe 0x415b9f
cmp dword [esp + 0x84], 0
jne 0x415b9f
mov ecx, dword [esp + 0x88]
lea eax, [ecx - 8]
cmp eax, 7
ja 0x415b9f
test esi, esi
je 0x415b8b
mov eax, dword [esp + 0x34]
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x18], 0
mov dword [esp + 0xc], edx
mov dword [esp + 4], str.p_p__0__lu___1__lu___2__lxh___3__lxh___4__lu_n
mov dword [esp], esi
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x7c]
mov dword [esp + 0x10], eax
lea eax, [esp + 0x78]
mov dword [esp + 8], eax
call sub.msvcrt.dll_fprintf
mov eax, dword [esp + 0x80]
mov ecx, dword [esp + 0x88]
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x3c]
mov edx, dword [esp + 0x60]
lea edx, [eax + edx*8]
mov eax, dword [esp + 0x34]
mov dword [edx + 4], ecx
mov dword [edx], eax
mov eax, dword [esp + 0x64]
mov dword [esp], eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
sub esp, 4
jmp 0x415951
test esi, esi
je 0x415b9f
mov dword [esp + 8], eax
mov dword [esp + 4], str.RegQueryValueEx_AllocConfig__Failed_with_code__ld_n
mov dword [esp], esi
call sub.msvcrt.dll_fprintf
jmp 0x415b9f