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

Disassembly:
sub esp, 0x88
push ebx
mov ebx, dword [esp + 0x90]
push ebp
xor ebp, ebp
xor eax, eax
cmp ebx, ebp
push esi
push edi
mov dword [esp + 0x10], eax
je 0x40dee8
mov edi, dword [sym.imp.GDI32.dll_CreateCompatibleDC]
push ebp
call edi
mov esi, eax
cmp esi, ebp
mov dword [esp + 0x38], esi
je 0x40dee6
lea eax, [esp + 0x3c]
push eax
push 0x18
push ebx
call dword [sym.imp.GDI32.dll_GetObjectW]
mov ecx, dword [esp + 0x40]
mov edx, dword [esp + 0x44]
push ebp
push ebp
lea eax, [esp + 0x9c]
push eax
mov dword [esp + 0x64], ecx
push ebp
lea ecx, [esp + 0x64]
push ecx
push esi
mov dword [esp + 0x6c], 0x28
mov dword [esp + 0x74], edx
mov word [esp + 0x78], 1
mov word [esp + 0x7a], 0x20
mov dword [esp + 0x7c], ebp
mov dword [esp + 0x80], ebp
mov dword [esp + 0x84], ebp
mov dword [esp + 0x88], ebp
mov dword [esp + 0x8c], ebp
mov dword [esp + 0x90], ebp
call dword [sym.imp.GDI32.dll_CreateDIBSection]
mov ebx, eax
cmp ebx, ebp
je 0x40ded0
push ebx
push esi
call dword [sym.imp.GDI32.dll_SelectObject]
push esi
mov dword [esp + 0x34], eax
call edi
mov edi, eax
cmp edi, ebp
mov dword [esp + 0x2c], edi
je 0x40debd
lea edx, [esp + 0x7c]
push edx
push 0x18
push ebx
call dword [sym.imp.GDI32.dll_GetObjectW]
mov eax, dword [esp + 0x88]
mov ecx, eax
and ecx, reloc.DSOUND.dll_DirectSoundEnumerateW
jns 0x40dc35
dec ecx
or ecx, 0xfffffffc
inc ecx
je 0x40dc5b
jmp 0x40dc40
add eax, 1
mov edx, eax
and edx, reloc.DSOUND.dll_DirectSoundEnumerateW
jns 0x40dc52
dec edx
or edx, 0xfffffffc
inc edx
jne 0x40dc40
mov dword [esp + 0x88], eax
mov eax, dword [esp + 0x9c]
push eax
push edi
call dword [sym.imp.GDI32.dll_SelectObject]
mov ecx, dword [esp + 0x44]
mov edx, dword [esp + 0x40]
push 0xcc0020
push ebp
push ebp
push edi
push ecx
push edx
push ebp
push ebp
push esi
mov dword [esp + 0x58], eax
call dword [sym.imp.GDI32.dll_BitBlt]
push 0x660
push 2
mov dword [esp + 0x1c], 0x64
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov ebx, eax
push ebx
mov dword [esp + 0x28], ebx
call dword [sym.imp.KERNEL32.dll_GlobalLock]
push ebp
mov esi, eax
push ebp
push DirectSoundCreate
push DirectSoundCreate
lea eax, [esi + 0x10]
push eax
mov dword [esi], 0x20
mov dword [esi + 4], 1
mov dword [esi + 0xc], ebp
mov dword [esi + 8], ebp
call dword [sym.imp.USER32.dll_SetRect]
mov eax, dword [esp + 0x84]
add eax, 0xffffffff
imul eax, dword [esp + 0x88]
add eax, dword [esp + 0x90]
cmp dword [esp + 0x44], ebp
mov dword [esp + 0x20], eax
mov dword [esp + 0x18], ebp
jle 0x40de69
mov ecx, dword [esp + 0x40]
xor edi, edi
test ecx, ecx
jle 0x40de49
mov edx, dword [esp + 0x14]
add edx, 2
shl edx, 4
mov dword [esp + 0x1c], edx
lea ecx, [ecx]
cmp edi, ecx
mov edx, edi
mov dword [esp + 0x28], edx
lea eax, [eax + edi*4]
jge 0x40de3a
cmp byte [eax], 0x10
ja 0x40dd42
cmp byte [eax + 1], 0x10
ja 0x40dd42
cmp byte [eax + 2], 0x10
jbe 0x40dd4c
add edi, 1
add eax, 4
cmp edi, ecx
jl 0x40dd31
cmp edi, edx
jle 0x40de3a
mov ecx, dword [esp + 0x14]
cmp dword [esi + 8], ecx
jb 0x40dd91
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov eax, dword [esp + 0x1c]
add dword [esp + 0x14], 0x64
add eax, 0x640
push 2
push eax
push ebx
mov dword [esp + 0x28], eax
call dword [sym.imp.KERNEL32.dll_GlobalReAlloc]
push eax
mov dword [esp + 0x28], eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov edx, dword [esp + 0x28]
mov esi, eax
lea ebx, [ebp + 1]
push ebx
push edi
push ebp
push edx
mov edx, dword [esi + 8]
add edx, 2
shl edx, 4
add edx, esi
push edx
call dword [sym.imp.USER32.dll_SetRect]
mov eax, dword [esp + 0x28]
cmp eax, dword [esi + 0x10]
lea ebp, [esi + 0x10]
jge 0x40ddb9
mov dword [ebp], eax
mov eax, dword [esp + 0x18]
cmp eax, dword [esi + 0x14]
jge 0x40ddc5
mov dword [esi + 0x14], eax
cmp edi, dword [esi + 0x18]
jle 0x40ddcd
mov dword [esi + 0x18], edi
cmp ebx, dword [esi + 0x1c]
jle 0x40ddd5
mov dword [esi + 0x1c], ebx
add dword [esi + 8], 1
cmp dword [esi + 8], 0x7d0
jne 0x40de2e
mov eax, dword [esp + 0x1c]
push esi
push eax
push 0
call dword [sym.imp.GDI32.dll_ExtCreateRegion]
mov ebx, eax
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40de0e
push 2
push ebx
push eax
push eax
call dword [sym.imp.GDI32.dll_CombineRgn]
push ebx
call dword [sym.imp.GDI32.dll_DeleteObject]
jmp 0x40de12
mov dword [esp + 0x10], ebx
push 0
push 0
push DirectSoundCreate
push DirectSoundCreate
push ebp
mov dword [esi + 8], 0
call dword [sym.imp.USER32.dll_SetRect]
mov ebp, dword [esp + 0x18]
mov ebx, dword [esp + 0x24]
mov ecx, dword [esp + 0x40]
mov eax, dword [esp + 0x20]
add edi, 1
cmp edi, ecx
jl 0x40dd20
sub eax, dword [esp + 0x88]
add ebp, 1
cmp ebp, dword [esp + 0x44]
mov dword [esp + 0x20], eax
mov dword [esp + 0x18], ebp
jl 0x40dd05
mov edi, dword [esp + 0x2c]
mov ecx, dword [esp + 0x14]
add ecx, 2
push esi
shl ecx, 4
push ecx
push 0
call dword [sym.imp.GDI32.dll_ExtCreateRegion]
mov esi, eax
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40de9b
push 2
push esi
push eax
push eax
call dword [sym.imp.GDI32.dll_CombineRgn]
push esi
call dword [sym.imp.GDI32.dll_DeleteObject]
jmp 0x40de9f
mov dword [esp + 0x10], esi
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov edx, dword [esp + 0x34]
push edx
push edi
call dword [sym.imp.GDI32.dll_SelectObject]
push edi
call dword [sym.imp.GDI32.dll_DeleteDC]
mov esi, dword [esp + 0x38]
mov eax, dword [esp + 0x30]
push eax
push esi
call dword [sym.imp.GDI32.dll_SelectObject]
push eax
call dword [sym.imp.GDI32.dll_DeleteObject]
push esi
call dword [sym.imp.GDI32.dll_DeleteDC]
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x88
ret
mov eax, ebp
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x88
ret