Function at 0x413840
Capabilities:
Create thread

Disassembly:
sub esp, 0x78
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x8c]
test edi, edi
jne 0x41385c
pop edi
pop esi
pop ebp
or al, 0xff
pop ebx
add esp, 0x78
ret
mov esi, dword [esp + 0x94]
mov eax, dword [esp + 0x90]
push 0
lea ebx, [esi + 0xc]
mov dword [esi], eax
push ebx
push 0
mov dword [ebx], 0
call sub.DSOUND.dll_DirectSoundCreate
test eax, eax
je 0x41388d
pop edi
pop esi
pop ebp
or al, 0xff
pop ebx
add esp, 0x78
ret
mov eax, dword [ebx]
push 2
push edi
push eax
mov ecx, dword [eax]
call dword [ecx + 0x18]
test eax, eax
je 0x4138af
push esi
call fcn.00413ce0
add esp, 4
or al, 0xff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x78
ret
mov ecx, 9
xor eax, eax
lea edi, [esp + 0x24]
mov ebp, 0x24
rep stosd dword es:[edi], eax
mov eax, dword [ebx]
lea edi, [esi + 0x10]
push 0
lea ecx, [esp + 0x28]
mov dword [esp + 0x28], ebp
mov dword [esp + 0x2c], 1
mov edx, dword [eax]
push edi
push ecx
push eax
call dword [edx + 0xc]
test eax, eax
push esi
je 0x4138f7
call fcn.00413ce0
add esp, 4
or al, 0xff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x78
ret
call fcn.004137d0
add esp, 4
test eax, eax
jne 0x413916
push esi
call fcn.00413ce0
add esp, 4
or al, 0xff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x78
ret
mov eax, dword [edi]
push 1
push 0
push 0
mov edx, dword [eax]
push eax
call dword [edx + 0x30]
xor eax, eax
mov ecx, 9
mov dword [esp + 0x10], eax
lea edi, [esp + 0x24]
mov dword [esp + 0x14], eax
mov word [esp + 0x10], 1
mov dword [esp + 0x18], eax
mov word [esp + 0x12], 2
mov dword [esp + 0x1c], eax
mov word [esp + 0x1e], 0x10
mov word [esp + 0x20], ax
mov eax, dword [esi + 8]
mov dword [esp + 0x14], eax
mov word [esp + 0x1c], 4
shl eax, 2
mov dword [esp + 0x18], eax
lea edx, [eax*4]
mov eax, edx
shr eax, 3
mov dword [esi + 0x1c], eax
mov dword [esi + 0x20], eax
xor eax, eax
rep stosd dword es:[edi], eax
mov eax, dword [ebx]
lea ecx, [esp + 0x10]
mov dword [esp + 0x24], ebp
mov dword [esp + 0x34], ecx
xor ebp, ebp
lea ecx, [esi + 0x14]
push ebp
push ecx
lea ecx, [esp + 0x2c]
mov dword [esp + 0x30], 0x101e0
mov dword [esp + 0x34], edx
mov edx, dword [eax]
push ecx
push eax
call dword [edx + 0xc]
test eax, eax
je 0x4139c7
push esi
call fcn.00413ce0
add esp, 4
or al, 0xff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x78
ret
cmp dword [0x697f88], ebp
jne 0x4139f8
push 0x800
call fcn.00415de6
add esp, 4
cmp eax, ebp
mov dword [0x697f88], eax
jne 0x4139f8
push esi
call fcn.00413ce0
add esp, 4
or al, 0xff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x78
ret
cmp dword [0x697f8c], ebp
jne 0x413a29
push 0x800
call fcn.00415de6
add esp, 4
cmp eax, ebp
mov dword [0x697f8c], eax
jne 0x413a29
push esi
call fcn.00413ce0
add esp, 4
or al, 0xff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x78
ret
cmp dword [0x697f90], ebp
jne 0x413a5a
push 0x800
call fcn.00415de6
add esp, 4
cmp eax, ebp
mov dword [0x697f90], eax
jne 0x413a5a
push esi
call fcn.00413ce0
add esp, 4
or al, 0xff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x78
ret
cmp dword [0x697f94], ebp
jne 0x413a8b
push 0x800
call fcn.00415de6
add esp, 4
cmp eax, ebp
mov dword [0x697f94], eax
jne 0x413a8b
push esi
call fcn.00413ce0
add esp, 4
or al, 0xff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x78
ret
xor eax, eax
mov edx, dword [0x697f88]
add eax, 4
cmp eax, 0x800
mov dword [eax + edx - 4], ebp
mov ecx, dword [0x697f8c]
mov dword [eax + ecx - 4], ebp
mov edx, dword [0x697f90]
mov dword [eax + edx - 4], ebp
mov ecx, dword [0x697f94]
mov dword [eax + ecx - 4], ebp
jl 0x413a8d
lea eax, [esi + 0x424]
mov ecx, 0x100
mov dword [eax - 0x400], ebp
mov dword [eax], 0xffffffff
add eax, 4
dec ecx
jne 0x413aca
mov ebx, dword [sym.imp.KERNEL32.dll_CreateEventA]
push ebp
push ebp
push ebp
push ebp
mov dword [0x697fb0], 1
call ebx
mov dword [esi + 0x1030], eax
push ebp
mov ecx, 0x10
xor eax, eax
lea edi, [esp + 0x4c]
push ebp
push ebp
push ebp
rep stosd dword es:[edi], eax
call ebx
mov dword [esi + 0x103c], eax
xor edi, edi
lea ebx, [esp + 0x4c]
lea ebp, [esi + 0x1040]
push 0
push 0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
test eax, eax
mov dword [ebp], eax
je 0x413c9f
mov edx, edi
add ebp, 4
imul edx, dword [esi + 0x1c]
mov dword [ebx - 4], edx
mov dword [ebx], eax
inc edi
add ebx, 8
cmp edi, 8
jl 0x413b1d
mov eax, dword [esi + 0x14]
lea edi, [esi + 0x18]
push edi
push 0x41e2a0
mov ecx, dword [eax]
push eax
call dword [ecx]
test eax, eax
je 0x413b75
push esi
call fcn.00413ce0
add esp, 4
or al, 0xff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x78
ret
mov edi, dword [edi]
lea eax, [esp + 0x48]
push eax
push 8
mov edx, dword [edi]
push edi
call dword [edx + 0xc]
test eax, eax
je 0x413b9b
push esi
call fcn.00413ce0
add esp, 4
or al, 0xff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x78
ret
mov ecx, dword [esi + 0x20]
push ecx
call fcn.00415de6
xor ebx, ebx
add esp, 4
cmp eax, ebx
mov dword [0x697fa4], eax
jne 0x413bc5
push esi
call fcn.00413ce0
add esp, 4
or al, 0xff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x78
ret
cmp dword [0x697fa8], ebx
jne 0x413bf8
mov edx, dword [esi + 0x20]
shr edx, 2
push edx
call fcn.00415de6
add esp, 4
cmp eax, ebx
mov dword [0x697fa8], eax
jne 0x413bf8
push esi
call fcn.00413ce0
add esp, 4
or al, 0xff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x78
ret
mov edi, dword [sym.imp.KERNEL32.dll_CreateThread]
lea eax, [esi + 0x102c]
push eax
push ebx
push esi
push 0x4150c0
push ebx
push ebx
mov dword [esi + 0x1028], ebx
call edi
cmp eax, ebx
mov dword [esi + 0x1028], eax
jne 0x413c33
push esi
call fcn.00413ce0
add esp, 4
or al, 0xff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x78
ret
lea ecx, [esi + 0x1038]
mov dword [esi + 0x1034], ebx
push ecx
push ebx
push esi
push 0x415140
push ebx
push ebx
call edi
cmp eax, ebx
mov dword [esi + 0x1034], eax
jne 0x413c68
push esi
call fcn.00413ce0
add esp, 4
or al, 0xff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x78
ret
mov edx, dword [esi + 0x1028]
mov edi, dword [sym.imp.KERNEL32.dll_SetThreadPriority]
push 2
push edx
call edi
test eax, eax
jne 0x413c90
push esi
call fcn.00413ce0
add esp, 4
or al, 0xff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x78
ret
mov eax, dword [esi + 0x1034]
push 2
push eax
call edi
test eax, eax
jne 0x413cb2
push esi
call fcn.00413ce0
add esp, 4
or al, 0xff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x78
ret
mov eax, 0x64
mov dword [esi + 0x1078], ebx
mov dword [esi + 0x1070], eax
mov dword [esi + 0x1074], eax
mov dword [esi + 0x1060], ebx
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x78
ret