Function at 0x416800
Capabilities:
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x224
push ebx
push esi
mov esi, dword [ebp + 0xc]
push edi
mov ebx, ecx
push esi
push str.GetDeviceProfileFromReg_called._mRegHandle__0x_x
mov dword [esp + 0x20], ebx
call fcn.0040a4a0
xor edx, edx
add esp, 8
xor eax, eax
cmp esi, edx
je 0x416ad6
mov ecx, 0x41
lea edi, [esp + 0x20]
rep stosd dword es:[edi], eax
mov eax, dword [ebp + 0x10]
cmp eax, 1
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], edx
mov dword [esp + 0x1c], edx
mov dword [esp + 0x14], edx
jne 0x416861
push str.Connected_
lea eax, [esp + 0x24]
push eax
jmp 0x416875
cmp eax, 2
je 0x41686b
cmp eax, 3
jne 0x41687d
push str.Selected_
lea ecx, [esp + 0x24]
push ecx
call fcn.00416080
add esp, 8
mov eax, dword [ebp + 8]
add eax, 8
mov edx, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x416885
lea edi, [esp + 0x20]
sub eax, edx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x416893
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
lea edx, [esp + 0x20]
and ecx, 3
push edx
rep movsb byte es:[edi], byte [esi]
call fcn.0040a4a0
mov esi, dword [ebp + 0xc]
add esp, 4
lea eax, [esp + 0xc]
push eax
push 0x2001f
push 0
lea ecx, [esp + 0x2c]
push ecx
push esi
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
je 0x416939
push str.GetDeviceProfileFromReg._Profile_doesnt_exist_n
call fcn.0040a4a0
mov eax, dword [ebp + 0x10]
add esp, 4
cmp eax, 1
jne 0x4168f5
test dword [ebx + 0x28], 0x100000
jne 0x416907
cmp dword [ebx + 0x6b4], 0x10
jne 0x41692e
cmp dword [ebx + 0xd9c], 4
jne 0x41692e
push str.GetDeviceProfileFromReg._Try_selected_profile_n
call fcn.0040a4a0
mov eax, dword [ebp + 8]
add esp, 4
push esi
lea ecx, [eax + 8]
push ecx
push eax
mov ecx, ebx
call fcn.00416690
mov ebx, eax
test ebx, ebx
jne 0x416ac5
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
cmp dword [ebp + 0x10], 1
jne 0x416948
test dword [ebx + 0x28], 0x100000
jne 0x416962
cmp dword [ebx + 0x6b4], 0x10
jne 0x416a25
cmp dword [ebx + 0xd9c], 4
jne 0x416a25
xor eax, eax
mov ecx, 0x41
lea edi, [esp + 0x128]
push str.GetDeviceProfileFromReg:_try_to_find_selected_key_n
rep stosd dword es:[edi], eax
call fcn.0040a4a0
add esp, 4
lea edx, [esp + 0x1c]
push edx
mov edx, dword [esp + 0x10]
lea eax, [esp + 0x12c]
push eax
lea ecx, [esp + 0x1c]
push ecx
push 0
push str.SelectedProfileKey
push edx
mov dword [esp + 0x2c], 7
mov dword [esp + 0x34], 0x104
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x416a25
mov al, byte [esp + 0x128]
test al, al
je 0x416a25
mov ecx, dword [ebp + 8]
push esi
lea eax, [esp + 0x12c]
push eax
push ecx
mov ecx, ebx
call fcn.00416690
mov ebx, eax
test ebx, ebx
je 0x416a09
mov edx, dword [esp + 0xc]
push edx
mov dword [esp + 0x14], 1
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [esp + 0x128]
push eax
push str.GetDeviceProfileFromReg:_using_this_selected_key:__s_n
call fcn.0040a4a0
add esp, 8
jmp 0x416aa0
push str.GetDeviceProfileFromReg:_using_this_selected_key:_doesnt_exist._using_connected_profile_instead_n
call fcn.0040a4a0
mov ebx, dword [esp + 0x1c]
mov esi, dword [ebp + 0xc]
add esp, 4
mov dword [esp + 0x10], 0
mov ecx, dword [esp + 0xc]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [ebp + 0x10], 1
jne 0x416a3f
test dword [ebx + 0x28], 0x100000
jne 0x416a51
cmp dword [ebx + 0x6b4], 0x10
jne 0x416a78
cmp dword [ebx + 0xd9c], 4
jne 0x416a78
mov eax, dword [ebp + 8]
push esi
lea ecx, [eax + 8]
push ecx
push eax
mov ecx, ebx
call fcn.00416690
mov ebx, eax
test ebx, ebx
je 0x416a71
mov dword [esp + 0x10], 1
jmp 0x416aa0
mov ebx, dword [esp + 0x18]
mov esi, dword [ebp + 0xc]
mov ecx, dword [ebp + 0x10]
xor eax, eax
cmp ecx, 1
je 0x416a87
cmp ecx, 3
jne 0x416a8c
mov eax, 1
push eax
mov eax, dword [ebp + 8]
lea edx, [esp + 0x24]
push edx
push esi
push eax
mov ecx, ebx
call fcn.00416580
mov ebx, eax
test ebx, ebx
je 0x416ad4
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x416ac5
mov eax, dword [ebp + 0x10]
cmp eax, 1
jne 0x416abb
mov edi, 0x49f8f0
jmp 0x416aca
cmp eax, 2
je 0x416ac5
cmp eax, 3
jne 0x416ad4
mov edi, 0x49f648
mov esi, dword [ebp + 8]
mov ecx, 0x68
rep movsd dword es:[edi], dword [esi]
mov eax, ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc