Function at 0x40d610
Capabilities:
Query or enumerate registry key
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
push 0xfffffffffffffffe
push 0x5d7068
push 0x554090
mov eax, dword fs:[0]
push eax
sub esp, 0x40
push ebx
push esi
push edi
mov eax, dword [0x5eb10c]
xor dword [ebp - 8], eax
xor eax, ebp
push eax
lea eax, [ebp - 0x10]
mov dword fs:[0], eax
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x20], 0
xor edi, edi
mov dword [ebp - 0x3c], edi
xor esi, esi
mov dword [ebp - 0x30], esi
mov eax, 0x28
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x38], esi
mov dword [ebp - 0x34], esi
mov dword [ebp - 0x28], esi
mov dword [ebp - 0x44], 1
mov dword [ebp - 4], esi
push 0x10
call fcn.00417ad1
add esp, 4
mov ebx, eax
mov dword [ebp - 0x38], ebx
test ebx, ebx
je 0x40d83d
lea eax, [ebp - 0x2c]
push eax
push 9
push esi
push str.SOFTWAREMicrosoftWindowsCurrentVersionMMDevicesAudioRender
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x40d83d
lea eax, [edi + 0x28]
mov edx, 2
test esi, esi
jne 0x40d6d9
inc eax
xor ecx, ecx
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00417ad1
add esp, 4
mov esi, eax
mov dword [ebp - 0x30], esi
test esi, esi
je 0x40d83d
jmp 0x40d6e3
mov eax, dword [ebp - 0x34]
inc eax
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x4c], eax
test edi, edi
je 0x40d6f3
push edi
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
xor edi, edi
mov dword [ebp - 0x3c], edi
mov eax, dword [ebp - 0x20]
test eax, eax
je 0x40d708
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov dword [ebp - 0x20], 0
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x40], eax
push 0
push 0
push 0
push 0
lea eax, [ebp - 0x40]
push eax
push esi
push dword [ebp - 0x34]
push dword [ebp - 0x2c]
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
cmp eax, 0xea
jne 0x40d74d
push 2
push esi
call fcn.0054eef8
add esp, 8
xor esi, esi
mov dword [ebp - 0x30], esi
mov eax, dword [ebp - 0x40]
inc eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x50], eax
jmp 0x40d6ac
cmp eax, 0x103
je 0x40d83d
test eax, eax
jne 0x40d83d
lea eax, [ebp - 0x20]
push eax
push 0x20019
push 0
push esi
push dword [ebp - 0x2c]
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
mov eax, dword [ebp - 0x1c]
mov edx, 2
jne 0x40d6b1
mov dword [ebp - 0x24], 4
mov dword [ebp - 0x28], 0x10
lea eax, [ebp - 0x28]
push eax
push ebx
lea eax, [ebp - 0x24]
push eax
push 0
push str.DeviceState
push dword [ebp - 0x20]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
mov eax, dword [ebp - 0x1c]
mov edx, 2
jne 0x40d6b1
cmp dword [ebp - 0x24], 4
jne 0x40d6b1
mov dword [ebp - 0x48], 0
mov eax, dword [ebx]
and eax, 0xf
sub eax, 1
je 0x40d7eb
sub eax, 7
je 0x40d7eb
mov dword [ebp - 0x48], 1
mov eax, dword [ebp - 0x1c]
jmp 0x40d6b1
mov dword [ebp - 0x24], 3
mov dword [ebp - 0x28], 0x10
lea eax, [ebp - 0x28]
push eax
push ebx
lea eax, [ebp - 0x24]
push eax
push 0
push str.Role:0
push dword [ebp - 0x20]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
mov eax, dword [ebp - 0x1c]
mov edx, 2
jne 0x40d6b1
cmp dword [ebp - 0x24], 3
jne 0x40d6b1
cmp dword [ebp - 0x28], 0x10
jne 0x40d6b1
mov dword [ebp - 0x44], 0
mov dword [ebp - 4], 0xfffffffe
call fcn.0040d86c
xor eax, eax
cmp dword [ebp - 0x44], eax
sete al
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret