Function at 0x4069f0
Capabilities:
Resolve function by parsing pe exports
Set registry value

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x423c56
mov eax, dword fs:[0]
push eax
sub esp, 0x1e8
mov eax, dword [0x448090]
xor eax, esp
mov dword [esp + 0x1e0], eax
push ebx
push esi
push edi
mov eax, dword [0x448090]
xor eax, esp
push eax
lea eax, [esp + 0x1f8]
mov dword fs:[0], eax
cmp dword [ebp + 0x14], 1
mov esi, dword [ebp + 8]
mov eax, dword [ebp + 0x10]
mov ebx, ecx
mov dword [esp + 0x18], ebx
mov dword [esp + 0x20], esi
mov dword [esp + 0x1c], eax
mov byte [esp + 0x13], 0
jne 0x406a60
lea edi, [ebx + 0x4bc]
mov dword [esp + 0x14], edi
mov byte [esp + 0x13], 1
jmp 0x406a86
push 0x94
call fcn.00411f99
add esp, 4
test eax, eax
je 0x406a7e
mov esi, eax
call fcn.0040bdc0
mov esi, dword [esp + 0x20]
jmp 0x406a80
xor eax, eax
mov dword [esp + 0x14], eax
mov edi, eax
test edi, edi
je 0x406c51
cmp dword [ebp + 0x14], 1
je 0x406c51
mov ecx, dword [ebp + 0xc]
push 1
push ecx
push esi
push edi
call fcn.0040bf90
test al, al
jne 0x406ac0
mov edx, dword [ebp + 0xc]
push 1
push edx
mov edx, esi
mov ecx, edi
call fcn.0040c1f0
test al, al
je 0x406c51
xor eax, eax
mov dword [esp + 0x2c], vtable.CMaxxAudioRegistryPreset.0
mov dword [esp + 0x34], eax
mov dword [esp + 0x200], eax
mov ecx, dword [ebx + 0x488]
mov edx, ecx
and edx, 2
cmp dl, 2
jne 0x406aec
mov eax, 0x200
jmp 0x406af9
and ecx, 4
cmp cl, 4
jne 0x406af9
mov eax, 0x100
mov ecx, dword [ebx + 0x4a0]
push 0
lea edx, [esp + 0x34]
push edx
push 0
or eax, 0x20017
push eax
push 0
push 0
push 0
push ecx
push 0x80000002
mov dword [esp + 0x54], 0
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExA]
test eax, eax
jne 0x406c2f
push 0x103
push eax
mov byte [esp + 0xec], al
lea eax, [esp + 0xed]
push eax
call fcn.00416250
add esp, 0xc
push str.DefaultPreset
lea ecx, [esp + 0xe8]
push 0x104
push ecx
call fcn.004134d8
mov eax, dword [esp + 0x28]
add esp, 0xc
lea edx, [esp + 0x60]
mov dword [esp + 0x5c], edx
test eax, eax
jne 0x406b7d
mov dword [esp + 0x5c], eax
jmp 0x406bd9
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
lea ebx, [eax + 1]
lea edi, [esp + 0x60]
mov ecx, ebx
lea esi, [esp + 0x5c]
call fcn.0040acf0
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x5c]
push ebx
push eax
push ebx
push ecx
call fcn.00412111
add esp, 0x10
cmp eax, 0x50
ja case.0x406bba.1
movzx edx, byte [eax + 0x40701c]
jmp dword [edx*4 + 0x40700c]
push 0x8007000e
call fcn.00401b20
push 0x80070057
call fcn.00401b20
mov edi, dword [esp + 0x14]
mov eax, dword [esp + 0x5c]
push eax
lea ecx, [esp + 0xe8]
push 0x104
push ecx
call fcn.00413730
mov eax, dword [esp + 0x68]
lea edx, [esp + 0x6c]
add esp, 0xc
cmp eax, edx
je 0x406c08
push eax
call fcn.0041206c
add esp, 4
mov eax, dword [ebp + 0xc]
mov ecx, dword [esp + 0x20]
push eax
mov eax, dword [esp + 0x34]
push ecx
push 3
push 0
lea edx, [esp + 0xf4]
push edx
push eax
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
test eax, eax
sete byte [esp + 0x13]
mov dword [esp + 0x200], 0xffffffff
mov eax, dword [esp + 0x30]
mov dword [esp + 0x2c], vtable.CMaxxAudioRegistryPreset.0
test eax, eax
je 0x406c51
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp byte [esp + 0x13], 0
je 0x406fa2
mov ebx, dword [edi + 0x6c]
sub ebx, dword [edi + 0x68]
mov esi, dword [esp + 0x18]
sar ebx, 2
mov dword [esp + 0x38], ebx
call fcn.004062b0
xor eax, eax
mov dword [esp + 0x1c], eax
test ebx, ebx
jle 0x406dde
mov ecx, dword [edi + 0x68]
mov edx, dword [edi + 0x6c]
sub edx, ecx
sar edx, 2
cmp eax, edx
jge 0x406dd1
mov edi, dword [ecx + eax*4]
test edi, edi
je 0x406dcd
mov ebx, dword [edi + 0x74]
mov esi, dword [edi + 0x78]
test ebx, ebx
js 0x406dc9
test esi, esi
js 0x406dc9
mov eax, dword [esp + 0x18]
push 1
push esi
push ebx
push eax
call fcn.00408970
test byte [edi + 0x7c], 1
mov dword [esp + 0x24], eax
je 0x406d90
cmp dword [edi + 0x80], 0
jne 0x406d90
mov edx, dword [0x44924c]
mov eax, dword [edx + 0xc]
mov ecx, 0x44924c
call eax
add eax, 0x10
mov dword [esp + 0x20], eax
push ebx
push str.SoundModeOnOutput_d
lea edi, [esp + 0x28]
mov dword [esp + 0x208], 1
call fcn.0040a990
mov edx, dword [esp + 0x28]
mov edi, dword [esp + 0x20]
mov eax, dword [edi + 0x460]
add esp, 8
push 4
lea ecx, [esp + 0x2c]
push ecx
push 4
push 0
push edx
push eax
mov dword [esp + 0x40], esi
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
cmp ebx, dword [edi + 0x550]
jne 0x406d65
mov edx, dword [edi + 0x460]
push 4
lea ecx, [esp + 0x2c]
push ecx
push 4
push 0
push str.ActiveSoundMode
push edx
mov dword [edi + 0x554], esi
mov dword [esp + 0x40], esi
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
mov dword [esp + 0x200], 0xffffffff
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x406d90
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov edx, dword [esp + 0x14]
push esi
push ebx
call fcn.0040cb00
test eax, eax
je 0x406dc5
mov ecx, dword [esp + 0x24]
test ecx, ecx
je 0x406dc5
push 4
lea edx, [esp + 0x28]
push edx
push 4
push 0
mov dword [esp + 0x34], eax
mov eax, dword [ecx + 4]
push str.Type
push eax
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
mov eax, dword [esp + 0x1c]
mov ebx, dword [esp + 0x38]
mov edi, dword [esp + 0x14]
inc eax
mov dword [esp + 0x1c], eax
cmp eax, ebx
jl 0x406c80
mov edi, dword [esp + 0x18]
add edi, 0x4bc
call fcn.0040c7a0
mov esi, dword [esp + 0x18]
mov eax, esi
call fcn.004057a0
mov ecx, esi
call fcn.00408af0
xor esi, esi
push 0x24
mov dword [esp + 0x48], esi
call fcn.00411f99
add esp, 4
cmp eax, esi
je 0x406fe0
mov dword [esp + 0x40], eax
mov dword [eax], eax
mov eax, dword [esp + 0x40]
mov dword [eax + 4], eax
mov eax, dword [esp + 0x40]
mov dword [eax + 8], eax
mov ecx, dword [esp + 0x40]
mov byte [ecx + 0x20], 1
mov edx, dword [esp + 0x40]
mov byte [edx + 0x21], 1
lea eax, [esp + 0x3c]
push eax
mov ebx, edi
mov dword [esp + 0x204], 2
call fcn.0040cbb0
mov eax, dword [esp + 0x40]
mov edi, dword [eax]
cmp edi, eax
je 0x406f65
lea ecx, [edi + 0x10]
push ecx
lea edx, [esp + 0x50]
push edx
call fcn.00409980
mov byte [esp + 0x200], 3
mov eax, dword [esp + 0x50]
mov esi, dword [eax]
cmp esi, eax
je 0x406eea
mov edx, dword [esi + 0xc]
mov eax, dword [edi + 0xc]
mov ecx, dword [esp + 0x18]
mov ebx, dword [ecx]
push edx
push eax
mov eax, dword [ebx + 0x68]
call eax
cmp byte [esi + 0x11], 0
jne 0x406ee2
mov eax, dword [esi + 8]
cmp byte [eax + 0x11], 0
jne 0x406ec6
mov esi, eax
mov eax, dword [esi]
cmp byte [eax + 0x11], 0
jne 0x406ee2
lea esp, [esp]
mov esi, eax
mov eax, dword [esi]
cmp byte [eax + 0x11], 0
je 0x406eb0
jmp 0x406ee2
push 0x80004005
call fcn.00401b20
mov eax, dword [esi + 4]
cmp byte [eax + 0x11], 0
jne 0x406ee0
nop
cmp esi, dword [eax + 8]
jne 0x406ee0
mov esi, eax
mov eax, dword [eax + 4]
cmp byte [eax + 0x11], 0
je 0x406ed0
mov esi, eax
mov eax, dword [esp + 0x50]
cmp esi, eax
jne 0x406e80
mov byte [esp + 0x200], 4
mov ecx, dword [eax]
push eax
push ecx
lea esi, [esp + 0x30]
lea eax, [esp + 0x54]
call fcn.00409e00
mov byte [esp + 0x200], 2
mov ecx, dword [esp + 0x50]
push ecx
call fcn.00411eda
add esp, 4
cmp byte [edi + 0x21], 0
jne 0x406f59
mov ecx, dword [edi + 8]
cmp byte [ecx + 0x21], 0
jne 0x406f3e
mov eax, dword [ecx]
cmp byte [eax + 0x21], 0
jne 0x406f3a
nop
mov ecx, eax
mov eax, dword [ecx]
cmp byte [eax + 0x21], 0
je 0x406f30
mov edi, ecx
jmp 0x406f59
mov eax, dword [edi + 4]
cmp byte [eax + 0x21], 0
jne 0x406f57
cmp edi, dword [eax + 8]
jne 0x406f57
mov edi, eax
mov eax, dword [eax + 4]
cmp byte [eax + 0x21], 0
je 0x406f47
mov edi, eax
mov eax, dword [esp + 0x40]
cmp edi, eax
jne 0x406e60
mov byte [esp + 0x13], 1
mov dword [esp + 0x200], 5
mov ecx, dword [eax]
push eax
push ecx
lea edi, [esp + 0x2c]
lea esi, [esp + 0x44]
call fcn.00409d40
mov dword [esp + 0x200], 0xffffffff
mov edx, dword [esp + 0x40]
push edx
call fcn.00411eda
mov edi, dword [esp + 0x18]
add esp, 4
cmp dword [ebp + 0x14], 1
je 0x406fb6
test edi, edi
je 0x406fb6
mov edx, dword [edi]
mov eax, dword [edx]
push 1
mov ecx, edi
call eax
mov al, byte [esp + 0x13]
mov ecx, dword [esp + 0x1f8]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x1e0]
xor ecx, esp
call fcn.004117c9
mov esp, ebp
pop ebp
ret 0x10
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x30]
mov dword [esp + 0x28], esi
call fcn.00411860
push 0x4451f8
lea ecx, [esp + 0x30]
push ecx
mov dword [esp + 0x34], vtable.std::bad_alloc.0
call fcn.00413e69
lea ecx, [ecx]
aad 0x6b
inc eax
add cl, al
imul eax, dword [eax], 0xffffffcb
imul eax, dword [eax], 0xffffffbc
outsb dx, byte [esi]
inc eax
add byte [eax], al
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ecx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [edx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [edx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [ebx]
add eax, dword [eax]
int3