Function at 0x6a217afc
Capabilities:
Create thread

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x4c
mov ebp, dword [esp + 0x60]
test byte [ebp + 0x340], 1
je 0x6a217d78
mov eax, dword [ebp + 0xc]
test byte [eax + 0x13], 0x40
je 0x6a217d78
mov eax, dword [ebp + 0x33c]
test eax, eax
je 0x6a217d84
cmp eax, 1
jle 0x6a217d78
cmp eax, 0x40
jg 0x6a217edc
mov ebx, dword [ebp + 0x44]
mov esi, dword [ebx + 0x20]
test esi, esi
jne 0x6a217f36
mov dword [esp], 0x1068
call sub.avutil_52.dll_av_mallocz
mov dword [esp + 0x2c], eax
mov dword [ebx + 0x20], eax
test eax, eax
je 0x6a217ee6
mov dword [eax], ebp
mov dword [esp], 0xc00
call sub.avutil_52.dll_av_fifo_alloc
mov edx, dword [esp + 0x2c]
mov dword [edx + 0x1c], eax
test eax, eax
je 0x6a217ef0
mov eax, edx
add eax, 0x20
mov dword [esp], eax
call sub.KERNEL32.dll_InitializeCriticalSection
push eax
mov eax, dword [esp + 0x2c]
add eax, 0xc40
mov dword [esp], eax
call sub.KERNEL32.dll_InitializeCriticalSection
push edx
mov eax, dword [esp + 0x2c]
add eax, 4
mov dword [esp], eax
call sub.KERNEL32.dll_InitializeCriticalSection
push ecx
mov eax, dword [esp + 0x2c]
add eax, 0x38
mov ebx, dword [0x6af0b508]
test ebx, ebx
je 0x6a217db4
mov dword [esp], eax
call ebx
push eax
mov eax, dword [esp + 0x2c]
add eax, 0xc58
mov dword [esp], eax
call ebx
push eax
mov eax, dword [ebp + 0x33c]
test eax, eax
jle 0x6a217d6c
mov dword [esp + 0x28], 0
jmp 0x6a217d16
mov eax, dword [eax + 0x40]
mov edi, ebx
mov esi, ebp
mov ecx, 0xf2
rep movsd dword es:[edi], dword [esi]
mov dword [ebx + 0x40], eax
mov dword [ebx + 0x44], 0
mov edx, dword [ebp + 0xc]
mov esi, dword [ebp + 0x40]
mov ecx, dword [edx + 0x34]
mov edi, eax
rep movsb byte es:[edi], byte [esi]
mov dword [ebx + 0x33c], 1
and dword [ebx + 0x344], 0xfffffffe
mov dword [esp + 8], 0
mov edx, dword [esp + 0x64]
mov dword [esp + 4], edx
lea eax, [esp + 0x3c]
mov dword [esp], eax
call sub.avutil_52.dll_av_dict_copy
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x6ab34f29
mov dword [esp + 4], 0x6ab34f2b
lea edx, [esp + 0x3c]
mov dword [esp], edx
call sub.avutil_52.dll_av_dict_set
lea eax, [esp + 0x3c]
mov dword [esp + 8], eax
mov eax, dword [ebp + 0xc]
mov dword [esp + 4], eax
mov dword [esp], ebx
call sym.avcodec_54.dll_avcodec_open2
test eax, eax
js 0x6a217da4
lea eax, [esp + 0x3c]
mov dword [esp], eax
call sub.avutil_52.dll_av_dict_free
mov eax, dword [ebx + 0x44]
mov ecx, dword [eax + 0x20]
test ecx, ecx
jne 0x6a217efd
mov edx, dword [esp + 0x2c]
mov dword [eax + 0x20], edx
mov eax, dword [esp + 0x28]
add eax, 0xc6
shl eax, 4
mov esi, edx
add esi, eax
lea eax, [esi + 4]
mov dword [esi + 8], 0x6a217634
mov dword [esi + 0xc], ebx
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x6a217524
mov dword [esp + 4], 0
mov dword [esp], 0
call sub.msvcrt.dll__beginthreadex
mov dword [esi + 4], eax
test eax, eax
je 0x6a217d33
inc dword [esp + 0x28]
mov edx, dword [esp + 0x28]
cmp dword [ebp + 0x33c], edx
jle 0x6a217d6c
mov dword [esp + 0x3c], 0
mov eax, dword [ebp + 0xc]
mov dword [esp], eax
call sym.avcodec_54.dll_avcodec_alloc_context3
mov ebx, eax
test eax, eax
jne 0x6a217bfc
mov edx, dword [esp + 0x28]
mov dword [ebp + 0x33c], edx
mov dword [esp + 8], str.ff_frame_thread_encoder_init_failed_n
mov dword [esp + 4], 0x10
mov dword [esp], ebp
call sub.avutil_52.dll_av_log
mov dword [esp], ebp
call fcn.6a2178c0
mov eax, 0xffffffff
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [ebp + 0x344], 1
nop
xor eax, eax
add esp, 0x4c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], ebp
call fcn.6a4b62f4
cmp eax, 0x40
jle 0x6a217d96
mov eax, 0x40
mov dword [ebp + 0x33c], eax
jmp 0x6a217b2f
lea edx, [esp + 0x3c]
mov dword [esp], edx
call sub.avutil_52.dll_av_dict_free
jmp 0x6a217d33
mov dword [esp], 0x40
call sub.avutil_52.dll_av_mallocz
mov ebx, eax
test eax, eax
je 0x6a217e3e
mov eax, dword [esp + 0x2c]
mov dword [eax + 0x38], ebx
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x7fffffff
mov dword [esp + 4], 0
mov dword [esp], 0
call sub.KERNEL32.dll_CreateSemaphoreA
sub esp, 0x10
mov dword [ebx + 0x34], eax
test eax, eax
je 0x6a217e3e
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], 0
call sub.KERNEL32.dll_CreateEventA
sub esp, 0x10
mov dword [ebx + 0x38], eax
test eax, eax
je 0x6a217e3e
lea eax, [ebx + 0x18]
mov dword [esp], eax
call sub.KERNEL32.dll_InitializeCriticalSection
push eax
mov dword [esp], ebx
call sub.KERNEL32.dll_InitializeCriticalSection
push eax
mov dword [esp], 0x40
call sub.avutil_52.dll_av_mallocz
mov ebx, eax
test eax, eax
je 0x6a217be1
mov eax, dword [esp + 0x2c]
mov dword [eax + 0xc58], ebx
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x7fffffff
mov dword [esp + 4], 0
mov dword [esp], 0
call sub.KERNEL32.dll_CreateSemaphoreA
sub esp, 0x10
mov dword [ebx + 0x34], eax
test eax, eax
je 0x6a217be1
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], 0
call sub.KERNEL32.dll_CreateEventA
sub esp, 0x10
mov dword [ebx + 0x38], eax
test eax, eax
je 0x6a217be1
lea eax, [ebx + 0x18]
mov dword [esp], eax
call sub.KERNEL32.dll_InitializeCriticalSection
push esi
mov dword [esp], ebx
call sub.KERNEL32.dll_InitializeCriticalSection
push edi
jmp 0x6a217be1
mov eax, 0xffffffea
jmp 0x6a217d7a
mov eax, 0xfffffff4
jmp 0x6a217d7a
mov dword [esp + 0x28], 0
jmp 0x6a217d33
mov dword [esp + 0x14], 0xb1
mov dword [esp + 0x10], 0x6ab34e84
mov dword [esp + 0xc], str._thread_avctx__internal__frame_thread_encoder
mov dword [esp + 8], 0x6ab34f0b
mov dword [esp + 4], 0
mov dword [esp], 0
call sub.avutil_52.dll_av_log
call sub.msvcrt.dll_abort
mov dword [esp + 0x14], 0x8b
mov dword [esp + 0x10], 0x6ab34e84
mov dword [esp + 0xc], str._avctx__internal__frame_thread_encoder
jmp 0x6a217f15