Function at 0x402820
Capabilities:
Get common file path

Disassembly:
sub esp, 0x118
lea eax, [esp + 0x14]
push ebx
mov dword [esp + 0xc], 0
push esi
push edi
push ebp
push 0x104
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
lea ecx, [esp + 0x24]
push 0x40733c
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcatA]
lea ecx, [esp + 0x24]
push ecx
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov edi, eax
test edi, edi
je 0x4029da
push str.DirectSoundEnumerateA
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push edi
call esi
mov ebx, eax
test ebx, ebx
je 0x4029d3
push str.DirectSoundCaptureEnumerateA
push edi
call esi
mov dword [esp + 0x1c], eax
test eax, eax
je 0x4029d3
push str.DirectSoundCreate
push edi
call esi
mov dword [esp + 0x10], eax
test eax, eax
je 0x4029d3
push str.DirectSoundCaptureCreate
push edi
call esi
mov dword [esp + 0x20], eax
test eax, eax
je 0x4029d3
push 0
push 0x402280
call ebx
mov esi, dword [0x4072ac]
test esi, esi
je 0x402947
lea eax, [esp + 0x18]
mov ebx, dword [esp + 0x12c]
push eax
push 4
push ebx
call fcn.00402de0
add esp, 0xc
test esi, esi
je 0x40294e
xor eax, eax
mov ecx, dword [esi + 4]
cmp ecx, eax
je 0x4028f5
lea eax, [esi + 8]
lea ecx, [esp + 0x14]
push 0
push ecx
push eax
call dword [esp + 0x1c]
test eax, eax
jl 0x40293f
lea ebp, [esi + 0x157]
push 0x60
push ebp
call dword [sym.imp.KERNEL32.dll_RtlZeroMemory]
push ebp
mov dword [ebp], 0x60
mov eax, dword [esp + 0x18]
push eax
mov ebp, dword [eax]
call dword [ebp + 0x10]
mov ecx, dword [esp + 0x18]
push ecx
push esi
push ebx
call fcn.004024c0
mov eax, dword [esp + 0x20]
add esp, 0xc
push eax
mov ebp, dword [eax]
call dword [ebp + 8]
mov esi, dword [esi]
test esi, esi
jne 0x4028e9
jmp 0x40294e
mov ebx, dword [esp + 0x12c]
push 0
push 0x4023a0
call dword [esp + 0x24]
mov esi, dword [0x4072b0]
test esi, esi
je 0x4029d3
lea eax, [esp + 0x18]
push eax
push 0xa
push ebx
call fcn.00402de0
add esp, 0xc
test esi, esi
je 0x4029d3
xor eax, eax
mov ecx, dword [esi + 4]
cmp ecx, eax
je 0x402983
lea eax, [esi + 8]
lea ecx, [esp + 0x10]
push 0
push ecx
push eax
call dword [esp + 0x2c]
test eax, eax
jl 0x4029cd
lea ebp, [esi + 0x157]
push 0x10
push ebp
call dword [sym.imp.KERNEL32.dll_RtlZeroMemory]
push ebp
mov dword [ebp], 0x10
mov eax, dword [esp + 0x14]
push eax
mov ebp, dword [eax]
call dword [ebp + 0x10]
mov ecx, dword [esp + 0x18]
push ecx
push esi
push ebx
call fcn.004026c0
mov eax, dword [esp + 0x1c]
add esp, 0xc
push eax
mov ebp, dword [eax]
call dword [ebp + 8]
mov esi, dword [esi]
test esi, esi
jne 0x402977
push edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov ebx, dword [0x4072ac]
mov ebp, dword [0x4072b0]
test ebx, ebx
jne 0x4029ee
test ebp, ebp
je 0x402a4b
mov esi, dword [sym.imp.KERNEL32.dll_GlobalHandle]
mov edi, dword [sym.imp.KERNEL32.dll_GlobalUnlock]
test ebp, ebp
je 0x402a26
mov eax, dword [ebp]
push ebp
mov dword [0x4072b0], eax
call esi
push eax
call edi
push ebp
call esi
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov ebp, dword [0x4072b0]
mov ebx, dword [0x4072ac]
test ebp, ebp
jne 0x4029fe
test ebx, ebx
je 0x402a4b
mov eax, dword [ebx]
push ebx
mov dword [0x4072ac], eax
call esi
push eax
call edi
push ebx
call esi
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov ebx, dword [0x4072ac]
test ebx, ebx
jne 0x402a2a
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x118
ret