Function at 0x40d940
Capabilities:
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x44acf1
mov eax, dword fs:[0]
push eax
sub esp, 0xb00
mov eax, dword [0x45dd50]
xor eax, esp
mov dword [esp + 0xaf8], eax
push ebx
push esi
push edi
mov eax, dword [0x45dd50]
xor eax, esp
push eax
lea eax, [esp + 0xb10]
mov dword fs:[0], eax
mov edi, ecx
mov ebx, dword [edi + 0x14]
lea esi, [edi + 4]
mov dword [esp + 0x28], esi
cmp dword [esi + 0xc], ebx
jbe 0x40d996
call fcn.0042f0b7
mov ecx, dword [esi + 0xc]
mov eax, dword [esi]
mov dword [esp + 0x20], eax
mov dword [esp + 0x18], ecx
cmp ecx, dword [esi + 0x10]
jbe 0x40d9b1
call fcn.0042f0b7
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x20]
mov eax, dword [esi]
push ebx
push edx
push ecx
push eax
lea eax, [esp + 0x28]
push eax
push esi
call fcn.0040e640
mov ecx, 0xe325
push 0x1fe
mov word [esp + 0x34], cx
xor esi, esi
lea ecx, [esp + 0x10a]
mov edx, 0x11ce
xor eax, eax
push esi
push ecx
mov dword [esp + 0x38], 0x4d36e96d
mov word [esp + 0x3e], dx
mov byte [esp + 0x40], 0xbf
mov byte [esp + 0x41], 0xc1
mov byte [esp + 0x42], 8
mov byte [esp + 0x43], 0
mov byte [esp + 0x44], 0x2b
mov byte [esp + 0x45], 0xe1
mov byte [esp + 0x46], 3
mov byte [esp + 0x47], 0x18
mov word [esp + 0x110], ax
call fcn.00431a80
mov edx, dword [edi + 0x1c]
add esp, 0xc
push edx
push esi
push esi
lea eax, [esp + 0x38]
push eax
call dword [sym.imp.SETUPAPI.dll_SetupDiGetClassDevsW]
mov edi, eax
mov dword [esp + 0x20], edi
cmp edi, 0xffffffff
je 0x40dec2
mov ebx, 7
xor ecx, ecx
mov dword [esp + 0x58], 0x1c
mov dword [esp + 0x100], ebx
mov dword [esp + 0xfc], esi
mov word [esp + 0xec], cx
lea edx, [esp + 0x58]
push edx
push esi
mov dword [esp + 0xb20], esi
push edi
mov dword [esp + 0x24], esi
call dword [sym.imp.SETUPAPI.dll_SetupDiEnumDeviceInfo]
test eax, eax
je 0x40dea1
jmp 0x40da9a
xor esi, esi
mov ebx, 7
inc dword [esp + 0x18]
xor eax, eax
xor ecx, ecx
xor edx, edx
mov dword [esp + 0x8c], ebx
mov dword [esp + 0x88], esi
mov word [esp + 0x78], ax
mov dword [esp + 0xa8], ebx
mov dword [esp + 0xa4], esi
mov word [esp + 0x94], cx
mov dword [esp + 0xc4], ebx
mov dword [esp + 0xc0], esi
mov word [esp + 0xb0], dx
mov dword [esp + 0xe0], ebx
mov dword [esp + 0xdc], esi
mov word [esp + 0xcc], ax
push 0x200
lea ecx, [esp + 0x108]
push esi
push ecx
mov byte [esp + 0xb24], 1
call fcn.00431a80
add esp, 0xc
push esi
push 0x100
lea edx, [esp + 0x10c]
push edx
lea eax, [esp + 0x64]
push eax
mov ebx, 0x1c
push edi
mov dword [esp + 0x6c], ebx
call dword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceInstanceIdW]
test eax, eax
je 0x40db74
lea eax, [esp + 0x104]
lea edx, [eax + 2]
jmp 0x40db50
mov cx, word [eax]
add eax, 2
cmp cx, si
jne 0x40db50
sub eax, edx
sar eax, 1
push eax
lea ecx, [esp + 0x108]
push ecx
lea ecx, [esp + 0xd0]
call fcn.00402450
push 0x200
lea edx, [esp + 0x108]
push esi
push edx
call fcn.00431a80
add esp, 0xc
push esi
push 0x200
lea eax, [esp + 0x10c]
push eax
push esi
push 1
lea ecx, [esp + 0x6c]
push ecx
mov dword [esp + 0x70], ebx
mov ebx, dword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceRegistryPropertyW]
push edi
call ebx
test eax, eax
je 0x40dbe4
lea eax, [esp + 0x104]
lea edx, [eax + 2]
jmp 0x40dbc0
mov cx, word [eax]
add eax, 2
cmp cx, si
jne 0x40dbc0
sub eax, edx
sar eax, 1
push eax
lea edx, [esp + 0x108]
push edx
lea ecx, [esp + 0xb4]
call fcn.00402450
push 0x200
lea eax, [esp + 0x108]
push esi
push eax
call fcn.00431a80
add esp, 0xc
push esi
push 0x200
lea ecx, [esp + 0x10c]
push ecx
push esi
push 0xc
lea edx, [esp + 0x6c]
push edx
push edi
mov dword [esp + 0x74], 0x1c
call ebx
test eax, eax
je 0x40dc51
lea eax, [esp + 0x104]
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
cmp cx, si
jne 0x40dc30
sub eax, edx
sar eax, 1
push eax
lea eax, [esp + 0x108]
push eax
lea ecx, [esp + 0x7c]
call fcn.00402450
push 0x20019
push 2
push esi
push 1
lea ecx, [esp + 0x68]
push ecx
push edi
call dword [sym.imp.SETUPAPI.dll_SetupDiOpenDevRegKey]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x40de4e
xor edx, edx
push 0x3fe
push edx
lea eax, [esp + 0x30e]
push eax
mov word [esp + 0x310], dx
call fcn.00431a80
add esp, 0xc
xor ecx, ecx
push 0x3fe
push ecx
lea edx, [esp + 0x70e]
push edx
mov word [esp + 0x710], cx
call fcn.00431a80
add esp, 0xc
lea eax, [esp + 0x14]
push eax
lea ecx, [esp + 0x708]
push ecx
push 0
push 0
lea edx, [esp + 0x20]
push edx
lea eax, [esp + 0x318]
push eax
push 0
push ebx
mov dword [esp + 0x30], 0x200
mov dword [esp + 0x34], 0x400
call dword [sym.imp.ADVAPI32.dll_RegEnumValueW]
test eax, eax
jne 0x40de45
xor ecx, ecx
lea eax, [esp + 0x304]
mov dword [esp + 0x54], 7
mov dword [esp + 0x50], 0
mov word [esp + 0x40], cx
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40dd12
sub eax, edx
sar eax, 1
push eax
lea edx, [esp + 0x308]
push edx
lea ecx, [esp + 0x44]
call fcn.00402450
mov byte [esp + 0xb18], 2
mov eax, dword [esp + 0x50]
push str.AttachedTo
mov edi, 0xa
lea ecx, [esp + 0x40]
call fcn.0040ec30
test eax, eax
je 0x40ddf7
mov byte [esp + 0xb18], 1
cmp dword [esp + 0x54], 8
jb 0x40dd76
mov eax, dword [esp + 0x40]
push eax
call fcn.0042123b
add esp, 4
xor ecx, ecx
push 0x3fe
push ecx
lea edx, [esp + 0x30e]
push edx
inc esi
mov word [esp + 0x310], cx
call fcn.00431a80
add esp, 0xc
xor eax, eax
push 0x3fe
push eax
lea ecx, [esp + 0x70e]
push ecx
mov word [esp + 0x710], ax
call fcn.00431a80
add esp, 0xc
lea edx, [esp + 0x14]
push edx
lea eax, [esp + 0x708]
push eax
push 0
push 0
lea ecx, [esp + 0x20]
push ecx
lea edx, [esp + 0x318]
push edx
push esi
push ebx
mov dword [esp + 0x30], 0x200
mov dword [esp + 0x34], 0x400
call dword [sym.imp.ADVAPI32.dll_RegEnumValueW]
test eax, eax
je 0x40dcf1
jmp 0x40de41
lea eax, [esp + 0x704]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40de01
sub eax, edx
sar eax, 1
push eax
lea eax, [esp + 0x708]
push eax
lea ecx, [esp + 0x98]
call fcn.00402450
mov byte [esp + 0xb18], 1
cmp dword [esp + 0x54], 8
jb 0x40de41
mov ecx, dword [esp + 0x40]
push ecx
call fcn.0042123b
add esp, 4
mov edi, dword [esp + 0x20]
push ebx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
xor esi, esi
cmp dword [esp + 0x88], esi
je 0x40de77
cmp dword [esp + 0xc0], esi
je 0x40de77
cmp dword [esp + 0xdc], esi
je 0x40de77
mov ebx, dword [esp + 0x28]
lea edx, [esp + 0x74]
push edx
call fcn.0040e4d0
lea esi, [esp + 0x74]
mov byte [esp + 0xb18], 0
call fcn.0040def0
mov ecx, dword [esp + 0x18]
lea eax, [esp + 0x58]
push eax
push ecx
push edi
call dword [sym.imp.SETUPAPI.dll_SetupDiEnumDeviceInfo]
test eax, eax
jne 0x40da93
push edi
call dword [sym.imp.SETUPAPI.dll_SetupDiDestroyDeviceInfoList]
cmp dword [esp + 0x100], 8
jb 0x40dec2
mov edx, dword [esp + 0xec]
push edx
call fcn.0042123b
add esp, 4
mov ecx, dword [esp + 0xb10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0xaf8]
xor ecx, esp
call fcn.0042eb3c
mov esp, ebp
pop ebp
ret