Function at 0x5188a0
Capabilities:
Create thread
Link many functions at runtime
Resolve function by parsing pe exports
Resume thread

Disassembly:
sub esp, 0x3fc
push edi
xor edi, edi
cmp dword [0x8f2264], edi
je 0x5188bc
or eax, 0xffffffff
pop edi
add esp, 0x3fc
ret
push ebp
push 0x8f2240
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
cmp dword [0x8f2270], edi
jne 0x51897b
push str.msacm32.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov ebp, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.acmFormatSuggest
push eax
mov dword [0x8f2270], eax
call ebp
mov dword [0x8f2278], eax
mov eax, dword [0x8f2270]
push str.acmStreamOpen
push eax
call ebp
mov ecx, dword [0x8f2270]
push str.acmStreamClose
push ecx
mov dword [0x8f2274], eax
call ebp
mov edx, dword [0x8f2270]
push str.acmMetrics
push edx
mov dword [0x8f227c], eax
call ebp
mov dword [0x8f2280], eax
mov eax, dword [0x8f2270]
push str.acmStreamPrepareHeader
push eax
call ebp
mov ecx, dword [0x8f2270]
push str.acmStreamConvert
push ecx
mov dword [0x8f2284], eax
call ebp
mov edx, dword [0x8f2270]
push str.acmStreamUnprepareHeader
push edx
mov dword [0x8f2288], eax
call ebp
mov dword [0x8f228c], eax
mov eax, dword [0x8f2270]
push str.acmStreamSize
push eax
call ebp
mov dword [0x8f2290], eax
jmp 0x518981
mov ebp, dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov eax, dword [0x8f22dc]
sub eax, edi
push esi
je 0x518c55
sub eax, 1
jne 0x518e50
push str.DirectSound8
call fcn.004e16a0
add esp, 4
push 0x8f2258
push 0x6d6b70
push 3
push edi
push 0x6d6b30
call dword [0x7090c8]
test eax, eax
jge 0x5189ed
push str.DirectMusicLoader8
call fcn.004e16a0
push 0x6aa3c8
call fcn.004e16a0
add esp, 8
mov dword [0x8f22dc], edi
call fcn.005188a0
pop esi
pop ebp
pop edi
add esp, 0x3fc
ret
push 0x8f225c
push 0x6d6b80
push 3
push edi
push 0x6d6b20
call dword [0x7090c8]
test eax, eax
jge 0x518a28
push str.DirectMusicPerformance
call fcn.004e16a0
add esp, 4
call fcn.00518500
pop esi
pop ebp
or eax, 0xffffffff
pop edi
add esp, 0x3fc
ret
lea ecx, [esp + 0xc]
push ecx
push 0x6d6b60
push 1
push edi
push 0x6d6b10
call dword [0x7090c8]
test eax, eax
jge 0x518a63
push str.DirectMusic
call fcn.004e16a0
add esp, 4
call fcn.00518500
pop esi
pop ebp
or eax, 0xffffffff
pop edi
add esp, 0x3fc
ret
mov eax, dword [esp + 0xc]
mov edx, dword [eax]
mov edx, dword [edx]
lea ecx, [esp + 0x10]
push ecx
push 0x6d6b90
push eax
call edx
test eax, eax
jge 0x518aa7
mov eax, dword [esp + 0xc]
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
push str.DirectMusic8
call fcn.004e16a0
add esp, 4
call fcn.00518500
pop esi
pop ebp
or eax, 0xffffffff
pop edi
add esp, 0x3fc
ret
push 0x134
lea eax, [esp + 0xd0]
push edi
push eax
call fcn.004dc0b0
mov eax, dword [esp + 0x1c]
add esp, 0xc
lea edx, [esp + 0xcc]
push edx
mov dword [esp + 0xd0], 0x134
mov ecx, dword [eax]
push edi
push eax
mov eax, dword [ecx + 0xc]
xor esi, esi
call eax
cmp eax, 1
je 0x518b91
mov edi, dword [sym.imp.KERNEL32.dll_lstrcpyW]
mov ebp, dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
jmp 0x518b00
lea ecx, [esp + 0x100]
push ecx
lea edx, [esp + 0x204]
push edx
call edi
push 0
push 0
push 0x100
lea eax, [esp + 0x314]
push eax
push 0xffffffffffffffff
lea ecx, [esp + 0x214]
push ecx
push 0
push 0
mov word [esp + 0x320], 0
call ebp
cmp dword [esp + 0xe4], 1
mov eax, 0x6aa320
je 0x518b51
mov eax, 0x6aa314
lea edx, [esp + 0x308]
push edx
push esi
push eax
push str._s__Device_d:_s
call fcn.004e3210
mov eax, dword [esp + 0x20]
mov ecx, dword [eax]
add esp, 0x10
lea edx, [esp + 0xcc]
push edx
add esi, 1
push esi
push eax
mov eax, dword [ecx + 0xc]
call eax
cmp eax, 1
jne 0x518b00
mov ebp, dword [sym.imp.KERNEL32.dll_GetProcAddress]
xor edi, edi
mov eax, dword [esp + 0x10]
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
mov eax, dword [esp + 0xc]
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
push 0x28
lea eax, [esp + 0x34]
push edi
push eax
call fcn.004dc0b0
mov eax, dword [0x8f225c]
add esp, 0xc
lea edx, [esp + 0x30]
push edx
push 0x3f
push 0x40
push 1
push edi
push 0x8f2264
lea edx, [esp + 0x24]
mov dword [esp + 0x48], 0x28
mov dword [esp + 0x4c], 1
mov dword [esp + 0x50], 5
mov dword [esp + 0x5c], 0xac44
mov dword [esp + 0x54], 0x3f
mov dword [0x8f2264], edi
mov dword [esp + 0x24], edi
mov ecx, dword [eax]
push edx
push eax
mov eax, dword [ecx + 0xb0]
call eax
test eax, eax
je 0x518c34
push 0x6aa2c4
call fcn.004e16a0
add esp, 4
call fcn.00518500
pop esi
pop ebp
or eax, 0xffffffff
pop edi
add esp, 0x3fc
ret
mov eax, dword [0x8f225c]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x84]
push 4
push 0x91a2f8
push 0x6d6ad0
push eax
call edx
jmp 0x518e50
push str.DirectSound
call fcn.004e16a0
push 0x6aa270
call fcn.004e16a0
add esp, 8
push 0x8f2264
push 0x6d6b50
push 7
push edi
push 0x6d6b00
call dword [0x7090c8]
test eax, eax
jl 0x519283
push 0x6a7520
call fcn.004e16a0
push 0x6aa244
call fcn.004e16a0
mov eax, dword [0x8f2264]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x28]
add esp, 8
push edi
push eax
call edx
mov esi, eax
cmp esi, edi
jge 0x518cef
push 0x6aa22c
call fcn.004e16a0
push esi
push 0x6aa21c
call fcn.004e3210
add esp, 0xc
mov eax, dword [0x8f2264]
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
pop esi
pop ebp
mov dword [0x8f2264], edi
or eax, 0xffffffff
pop edi
add esp, 0x3fc
ret
push 0x6a7520
call fcn.004e16a0
mov eax, dword [0x8f2264]
mov esi, dword [eax]
add esp, 4
push 2
call dword [sym.imp.USER32.dll_GetDesktopWindow]
mov ecx, dword [0x8f2264]
mov edx, dword [esi + 0x18]
push eax
push ecx
call edx
test eax, eax
je 0x518d2b
push 0x6aa1ec
call fcn.004e16a0
add esp, 4
jmp 0x518ccf
push 0x24
lea eax, [esp + 0x34]
push edi
push eax
call fcn.004dc0b0
mov ecx, dword [0x91a2fc]
mov eax, dword [0x8f2264]
add esp, 0xc
neg ecx
sbb ecx, ecx
and ecx, 8
or ecx, 1
push edi
mov dword [esp + 0x38], ecx
push 0x8f2268
lea ecx, [esp + 0x38]
mov dword [esp + 0x38], 0x24
mov edx, dword [eax]
mov edx, dword [edx + 0xc]
push ecx
push eax
call edx
test eax, eax
je 0x518d85
push 0x6aa1ac
call fcn.004e16a0
add esp, 4
jmp 0x518ccf
push 0x60
lea eax, [esp + 0x70]
push edi
push eax
call fcn.004dc0b0
mov eax, dword [0x8f2264]
add esp, 0xc
lea edx, [esp + 0x6c]
mov dword [esp + 0x6c], 0x60
mov ecx, dword [eax]
push edx
push eax
mov eax, dword [ecx + 0x10]
call eax
mov eax, dword [esp + 0x70]
mov edi, dword [esp + 0x78]
mov ecx, eax
and cl, 2
neg cl
sbb ecx, ecx
neg ecx
add ecx, 1
cmp edi, 0xac44
mov esi, ecx
jb 0x518dd4
mov edi, 0xac44
and al, 8
neg al
push 0x12
lea edx, [esp + 0x5c]
push 0
push edx
sbb eax, eax
neg eax
add eax, 1
mov ebp, eax
call fcn.004dc0b0
lea eax, [ebp*8]
mov word [esp + 0x72], ax
shr ax, 3
imul ax, si
mov word [esp + 0x70], ax
movzx eax, ax
imul eax, edi
mov dword [esp + 0x6c], eax
mov eax, dword [0x8f2268]
add esp, 0xc
lea edx, [esp + 0x58]
mov word [esp + 0x58], 1
mov word [esp + 0x5a], si
mov dword [esp + 0x5c], edi
mov ecx, dword [eax]
push edx
push eax
mov eax, dword [ecx + 0x38]
call eax
test eax, eax
je 0x518e48
push 0x6aa160
call fcn.004e16a0
add esp, 4
mov ebp, dword [sym.imp.KERNEL32.dll_GetProcAddress]
xor edi, edi
push 0x12
lea ecx, [esp + 0x20]
push edi
push ecx
call fcn.004dc0b0
push 0x24
lea edx, [esp + 0x40]
push edi
mov esi, 2
push edx
mov word [esp + 0x34], 1
mov word [esp + 0x36], si
mov dword [esp + 0x38], 0xac44
mov word [esp + 0x42], 0x10
mov word [esp + 0x40], 4
mov dword [esp + 0x3c], 0x2b110
call fcn.004dc0b0
mov eax, dword [0x91a2fc]
movzx ecx, word [esp + 0x40]
add esp, 0x18
neg eax
sbb eax, eax
imul ecx, ecx, 0x64
and eax, 6
add eax, esi
or eax, 0x8000
push edi
lea edx, [esp + 0x20]
mov dword [esp + 0x38], eax
mov eax, dword [0x8f2264]
mov dword [esp + 0x44], edx
push 0x8f22d8
lea edx, [esp + 0x38]
mov dword [esp + 0x38], 0x24
mov dword [esp + 0x40], ecx
mov ecx, dword [eax]
push edx
push eax
mov eax, dword [ecx + 0xc]
call eax
test eax, eax
je 0x518f03
push 0x6aa138
call fcn.004e16a0
add esp, 4
mov dword [0x8f22d8], edi
jmp 0x518fb7
mov eax, dword [0x8f22d8]
mov ecx, dword [eax]
push edi
lea edx, [esp + 0x10]
push edx
lea edx, [esp + 0x18]
push edx
lea edx, [esp + 0x24]
push edx
lea edx, [esp + 0x24]
push edx
mov edx, dword [esp + 0x4c]
push edx
push edi
push eax
mov eax, dword [ecx + 0x2c]
call eax
test eax, eax
je 0x518f4f
push 0x6aa114
call fcn.004e16a0
mov eax, dword [0x8f22d8]
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
add esp, 4
push eax
call edx
mov dword [0x8f22d8], edi
mov ecx, dword [esp + 0x18]
shr ecx, 1
je 0x518f66
mov edi, dword [esp + 0x14]
xor eax, eax
shr ecx, 1
rep stosd dword es:[edi], eax
adc ecx, ecx
rep stosw word es:[edi], ax
mov edi, dword [esp + 0x10]
test edi, edi
je 0x518f85
mov ecx, dword [esp + 0xc]
shr ecx, 1
je 0x518f85
xor eax, eax
shr ecx, 1
rep stosd dword es:[edi], eax
adc ecx, ecx
rep stosw word es:[edi], ax
mov edi, dword [esp + 0x10]
mov edx, dword [esp + 0xc]
mov eax, dword [0x8f22d8]
mov ecx, dword [eax]
push edx
mov edx, dword [esp + 0x1c]
push edi
push edx
mov edx, dword [esp + 0x20]
push edx
push eax
mov eax, dword [ecx + 0x4c]
call eax
mov eax, dword [0x8f22d8]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x30]
push 1
push 0
push 0
push eax
call edx
xor edi, edi
push 0x8f22a4
push 0x8f2294
mov dword [0x91a310], edi
mov dword [0x91a318], esi
call fcn.004de4d0
push 0x8f22c4
push 0x8f22b4
call fcn.004de4d0
add esp, 0x10
cmp dword [0x8f2264], edi
je 0x519218
call fcn.004dbd50
push 0x60
lea eax, [esp + 0x70]
push edi
push eax
call fcn.004dc0b0
mov eax, dword [0x8f2264]
add esp, 0xc
lea edx, [esp + 0x6c]
mov dword [esp + 0x6c], 0x60
mov ecx, dword [eax]
push edx
push eax
mov eax, dword [ecx + 0x10]
call eax
push 0x6aa0f0
call fcn.004e16a0
add esp, 4
call fcn.004dbd50
push str.DSOUND.DLL
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, eax
cmp esi, edi
jne 0x519059
push 0x6aa0c0
call fcn.004e16a0
add esp, 4
call fcn.004dbd60
jmp 0x519218
push str.DirectSoundEnumerateA
push esi
call ebp
cmp eax, edi
jne 0x519083
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
push 0x6aa068
call fcn.004e16a0
add esp, 4
call fcn.004dbd60
jmp 0x519218
push edi
push 0x512370
call eax
call fcn.004dbd60
fild dword [esp + 0x74]
mov ecx, dword [esp + 0x74]
test ecx, ecx
jge 0x5190a2
fadd qword [0x6a1590]
fld qword [0x69e228]
mov edx, dword [esp + 0x78]
fdiv st(1), st(0)
sub esp, 0x10
test edx, edx
fxch st(1)
fstp qword [esp + 8]
fild dword [esp + 0x88]
jge 0x5190c8
fadd qword [0x6a1590]
fdivrp st(1)
fstp qword [esp]
push 0x6aa028
call fcn.004e3210
fild dword [esp + 0xc8]
mov eax, dword [esp + 0xc8]
test eax, eax
jge 0x5190ef
fadd qword [0x6a1590]
fld qword [0x6af0d0]
mov ecx, dword [esp + 0xc4]
fmul st(1), st(0)
add esp, 4
test ecx, ecx
fxch st(1)
fstp qword [esp + 8]
fild dword [esp + 0xc0]
jge 0x519118
fadd qword [0x6a1590]
fmulp st(1)
fstp qword [esp]
push 0x6a9fec
call fcn.004e3210
push 0x6a9fd0
call fcn.004e16a0
mov al, byte [esp + 0x88]
add esp, 0x18
test al, 4
mov ecx, 0x6a9fcc
jne 0x519149
mov ecx, 0x69ea0c
test al, 8
mov eax, 0x6a9fcc
jne 0x519157
mov eax, 0x69ea0c
push ecx
push eax
push 0x6a9fa4
call fcn.004e3210
mov eax, dword [esp + 0x7c]
add esp, 0xc
test eax, 0x400
mov ecx, 0x6a9fcc
jne 0x51917b
mov ecx, 0x69ea0c
test eax, 0x800
mov eax, 0x6a9fcc
jne 0x51918c
mov eax, 0x69ea0c
push ecx
push eax
push 0x6a9f7c
call fcn.004e3210
push 0x6a9f68
call fcn.004e16a0
mov al, byte [esp + 0x80]
add esp, 0x10
test al, 2
mov ecx, 0x6a9fcc
jne 0x5191ba
mov ecx, 0x69ea0c
test al, 1
mov eax, 0x6a9fcc
jne 0x5191c8
mov eax, 0x69ea0c
push ecx
push eax
push 0x6a9f44
call fcn.004e3210
mov eax, dword [esp + 0x7c]
add esp, 0xc
test eax, 0x200
mov ecx, 0x6a9fcc
jne 0x5191ec
mov ecx, 0x69ea0c
test eax, 0x100
mov eax, 0x6a9fcc
jne 0x5191fd
mov eax, 0x69ea0c
push ecx
push eax
push 0x6a9f1c
call fcn.004e3210
add esp, 0xc
call fcn.004dbd60
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
push edi
call fcn.00517970
add esp, 4
call fcn.00515850
call fcn.005158a0
cmp dword [0x708fd8], 1
mov dword [0x91a320], edi
jle 0x51926a
push 0x91a324
push 4
push edi
push 0x517e10
push edi
push edi
call dword [sym.imp.KERNEL32.dll_CreateThread]
push 0xf
push eax
mov dword [0x91a320], eax
call dword [sym.imp.KERNEL32.dll_SetThreadPriority]
mov edx, dword [0x91a320]
push edx
call dword [sym.imp.KERNEL32.dll_ResumeThread]
push 0x6a9ef0
call fcn.004e16a0
add esp, 4
pop esi
pop ebp
xor eax, eax
pop edi
add esp, 0x3fc
ret
push 0x6a9ebc
mov dword [0x8f2264], edi
call fcn.004e16a0
add esp, 4
pop esi
pop ebp
or eax, 0xffffffff
pop edi
add esp, 0x3fc
ret