Function at 0x401020
Capabilities:
Resolve function by parsing pe exports

Disassembly:
mov eax, 0x100b4
call fcn.00407a00
mov eax, dword [0x45e134]
xor eax, esp
mov dword [esp + 0x100b0], eax
push ebp
xor ebp, ebp
push 0xbb8
push ebp
push 2
mov dword [esp + 0x18], ebp
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x20], ebp
mov dword [esp + 0x24], ebp
mov dword [esp + 0x28], 1
call fcn.004022d0
add esp, 0xc
test eax, eax
je 0x4013e4
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CreateEventA]
push ebp
push ebp
push 1
push ebp
call esi
cmp eax, ebp
mov dword [0x45f700], eax
je 0x4013e3
push ebp
push ebp
call dword [sym.imp.ole32.dll_CoInitializeEx]
test eax, eax
jl 0x4013d7
push edi
push ebp
push 0x40000000
push 3
push ebp
push 3
push 0xc0000000
push str..XAudio
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
mov dword [esp + 0xc], edi
je 0x4013d0
mov eax, dword [0x45f700]
push 0xbb8
push ebp
push 2
mov dword [esp + 0x20], eax
call fcn.004022d0
add esp, 0xc
test eax, eax
je 0x4013c9
push ebp
push ebp
push 1
push ebp
call esi
cmp eax, ebp
mov dword [esp + 0x18], eax
je 0x4013c9
push ebp
push ebp
push 1
push ebp
call esi
cmp eax, ebp
mov dword [esp + 0x1c], eax
je 0x4013be
push 0xbb8
push ebp
push 2
call fcn.004022d0
add esp, 0xc
test eax, eax
je 0x4013b3
push 0x14
call fcn.00407920
mov esi, eax
add esp, 4
cmp esi, ebp
mov dword [esp + 0x28], esi
je 0x4013b3
push 1
push esi
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x4013a6
push ebp
push ebp
push 1
push esi
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
je 0x4013a6
push 0xbb8
push ebp
push 2
call fcn.004022d0
add esp, 0xc
test eax, eax
je 0x4013a6
push 0x10054
lea ecx, [esp + 0x6c]
push ebp
push ecx
call fcn.00407a30
push ebp
push ebp
push 4
mov dword [esp + 0x80], 0xbeafbeaf
call fcn.004022d0
add esp, 0x18
test eax, eax
je 0x4013a6
mov edx, dword [esp + 0x14]
push ebx
push edx
call dword [sym.imp.KERNEL32.dll_ResetEvent]
mov eax, dword [esp + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov esi, dword [esp + 0x14]
mov edi, dword [esp + 0x14]
xor ebx, ebx
test bl, 2
jne 0x40121f
test byte [esp + 0x70], 2
je 0x40121f
push 0x94
call fcn.00407867
add esp, 4
cmp eax, ebp
je 0x40120d
mov ecx, eax
call fcn.00401a40
mov esi, eax
cmp esi, ebp
je 0x40121f
mov edx, dword [esi]
mov eax, dword [edx]
mov ecx, esi
call eax
test eax, eax
mov ecx, esi
jl 0x401211
mov edx, dword [esi]
mov edx, dword [edx + 4]
lea eax, [esp + 0x6c]
push eax
call edx
or ebx, 2
jmp 0x40121f
xor esi, esi
jmp 0x40121f
call fcn.00401a60
push esi
call fcn.00407776
add esp, 4
test bl, 1
jne 0x40127c
test byte [esp + 0x70], 1
je 0x40127c
push 0x94
call fcn.00407867
add esp, 4
cmp eax, ebp
je 0x401268
mov ecx, eax
call fcn.00401e60
mov edi, eax
cmp edi, ebp
je 0x40127c
mov eax, dword [edi]
mov edx, dword [eax]
mov ecx, edi
call edx
test eax, eax
jl 0x40126c
mov eax, dword [edi]
mov edx, dword [eax + 4]
lea ecx, [esp + 0x6c]
push ecx
mov ecx, edi
call edx
or ebx, 1
jmp 0x40127c
xor edi, edi
jmp 0x40127c
mov ecx, edi
call fcn.00401e80
push edi
call fcn.00407776
add esp, 4
push 5
push ebp
lea eax, [esp + 0x20]
push eax
push 3
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
cmp eax, 3
ja 0x40147b
je 0x401308
sub eax, 1
je 0x4013fa
sub eax, 1
jne 0x401486
xor eax, eax
mov dword [esp + 0x54], eax
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], eax
mov dword [esp + 0x50], eax
mov eax, dword [esp + 0x20]
push eax
mov dword [esp + 0x58], eax
call dword [sym.imp.KERNEL32.dll_ResetEvent]
mov eax, dword [esp + 0x10]
lea ecx, [esp + 0x44]
push ecx
lea edx, [esp + 0x18]
push edx
push ebp
push ebp
push ebp
push ebp
push 0x222403
push eax
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
jne 0x4012fd
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x401308
mov ecx, dword [esp + 0x20]
push ecx
call dword [sym.imp.KERNEL32.dll_SetEvent]
cmp dword [esp + 0x28], ebp
jne 0x401313
and dword [esp + 0x70], 0xfffffffc
test bl, 2
je 0x401341
test byte [esp + 0x70], 2
jne 0x401341
cmp esi, ebp
je 0x401341
mov edx, dword [esi]
mov eax, dword [edx + 8]
mov ecx, esi
call eax
mov ecx, esi
call fcn.00401a60
push esi
call fcn.00407776
add esp, 4
xor esi, esi
and ebx, 0xfffffffd
test bl, 1
je 0x40136f
test byte [esp + 0x70], 1
jne 0x40136f
cmp edi, ebp
je 0x40136f
mov edx, dword [edi]
mov eax, dword [edx + 8]
mov ecx, edi
call eax
mov ecx, edi
call fcn.00401e80
push edi
call fcn.00407776
add esp, 4
xor edi, edi
and ebx, 0xfffffffe
cmp dword [esp + 0x28], ebp
jne 0x4011c4
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_CancelIo]
cmp esi, ebp
pop ebx
je 0x4013a2
mov edx, dword [esi]
mov eax, dword [edx + 8]
mov ecx, esi
call eax
mov ecx, esi
call fcn.00401a60
push esi
call fcn.00407776
add esp, 4
mov esi, dword [esp + 0x28]
push esi
call fcn.0040777b
mov edi, dword [esp + 0x10]
add esp, 4
mov ecx, dword [esp + 0x1c]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [esp + 0x18]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
call dword [sym.imp.ole32.dll_CoUninitialize]
pop edi
mov eax, dword [0x45f700]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop esi
mov ecx, dword [esp + 0x100b4]
pop ebp
xor ecx, esp
call fcn.004079e3
add esp, 0x100b4
ret
xor eax, eax
mov dword [esp + 0x40], eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x1c]
push eax
mov dword [esp + 0x44], eax
call dword [sym.imp.KERNEL32.dll_ResetEvent]
lea edx, [esp + 0x30]
push edx
lea eax, [esp + 0x18]
push eax
mov eax, dword [esp + 0x18]
push 0x10054
lea ecx, [esp + 0x78]
push ecx
push 0x10054
mov edx, ecx
push edx
push 0x22240a
push eax
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
jne 0x401460
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x401308
mov ecx, dword [esp + 0x1c]
push ecx
call dword [sym.imp.KERNEL32.dll_SetEvent]
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x401308
cmp eax, 0x102
je 0x401308
mov dword [esp + 0x28], ebp
jmp 0x40130e