Function at 0x407980
Capabilities:
Query or enumerate registry value

Disassembly:
sub esp, 0xc5c
push ebx
push ebp
mov ebp, dword [esp + 0xc68]
push esi
push edi
mov dword [esp + 0x18], ecx
mov edx, dword [ebp + 8]
mov ebx, dword [ebp + 4]
mov eax, edx
cmp eax, edx
je 0x4079bb
mov esi, eax
mov edi, ebx
add eax, 0x60c
mov ecx, 0x183
add ebx, 0x60c
cmp eax, edx
rep movsd dword es:[edi], dword [esi]
jne 0x4079a1
mov eax, dword [ebp + 8]
mov ecx, ebp
push eax
push ebx
call fcn.00428ee0
push 0x12
push 0
push 0
push 0x474df0
mov dword [ebp + 8], ebx
call dword [sym.imp.SETUPAPI.dll_SetupDiGetClassDevsW]
mov esi, eax
cmp esi, 0xffffffff
jne 0x4079f1
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc5c
ret 4
mov ebx, dword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceRegistryPropertyW]
mov dword [esp + 0x38], 0x1c
mov dword [esp + 0x10], 0
mov edx, dword [esp + 0x10]
mov ecx, 0x183
xor eax, eax
lea edi, [esp + 0x54]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x38]
push ecx
push edx
push 0x474df0
push eax
push esi
call dword [sym.imp.SETUPAPI.dll_SetupDiEnumDeviceInterfaces]
test eax, eax
je 0x407af6
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x38]
push eax
push 0
push 0
push 0
push ecx
push esi
mov dword [esp + 0x34], 0x1c
call dword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceInterfaceDetailW]
test eax, eax
jne 0x407a61
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x407a07
push 0
lea edx, [esp + 0x25c]
push 0x200
push edx
push 0
lea eax, [esp + 0x2c]
push 0xc
push eax
push esi
call ebx
push 0
lea ecx, [esp + 0x45c]
push 0x200
push ecx
push 0
lea edx, [esp + 0x2c]
push 0
push edx
push esi
call ebx
push 0x20019
push 1
push 0
lea eax, [esp + 0x28]
push 1
push eax
push esi
call dword [sym.imp.SETUPAPI.dll_SetupDiOpenDevRegKey]
mov edi, eax
cmp edi, 0xffffffff
je 0x407ade
lea ecx, [esp + 0x14]
lea edx, [esp + 0x58]
push ecx
push edx
push 0
push 0
push str.PortName
push edi
mov dword [esp + 0x2c], 0x100
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
push edi
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ecx, dword [esp + 0x18]
lea eax, [esp + 0x54]
push ebp
push eax
call fcn.00407d70
inc dword [esp + 0x10]
jmp 0x407a07
push esi
call dword [sym.imp.SETUPAPI.dll_SetupDiDestroyDeviceInfoList]
mov ebx, dword [ebp + 4]
test ebx, ebx
mov dword [esp + 0x18], ebx
je 0x407d22
mov esi, dword [ebp + 8]
mov eax, 0x54abfd5b
mov ecx, esi
mov dword [esp + 0x14], esi
sub ecx, ebx
imul ecx
sar edx, 9
mov ecx, edx
shr ecx, 0x1f
add edx, ecx
je 0x407d22
mov ecx, esi
mov eax, 0x54abfd5b
sub ecx, ebx
imul ecx
sar edx, 9
mov eax, edx
shr eax, 0x1f
add edx, eax
cmp edx, 0x10
jg 0x407b5e
push 0
push fcn.00407d60
push esi
push ebx
call fcn.00408fa0
add esp, 0x10
jmp 0x407d22
cmp edx, 0x10
mov ebp, esi
jle 0x407c75
push fcn.00407d60
push fcn.00407d60
sub esp, 0x60c
lea esi, [ebp - 0x60c]
mov ecx, 0x183
mov edi, esp
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
mov eax, 0x54abfd5b
sub ecx, ebx
sub esp, 0x60c
imul ecx
sar edx, 9
mov ecx, edx
mov eax, edx
shr ecx, 0x1f
add eax, ecx
mov edi, esp
cdq
sub eax, edx
sub esp, 0x60c
sar eax, 1
mov ecx, eax
shl ecx, 7
add ecx, eax
lea eax, [esp + 0x188c]
lea edx, [ecx + ecx*2]
mov ecx, 0x183
lea esi, [ebx + edx*4]
rep movsd dword es:[edi], dword [esi]
mov ecx, 0x183
mov esi, ebx
mov edi, esp
push eax
rep movsd dword es:[edi], dword [esi]
call fcn.004090c0
add esp, 0xc20
mov ecx, 0x183
mov esi, eax
mov edi, esp
push ebp
push ebx
rep movsd dword es:[edi], dword [esi]
call fcn.00409190
mov esi, eax
mov ecx, ebp
sub ecx, esi
mov eax, 0x54abfd5b
imul ecx
mov ecx, edx
mov eax, 0x54abfd5b
sar ecx, 9
mov edx, ecx
add esp, 0x618
shr edx, 0x1f
add ecx, edx
mov edx, esi
sub edx, ebx
push 0
imul edx
sar edx, 9
mov eax, edx
push fcn.00407d60
shr eax, 0x1f
add edx, eax
cmp ecx, edx
jg 0x407c43
push ebp
push esi
call fcn.00408d20
add esp, 0x10
mov ebp, esi
jmp 0x407c4f
push esi
push ebx
call fcn.00408d20
add esp, 0x10
mov ebx, esi
mov ecx, ebp
mov eax, 0x54abfd5b
sub ecx, ebx
imul ecx
sar edx, 9
mov ecx, edx
shr ecx, 0x1f
add edx, ecx
cmp edx, 0x10
jg 0x407b69
mov ebx, dword [esp + 0x18]
mov esi, dword [esp + 0x14]
lea ebp, [ebx + 0x60c0]
push 0
push fcn.00407d60
push ebp
push ebx
call fcn.00408fa0
add esp, 0x10
cmp ebp, esi
je 0x407d1b
lea ebx, [ebp - 0x60c]
mov dword [esp + 0x10], ebx
jmp 0x407ca4
mov ebx, dword [esp + 0x10]
mov ecx, 0x183
mov esi, ebp
lea edi, [esp + 0x660]
lea edx, [esp + 0x660]
rep movsd dword es:[edi], dword [esi]
push ebx
push edx
mov edi, ebp
call fcn.00407d60
add esp, 8
test al, al
je 0x407cf1
mov ecx, 0x183
mov esi, ebx
rep movsd dword es:[edi], dword [esi]
mov edi, ebx
sub ebx, 0x60c
lea eax, [esp + 0x660]
push ebx
push eax
call fcn.00407d60
add esp, 8
test al, al
jne 0x407ccb
mov eax, dword [esp + 0x14]
mov ecx, 0x183
lea esi, [esp + 0x660]
add ebp, 0x60c
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [esp + 0x10]
add ecx, 0x60c
cmp ebp, eax
mov dword [esp + 0x10], ecx
jne 0x407ca0
mov ebp, dword [esp + 0xc70]
mov eax, dword [ebp + 4]
test eax, eax
jne 0x407d36
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc5c
ret 4
mov ecx, dword [ebp + 8]
pop edi
sub ecx, eax
mov eax, 0x54abfd5b
imul ecx
sar edx, 9
mov ecx, edx
pop esi
shr ecx, 0x1f
add edx, ecx
pop ebp
mov eax, edx
pop ebx
add esp, 0xc5c
ret 4