Function at 0x407080
Capabilities:
Access peb ldr_data

Disassembly:
push 0xffffffffffffffff
push 0x4170d0
mov eax, dword fs:[0]
push eax
sub esp, 0x34
mov eax, dword [0x41c060]
xor eax, esp
mov dword [esp + 0x30], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x41c060]
xor eax, esp
push eax
lea eax, [esp + 0x48]
mov dword fs:[0], eax
mov edi, ecx
mov dword [esp + 0x24], edi
xor esi, esi
mov dword [esp + 0x50], esi
mov eax, dword [0x41d414]
mov edx, dword [eax + 0xc]
mov ecx, 0x41d414
call edx
lea ebx, [eax + 0x10]
mov dword [esp + 0x18], ebx
cmp edi, esi
mov byte [esp + 0x50], 1
mov dword [esp + 0x20], esi
jne 0x407148
push str..System.cpp
push 0x310
push str.RtkAudioService
call fcn.00401000
lea eax, [ebx - 0x10]
add esp, 0xc
mov byte [esp + 0x50], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x407119
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [esp + 0x50], 0xffffffff
mov eax, dword [esp + 0x58]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x407141
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
jmp 0x4071dd
lea ecx, [esp + 0x58]
push ecx
call fcn.004037d0
lea edi, [esp + 0x58]
call fcn.004039f0
push 0x10
push esi
push esi
push 0x41a33c
call dword [sym.imp.SETUPAPI.dll_SetupDiGetClassDevsW]
lea edx, [esp + 0x28]
push edx
mov ebp, eax
push esi
push ebp
mov dword [esp + 0x28], esi
mov dword [esp + 0x34], 0x1c
call dword [sym.imp.SETUPAPI.dll_SetupDiEnumDeviceInfo]
test eax, eax
jne 0x407202
mov esi, dword [esp + 0x58]
push ebp
call dword [sym.imp.SETUPAPI.dll_SetupDiDestroyDeviceInfoList]
lea eax, [ebx - 0x10]
mov byte [esp + 0x50], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4071b5
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [esi - 0x10]
mov dword [esp + 0x50], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4071d9
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x48]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x30]
xor ecx, esp
call fcn.00408c70
add esp, 0x40
ret 4
xor esi, esi
mov edi, dword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceInstanceIdW]
lea eax, [esp + 0x14]
push eax
push esi
push esi
lea ecx, [esp + 0x34]
push ecx
push ebp
mov dword [esp + 0x28], esi
call edi
mov edx, dword [esp + 0x14]
lea eax, [edx + edx]
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov esi, eax
test esi, esi
je 0x407189
mov ecx, dword [esp + 0x14]
push 0
push ecx
push esi
lea edx, [esp + 0x34]
push edx
push ebp
call edi
mov edi, eax
mov eax, esi
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x407250
sub eax, edx
sar eax, 1
mov ebx, eax
push esi
lea eax, [esp + 0x1c]
call fcn.00401e20
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
test edi, edi
mov ebx, dword [esp + 0x18]
je 0x407189
push ebx
push str.RtkAudioService
call fcn.00401000
add esp, 8
test ebx, ebx
je 0x4072b1
mov esi, dword [esp + 0x58]
cmp dword [esi - 0xc], 0
jl 0x4072b1
push ebx
push esi
call fcn.00408d66
add esp, 8
test eax, eax
je 0x4072b1
sub eax, esi
sar eax, 1
cmp eax, 0xffffffff
jne 0x4072d6
mov eax, dword [esp + 0x1c]
lea ecx, [esp + 0x28]
add eax, 1
push ecx
push eax
push ebp
mov dword [esp + 0x28], eax
call dword [sym.imp.SETUPAPI.dll_SetupDiEnumDeviceInfo]
test eax, eax
jne 0x407200
jmp 0x407189
mov edx, dword [esp + 0x3c]
mov eax, dword [esp + 0x24]
mov dword [esp + 0x20], 1
mov dword [eax], edx
jmp 0x40718d