Function at 0x471580
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x5d1450
mov eax, dword fs:[0]
push eax
sub esp, 0x54
push ebx
push edi
mov eax, dword [0x628560]
xor eax, esp
push eax
lea eax, [esp + 0x60]
mov dword fs:[0], eax
xor eax, eax
push eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], eax
call fcn.004f502d
add esp, 4
cmp dword [esi + 0x8c], 1
jne 0x4715d3
mov edi, 0x280
mov ebx, 0x1e0
jmp 0x4715dd
mov edi, 0x2c0
mov ebx, 0x240
push 0x2c
lea eax, [esp + 0x34]
push 0
push eax
call fcn.004f9940
add esp, 0xc
push ebx
push edi
push 1
lea ebx, [esp + 0x3c]
call fcn.0048a550
add esp, 0xc
xor ebx, ebx
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x14], ebx
mov dword [esp + 0x18], ebx
mov byte [esi + 0x2b2], 1
cmp byte [esi + 0x2b0], 0
je 0x471792
mov ecx, dword [esi + 0xd18]
push ecx
call dword [sym.imp.exp.dll_int___cdecl_JMVSDK_StartChannel_MJpeg_int_]
mov edi, dword [esp + 0x34]
add esp, 4
test eax, eax
jl 0x4717c5
mov edx, dword [esi + 0xd18]
push edx
lea eax, [esp + 0x28]
push eax
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x28]
push edx
push edi
call dword [sym.imp.exp.dll_int___cdecl_JMVSDK_GetVideo_MJpeg_unsigned_char___int___int___unsigned_long_int___int_]
add esp, 0x14
cmp eax, ebx
jl 0x4717c5
call fcn.004d4cf7
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
je 0x47180d
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x10], eax
push ecx
mov dword [esp + 0x6c], ebx
mov ecx, esp
mov dword [esp + 0x2c], esp
push 0x60518f
call fcn.0041c4a0
lea ecx, [esp + 0x24]
push ecx
push esi
call fcn.0044cf70
push eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x6c], 1
call fcn.00404ec0
mov byte [esp + 0x68], 0
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x4716dc
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ebx, dword [esp + 0x10]
push 0x60ca8c
push ebx
call fcn.004f621a
mov edi, eax
add esp, 8
test edi, edi
je 0x471817
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x30]
push edi
push ecx
push 1
push edx
call fcn.004f680f
push edi
call fcn.004f6518
lea eax, [ebx - 0x10]
add esp, 0x14
mov dword [esp + 0x68], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x471737
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
cmp dword [esi + 0xd34], 0
je 0x471779
cmp dword [esi + 0x284], 0
je 0x471779
cmp byte [esi + 0x7d50], 0
je 0x471779
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x18]
mov eax, ecx
sub eax, edx
cmp ecx, edx
jae 0x471767
add eax, 0x5265c00
cmp eax, 0x1770
jbe 0x471779
or dword [esi + 0x2b4], 8
mov dword [esp + 0x18], ecx
mov ecx, dword [esi + 0xd18]
push ecx
call dword [sym.imp.exp.dll_int___cdecl_JMVSDK_StopChannel_MJpeg_int_]
add esp, 4
mov byte [esi + 0x2b0], 0
xor ebx, ebx
mov eax, dword [esi + 0x2b4]
test al, 8
je 0x4717ac
and eax, 0xfffffff7
mov dword [esi + 0x2b4], eax
mov byte [esi + 0x2b0], 1
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp byte [esi + 0x2b2], 0
jne 0x471613
mov edi, dword [esp + 0x30]
mov ecx, dword [esi + 0xd18]
push ecx
call dword [sym.imp.exp.dll_int___cdecl_JMVSDK_StopChannel_MJpeg_int_]
add esp, 4
cmp edi, ebx
je 0x4717e8
movzx edx, byte [edi - 1]
sub edi, edx
push edi
call fcn.004f2cc4
add esp, 4
mov byte [esi + 0x2b0], 0
mov byte [esi + 0x2b2], 0
mov eax, 1
mov ecx, dword [esp + 0x60]
mov dword fs:[0], ecx
pop ecx
pop edi
pop ebx
mov esp, ebp
pop ebp
ret
push 0x80004005
call fcn.00404150
add ebx, 0xfffffff0
mov dword [esp + 0x68], 0xffffffff
lea edx, [ebx + 0xc]
or eax, 0xffffffff
lock xadd dword [edx], eax
dec eax
test eax, eax
jg 0x47183b
mov ecx, dword [ebx]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push ebx
call eax
or eax, 0xffffffff
mov ecx, dword [esp + 0x60]
mov dword fs:[0], ecx
pop ecx
pop edi
pop ebx
mov esp, ebp
pop ebp
ret