Function at 0x40d730
Capabilities:
Delete file

Disassembly:
sub esp, 0x164
mov eax, dword [str.temp.avi]
mov ecx, dword [0x442104]
mov dl, byte [0x442108]
push ebx
push ebp
push esi
xor ebp, ebp
push edi
mov dword [esp + 0x10], ebp
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], ecx
mov byte [esp + 0x2c], dl
call dword [sym.imp.WINMM.dll_waveInGetNumDevs]
mov ebx, eax
mov dword [0x442e68], ebp
neg ebx
sbb ebx, ebx
mov dword [0x442e6c], ebp
neg ebx
mov dword [0x442e70], ebp
mov dword [0x442da8], ebp
call sub.AVIFIL32.dll_AVIFileInit
push ebp
lea eax, [esp + 0x28]
push 0x1001
lea ecx, [esp + 0x1c]
push eax
push ecx
mov dword [esp + 0x24], ebp
mov dword [esp + 0x28], ebp
mov dword [esp + 0x30], ebp
call sub.AVIFIL32.dll_AVIFileOpenA
test eax, eax
jl 0x40d9ce
push 0x64
push 0x64
mov ecx, 0x23
xor eax, eax
lea edi, [esp + 0x64]
push ebp
lea edx, [esp + 0x9c]
push ebp
rep stosd dword es:[edi], eax
push edx
mov dword [esp + 0x70], 0x73646976
mov dword [esp + 0x74], 0x44495658
mov dword [esp + 0x84], 0x64
mov dword [esp + 0x88], 4
mov dword [esp + 0x9c], 0xffffffff
mov dword [esp + 0x98], 0x9c40
call dword [sym.imp.USER32.dll_SetRect]
mov edi, str.VideoStream
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0xa8]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x1c]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov eax, dword [esp + 0x14]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x5c]
push ecx
push edx
push eax
call sub.AVIFIL32.dll_AVIFileCreateStreamA
test eax, eax
jl 0x40d9ce
cmp ebx, ebp
mov esi, 1
je 0x40d98c
push ebp
push ebp
push ebp
push ebp
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov dword [0x442da8], eax
mov ecx, 0x22
xor eax, eax
mov edi, 0x442db0
rep stosd dword es:[edi], eax
push ebp
mov dword [0x442d64], ebp
mov dword [0x442d5c], ebp
call dword [sym.imp.ole32.dll_CoInitialize]
test eax, eax
jl 0x40d9ce
push ebp
push 0x442e68
push 0x442e50
call sub.DSOUND.dll_DirectSoundCaptureCreate
test eax, eax
jl 0x40d9ce
xor ecx, ecx
push 0x442e38
mov dword [0x442e38], ecx
push 0xf
mov dword [0x442e3c], ecx
mov word [0x442e38], si
mov dword [0x442e40], ecx
mov dword [0x442e44], ecx
mov word [0x442e48], cx
call fcn.0040d340
push 0x442e38
call fcn.0040cf80
add esp, 0xc
test eax, eax
jge 0x40d906
push ebp
push ebp
push str.CreateCaptureBuffer
call sub.MFC42.DLL_AfxMessageBox
jmp 0x40d9ce
mov ecx, 0x23
xor eax, eax
lea edi, [esp + 0xe8]
rep stosd dword es:[edi], eax
mov eax, dword [0x442e44]
lea ecx, [esp + 0x18]
and eax, 0xffff
mov dword [esp + 0xe8], 0x73647561
mov edx, eax
mov dword [esp + 0xfc], eax
imul edx, dword [0x442e3c]
mov dword [esp + 0x118], eax
lea eax, [esp + 0xe8]
mov dword [esp + 0x100], edx
mov edx, dword [esp + 0x14]
push eax
push ecx
push edx
mov dword [esp + 0xf8], ebp
mov dword [esp + 0x120], 0xffffffff
call sub.AVIFIL32.dll_AVIFileCreateStreamA
test eax, eax
jl 0x40d9ce
mov eax, dword [esp + 0x18]
push 0x12
push 0x442e38
push ebp
push eax
call sub.AVIFIL32.dll_AVIStreamSetFormat
test eax, eax
jl 0x40d9ce
mov ecx, 0xb
xor eax, eax
lea edi, [esp + 0x30]
lea edx, [esp + 0x30]
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x60]
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x34], ecx
push ebp
push edx
lea ecx, [esp + 0x28]
push eax
push ecx
mov dword [esp + 0x40], 0x73646976
mov dword [esp + 0x54], 0xc
mov dword [esp + 0x48], esi
call sub.AVIFIL32.dll_AVIMakeCompressedStream
test eax, eax
jge 0x40d9d6
mov dword [esp + 0x10], 0x80004005
mov eax, dword [esp + 0x20]
cmp eax, ebp
je 0x40d9e8
push eax
call sub.AVIFIL32.dll_AVIStreamRelease
mov dword [esp + 0x20], ebp
mov eax, dword [esp + 0x1c]
cmp eax, ebp
je 0x40d9fa
push eax
call sub.AVIFIL32.dll_AVIStreamRelease
mov dword [esp + 0x1c], ebp
mov eax, dword [esp + 0x18]
cmp eax, ebp
je 0x40da0c
push eax
call sub.AVIFIL32.dll_AVIStreamRelease
mov dword [esp + 0x18], ebp
mov eax, dword [esp + 0x14]
cmp eax, ebp
je 0x40da1e
push eax
call sub.AVIFIL32.dll_AVIFileRelease
mov dword [esp + 0x14], ebp
mov eax, dword [0x442da8]
cmp eax, ebp
je 0x40da34
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [0x442da8], ebp
call sub.AVIFIL32.dll_AVIFileExit
lea edx, [esp + 0x24]
push edx
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x164
ret