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

Disassembly:
sub esp, 0x930
push ebp
push esi
xor esi, esi
push 6
push esi
push esi
push esi
call dword [sym.imp.SETUPAPI.dll_SetupDiGetClassDevsW]
mov ebp, eax
cmp ebp, 0xffffffff
mov dword [esp + 0x20], ebp
je 0x40dc18
push edi
mov ecx, 0xff
xor eax, eax
lea edi, [esp + 0x13e]
mov word [esp + 0x13c], si
mov word [esp + 0x53c], si
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov ecx, 0xff
xor eax, eax
lea edi, [esp + 0x53e]
mov dword [esp + 0x38], 0x400
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [esp + 0x58]
mov dword [esp + 0x10], esi
push eax
push esi
push ebp
mov dword [esp + 0x48], esi
mov dword [esp + 0x40], esi
mov dword [esp + 0x20], esi
mov dword [esp + 0x18], esi
mov dword [esp + 0x64], 0x1c
mov dword [esp + 0x38], esi
call dword [sym.imp.SETUPAPI.dll_SetupDiEnumDeviceInfo]
test eax, eax
je 0x40dbf0
push ebx
lea ecx, [esp + 0x10]
mov ebx, dword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceRegistryPropertyW]
push ecx
push esi
lea edx, [esp + 0x34]
push esi
push edx
lea eax, [esp + 0x6c]
push 1
push eax
push ebp
mov dword [esp + 0x3c], esi
mov dword [esp + 0x2c], esi
call ebx
test eax, eax
jne 0x40dbd1
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x40d8ed
mov ecx, dword [esp + 0x10]
push ecx
call sub.MFC42u.DLL_operatornew
mov ecx, dword [esp + 0x14]
add esp, 4
lea edx, [esp + 0x10]
mov dword [esp + 0x20], eax
push edx
push ecx
lea edx, [esp + 0x34]
push eax
push edx
lea eax, [esp + 0x6c]
push 1
push eax
push ebp
call ebx
test eax, eax
je 0x40d8b3
mov edi, dword [esp + 0x20]
cmp edi, esi
je 0x40dbd1
push 0x204
call sub.MFC42u.DLL_operatornew
mov ebp, eax
add esp, 4
lea eax, [esp + 0x3c]
mov dword [esp + 0x24], ebp
mov dword [ebp], esi
mov ecx, dword [esp + 0x10]
mov edx, ecx
mov esi, edi
mov edi, ebp
push eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
push 0x400
and ecx, 3
lea edx, [esp + 0x34]
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x148]
lea eax, [esp + 0x64]
push ecx
mov ecx, dword [esp + 0x34]
push edx
push 9
push eax
push ecx
mov dword [esp + 0x58], 0x400
call ebx
mov esi, dword [sym.imp.USER32.dll_wsprintfW]
lea edx, [esp + 0x140]
push edx
push str.SYSTEMCurrentControlSetControlClass
lea eax, [esp + 0x548]
push str._s_s
push eax
call esi
add esp, 0x10
lea ecx, [esp + 0x40]
lea edx, [esp + 0x14]
xor edi, edi
push ecx
push edx
push edi
push 0xf003f
push edi
push edi
lea eax, [esp + 0x558]
push edi
push eax
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
test eax, eax
jne 0x40da5b
mov ebx, dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
lea ecx, [esp + 0x18]
lea edx, [esp + 0x44]
push ecx
mov ecx, dword [esp + 0x18]
lea eax, [esp + 0x3c]
push edx
push eax
push edi
push str.DriverDateData
push ecx
mov dword [esp + 0x30], 8
call ebx
test eax, eax
jne 0x40da16
lea edx, [esp + 0x4c]
lea eax, [esp + 0x44]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_FileTimeToSystemTime]
mov ecx, dword [esp + 0x4c]
mov edx, dword [esp + 0x52]
mov eax, dword [esp + 0x4e]
and ecx, 0xffff
and edx, 0xffff
push ecx
and eax, 0xffff
push edx
push eax
lea ecx, [ebp + 0x1c8]
push str._02d__02d__04d
push ecx
call esi
add esp, 0x14
lea edx, [esp + 0x18]
lea eax, [esp + 0x78]
push edx
mov edx, dword [esp + 0x18]
lea ecx, [esp + 0x3c]
push eax
push ecx
push edi
push str.DriverVersion
push edx
mov dword [esp + 0x30], 0xc8
call ebx
test eax, eax
jne 0x40da50
lea eax, [esp + 0x78]
lea ecx, [ebp + 0x100]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov edx, dword [0x4211e8]
mov esi, edx
cmp esi, edx
mov dword [esp + 0x34], esi
jl 0x40dbb5
mov eax, dword [0x4211e4]
lea ebx, [esi + 1]
cmp ebx, edi
jne 0x40daa3
cmp eax, edi
je 0x40da92
push eax
mov dword [esp + 0x28], edx
call sub.MFC42u.DLL_operatordelete
add esp, 4
mov dword [0x4211e4], edi
mov dword [0x4211ec], edi
mov dword [0x4211e8], edi
jmp 0x40dbb5
cmp eax, edi
jne 0x40dae2
lea esi, [ebx*4]
push esi
call sub.MFC42u.DLL_operatornew
mov ecx, esi
mov edi, eax
mov edx, ecx
xor eax, eax
shr ecx, 2
mov dword [0x4211e4], edi
add esp, 4
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov dword [0x4211ec], ebx
mov dword [0x4211e8], ebx
jmp 0x40dbb1
mov ecx, dword [0x4211ec]
cmp ebx, ecx
jg 0x40db1b
cmp edx, ebx
jge 0x40db08
mov ecx, ebx
sub ecx, edx
lea edx, [eax + edx*4]
xor eax, eax
mov edi, edx
rep stosd dword es:[edi], eax
mov dword [0x4211e8], ebx
jmp 0x40dbb5
jle 0x40db10
sub edx, ebx
mov dword [esp + 0x24], edx
mov dword [0x4211e8], ebx
jmp 0x40dbb5
mov eax, dword [0x4211f0]
cmp eax, edi
jne 0x40db47
mov eax, edx
cdq
and edx, 7
add eax, edx
sar eax, 3
cmp eax, 4
jge 0x40db3b
mov eax, 4
jmp 0x40db47
cmp eax, 0x400
jle 0x40db47
mov eax, 0x400
add eax, ecx
cmp ebx, eax
mov dword [esp + 0x1c], eax
jl 0x40db55
mov dword [esp + 0x1c], ebx
mov eax, dword [esp + 0x1c]
lea ecx, [eax*4]
push ecx
call sub.MFC42u.DLL_operatornew
mov ecx, dword [0x4211e8]
mov esi, dword [0x4211e4]
mov ebp, eax
mov edi, ebp
rep movsd dword es:[edi], dword [esi]
mov eax, dword [0x4211e8]
mov ecx, ebx
sub ecx, eax
lea edi, [ebp + eax*4]
xor eax, eax
rep stosd dword es:[edi], eax
mov edx, dword [0x4211e4]
push edx
call sub.MFC42u.DLL_operatordelete
mov eax, dword [esp + 0x24]
mov dword [0x4211e4], ebp
mov ebp, dword [esp + 0x2c]
add esp, 8
mov dword [0x4211e8], ebx
mov dword [0x4211ec], eax
mov esi, dword [esp + 0x34]
mov ecx, dword [0x4211e4]
mov edx, dword [esp + 0x20]
push edx
mov dword [ecx + esi*4], ebp
call sub.MFC42u.DLL_operatordelete
mov ebp, dword [esp + 0x2c]
add esp, 4
xor esi, esi
mov eax, dword [esp + 0x30]
lea ecx, [esp + 0x5c]
inc eax
push ecx
push eax
push ebp
mov dword [esp + 0x3c], eax
call dword [sym.imp.SETUPAPI.dll_SetupDiEnumDeviceInfo]
test eax, eax
jne 0x40d887
pop ebx
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
test eax, eax
pop edi
je 0x40dc11
call esi
cmp eax, 0x103
je 0x40dc11
pop esi
xor eax, eax
pop ebp
add esp, 0x930
ret
push ebp
call dword [sym.imp.SETUPAPI.dll_SetupDiDestroyDeviceInfoList]
pop esi
mov eax, 1
pop ebp
add esp, 0x930
ret