Function at 0x401160
Capabilities:
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x50
mov eax, dword [0x40e0b4]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
mov esi, dword [ebp + 0xc]
push edi
mov edi, dword [ebp + 8]
push str.____isDeviceInstalled_n
push 0
push 4
mov dword [ebp - 0x44], edi
mov dword [ebp - 0x4c], esi
mov dword [ebp - 0x40], 0
call fcn.00402500
push edi
push str._pHardwareID___1_s__n
push 0
push 4
call fcn.00402500
push esi
push str._pCreateFileName___1_s__n
push 0
push 4
call fcn.00402500
add esp, 0x2c
lea eax, [ebp - 0x50]
push eax
push 1
lea ecx, [ebp - 0x30]
push ecx
push str.Image
call dword [sym.imp.SETUPAPI.dll_SetupDiClassGuidsFromNameA]
test eax, eax
jne 0x4011ef
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
push esi
push str._SetupDiClassGuidsFromName_failed_0x_1_x__._n
push 0
push 2
call fcn.00402500
add esp, 0x10
test esi, esi
jne 0x401384
push ebx
push 0x10
push 0
push 0
lea edx, [ebp - 0x30]
push edx
call dword [sym.imp.SETUPAPI.dll_SetupDiGetClassDevsA]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x401383
push 0x1000
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
test esi, esi
je 0x40137c
lea eax, [ebp - 0x20]
push eax
push 0
push ebx
mov dword [ebp - 0x20], 0x1c
mov dword [ebp - 0x38], 0
call dword [sym.imp.SETUPAPI.dll_SetupDiEnumDeviceInfo]
test eax, eax
je 0x40136c
jmp 0x401253
mov edi, dword [ebp - 0x44]
lea ecx, [ebp - 0x3c]
push ecx
push 0x1000
push esi
lea edx, [ebp - 0x48]
push edx
push 1
lea eax, [ebp - 0x20]
push eax
push ebx
call dword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceRegistryPropertyA]
test eax, eax
je 0x401351
push esi
push str._HardwareID___1_s__n
push 0
push 4
call fcn.00402500
add esp, 0x10
push edi
push esi
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x401351
push 0x80000000
push 2
push eax
push 1
lea ecx, [ebp - 0x20]
push ecx
push ebx
call dword [sym.imp.SETUPAPI.dll_SetupDiOpenDevRegKey]
mov edi, eax
cmp edi, 0xffffffff
je 0x401339
lea edx, [ebp - 0x34]
push edx
push 0x20019
push 0
push str.DeviceData
push edi
mov dword [ebp - 0x34], 0
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x401330
mov edx, dword [ebp - 0x34]
lea eax, [ebp - 0x3c]
push eax
push esi
lea ecx, [ebp - 0x48]
push ecx
push 0
push str.PortName
push edx
mov dword [ebp - 0x3c], 0x1000
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x401326
push esi
push str._PortName_CreateFileName____1_s__n
push eax
push 4
call fcn.00402500
mov eax, dword [ebp - 0x4c]
add esp, 0x10
push eax
push esi
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x401326
mov dword [ebp - 0x40], 1
mov ecx, dword [ebp - 0x34]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push edi
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x401351
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str._SetupDiOpenDevRegKey_failed.__0x_1_x__._n
push 0
push 2
call fcn.00402500
add esp, 0x10
mov eax, dword [ebp - 0x38]
lea edx, [ebp - 0x20]
inc eax
push edx
push eax
push ebx
mov dword [ebp - 0x38], eax
call dword [sym.imp.SETUPAPI.dll_SetupDiEnumDeviceInfo]
test eax, eax
jne 0x401250
push esi
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
push ebx
call dword [sym.imp.SETUPAPI.dll_SetupDiDestroyDeviceInfoList]
pop ebx
mov esi, dword [ebp - 0x40]
push esi
push str.____isDeviceInstalled__1_d__n
push 0
push 4
call fcn.00402500
mov ecx, dword [ebp - 4]
add esp, 0x10
pop edi
mov eax, esi
xor ecx, ebp
pop esi
call fcn.00403171
mov esp, ebp
pop ebp
ret