Function at 0x40c190
Capabilities:
Link many functions at runtime

Disassembly:
sub esp, 0xc
mov eax, dword [0x49c508]
mov dword [esp + 4], 0
push ebp
mov ebp, dword [esp + 0x1c]
push esi
push edi
test eax, eax
jne 0x40c1c6
push eax
push str.Setupapi.dll
call fcn.0040e670
add esp, 8
mov dword [0x49c508], eax
test eax, eax
je 0x40c29b
cmp dword [0x49c50c], 0
jne 0x40c1ed
push str.SetupDiGetClassDevsW
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x49c50c], eax
test eax, eax
je 0x40c29b
mov eax, dword [0x49c508]
cmp dword [0x49c510], 0
jne 0x40c214
push str.SetupDiEnumDeviceInfo
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x49c510], eax
test eax, eax
je 0x40c29b
mov eax, dword [0x49c508]
cmp dword [0x49c518], 0
jne 0x40c237
push str.SetupDiGetDeviceRegistryPropertyW
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x49c518], eax
test eax, eax
je 0x40c29b
mov eax, dword [0x49c508]
cmp dword [0x49c514], 0
jne 0x40c25a
push str.SetupDiGetDeviceInterfaceDetailW
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x49c514], eax
test eax, eax
je 0x40c29b
mov eax, dword [0x49c508]
cmp dword [0x49c520], 0
jne 0x40c278
push str.SetupDiDestroyDeviceInfoList
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x49c520], eax
test eax, eax
je 0x40c29b
mov esi, dword [0x49c50c]
mov ecx, esi
push 6
push 0
push 0
push 0
call dword [0x485320]
call esi
mov edi, eax
mov dword [esp + 0x14], edi
cmp edi, 0xffffffff
jne 0x40c2a4
pop edi
pop esi
xor eax, eax
pop ebp
add esp, 0xc
ret
push ebx
push ebp
push 0
mov dword [ebp + 4], 0
mov dword [ebp + 8], 0
mov dword [ebp + 0xc], 0
mov dword [ebp + 0x10], 0
mov dword [ebp + 0x14], 0
mov dword [ebp + 0x18], 0
mov dword [ebp], 0x1c
mov esi, dword [0x49c510]
mov ecx, esi
push edi
call dword [0x485320]
call esi
test eax, eax
je 0x40c45b
mov eax, dword [esp + 0x20]
xor ebx, ebx
mov dword [esp + 0x10], 0
cmp eax, 1
jae 0x40c42d
lea eax, [esp + 0x10]
push eax
push ebx
push ebx
push ebx
push 2
lfence
mov esi, dword [0x49c518]
mov ecx, esi
push ebp
push edi
call dword [0x485320]
call esi
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40c426
lea esi, [eax + 4]
push esi
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov ebx, eax
test ebx, ebx
je 0x40c426
push 0
push esi
mov esi, dword [0x49c518]
mov ecx, esi
push ebx
push 0
push 2
push ebp
push edi
call dword [0x485320]
call esi
test eax, eax
je 0x40c426
cmp word [ebx], 0
mov edi, ebx
je 0x40c405
nop dword [eax + eax]
mov eax, dword [esp + 0x20]
mov esi, dword [eax*4 + 0x499198]
cmp word [esi], 0
je 0x40c3c6
push esi
push edi
call fcn.004305a4
add esp, 8
test eax, eax
jne 0x40c3c0
mov eax, esi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40c3a4
sub eax, edx
sar eax, 1
lea esi, [esi + eax*2]
add esi, 2
cmp word [esi], cx
jne 0x40c391
jmp 0x40c3c6
cmp word [esi], 0
jne 0x40c405
mov ecx, edi
lea edx, [ecx + 2]
nop dword [eax + eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40c3d0
sub ecx, edx
sar ecx, 1
lea edi, [edi + ecx*2]
add edi, 2
cmp word [edi], ax
jne 0x40c380
push ebx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [esp + 0x14]
mov edi, dword [esp + 0x18]
inc eax
push ebp
mov dword [esp + 0x18], eax
push eax
jmp 0x40c2a8
cmp word [edi], 0
jne 0x40c43d
push ebx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [esp + 0x14]
mov edi, dword [esp + 0x18]
inc eax
push ebp
mov dword [esp + 0x18], eax
push eax
jmp 0x40c2a8
push ebx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [esp + 0x14]
inc eax
push ebp
mov dword [esp + 0x18], eax
push eax
jmp 0x40c2a8
push ebx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x18]
pop ebx
pop edi
pop esi
mov dword [eax], ecx
mov eax, 1
pop ebp
add esp, 0xc
ret
mov esi, dword [0x49c520]
mov ecx, esi
push edi
call dword [0x485320]
call esi
pop ebx
pop edi
pop esi
xor eax, eax
pop ebp
add esp, 0xc
ret