Function at 0x140012050
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push rbx
sub rsp, 0x30
mov rax, qword [rcx + 0xbb450]
mov rbx, rcx
test rax, rax
je 0x140012084
mov rcx, qword [rcx + 0xbb458]
mov r9d, 2
xor r8d, r8d
mov edx, 0x400
call rax
test eax, eax
jne 0x1400123a8
mov qword [rsp + 0x20], r15
xor r15d, r15d
cmp word [rbx + 0x5d1a4], r15w
je 0x140012280
mov qword [rsp + 0x58], rdi
cmp dword [rbx + 0x1430], r15d
je 0x1400121b5
cmp dword [rbx + 0x220], 9
movzx edi, word [rbx + 0x1c]
movzx r10d, word [rbx + 0x1e]
mov word [rbx + 0x14], di
mov word [rbx + 0x16], r10w
jne 0x14001227b
mov r8, qword [rbx + 8]
mov r11d, r15d
movzx edx, r10w
mov r9d, 1
imul edx, r11d
lea eax, [rdx + r9]
movsxd rcx, eax
movzx eax, word [r8 + rcx*8 + 4]
or ax, word [r8 + rcx*8]
je 0x140012106
inc r9d
cmp r9d, 4
jl 0x1400120e0
inc r11d
cmp r11d, 3
jl 0x1400120d2
movzx eax, di
cmp r11d, eax
jge 0x14001227b
nop dword [rax]
nop word [rax + rax]
movzx ecx, word [rbx + 0x16]
dec r9d
mov eax, 0x55555556
imul r9d
mov eax, edx
shr eax, 0x1f
add edx, eax
lea eax, [rdx + rdx*2]
sub r9d, eax
lea eax, [rcx - 1]
inc r9d
cmp r9d, eax
jge 0x14001219f
movsxd r10, r9d
nop word [rax + rax]
movzx eax, cx
mov r8d, 2
imul eax, r11d
movsxd rcx, eax
mov rax, qword [rbx + 8]
add rcx, r10
lea rax, [rax + rcx*8]
add rax, 8
nop
movzx edx, word [rax - 0x10]
movzx ecx, word [rax]
lea rax, [rax + 4]
add edx, ecx
shr edx, 1
mov word [rax - 0xc], dx
sub r8, 1
jne 0x140012170
movzx eax, word [rbx + 0x16]
add r9d, 3
movzx ecx, ax
add r10, 3
dec eax
cmp r9d, eax
jl 0x140012150
movzx eax, word [rbx + 0x14]
add r11d, 3
cmp r11d, eax
jl 0x140012120
jmp 0x14001227b
movzx r8d, word [rbx + 0x16]
mov rcx, rbx
movzx edx, word [rbx + 0x14]
shl r8, 3
mov qword [rsp + 0x28], r14
call sym.EURawImg.exe_protected:_void____ptr64___cdecl_LibRaw::calloc_unsigned_long_long_unsigned___int64___unsigned_long_long_unsigned___int64_____ptr64
mov r14, rax
mov edi, r15d
cmp r15w, word [rbx + 0x14]
jae 0x14001225e
mov qword [rsp + 0x48], rbp
mov qword [rsp + 0x50], rsi
nop word [rax + rax]
mov esi, r15d
cmp r15w, word [rbx + 0x16]
jae 0x14001224a
mov ebp, edi
sar ebp, 1
nop
mov r8d, esi
mov edx, edi
mov rcx, rbx
call sym.EURawImg.exe_public:_int___cdecl_LibRaw::fcol_int__int____ptr64
movzx ecx, word [rbx + 0x1e]
mov rdx, qword [rbx + 8]
movsxd r9, eax
mov eax, esi
sar eax, 1
imul ecx, ebp
add eax, ecx
cdqe
lea r8, [r9 + rax*4]
movzx eax, word [rbx + 0x16]
imul eax, edi
add eax, esi
inc esi
cdqe
lea rcx, [r9 + rax*4]
movzx eax, word [rdx + r8*2]
mov word [r14 + rcx*2], ax
movzx eax, word [rbx + 0x16]
cmp esi, eax
jl 0x140012200
movzx eax, word [rbx + 0x14]
inc edi
cmp edi, eax
jl 0x1400121f0
mov rsi, qword [rsp + 0x50]
mov rbp, qword [rsp + 0x48]
mov rdx, qword [rbx + 8]
mov rcx, rbx
call sym.EURawImg.exe_protected:_void___cdecl_LibRaw::free_void____ptr64____ptr64
mov qword [rbx + 8], r14
mov r14, qword [rsp + 0x28]
mov word [rbx + 0x5d1a4], r15w
mov rdi, qword [rsp + 0x58]
mov r8d, dword [rbx + 0x220]
cmp r8d, 0x3e8
jbe 0x140012365
cmp dword [rbx + 0x21c], 3
jne 0x140012365
mov edx, dword [rbx + 0x1434]
mov eax, edx
mov ecx, dword [rbx + 0x1430]
xor eax, ecx
or edx, ecx
mov dword [rbx + 0x5d198], eax
je 0x1400122ca
mov dword [rbx + 0x21c], 4
jmp 0x140012365
movzx eax, word [rbx + 0x14]
mov r9d, r8d
shr r9d, 5
and r9d, 1
cmp r9d, eax
jae 0x140012350
nop
mov r8d, dword [rbx + 0x220]
mov ecx, r9d
movzx eax, word [rbx + 0x16]
and ecx, 7
shl ecx, 2
or ecx, 2
shr r8d, cl
and r8d, 1
cmp r8d, eax
jae 0x14001233c
nop dword [rax]
nop word [rax + rax]
movzx eax, word [rbx + 0x16]
imul eax, r9d
add eax, r8d
add r8d, 2
movsxd rcx, eax
mov rax, qword [rbx + 8]
lea rdx, [rax + rcx*8]
movzx eax, word [rax + rcx*8 + 6]
mov word [rdx + 2], ax
movzx eax, word [rbx + 0x16]
cmp r8d, eax
jl 0x140012310
movzx eax, word [rbx + 0x14]
add r9d, 2
cmp r9d, eax
jl 0x1400122e0
mov r8d, dword [rbx + 0x220]
mov eax, r8d
and eax, 0xd5555555
add eax, eax
not eax
and eax, r8d
mov dword [rbx + 0x220], eax
cmp dword [rbx + 0x1430], r15d
je 0x140012375
mov dword [rbx + 0x220], r15d
mov rax, qword [rbx + 0xbb450]
mov r15, qword [rsp + 0x20]
test rax, rax
je 0x1400123a2
mov rcx, qword [rbx + 0xbb458]
mov r9d, 2
mov edx, 0x400
lea r8d, [r9 - 1]
call rax
test eax, eax
jne 0x1400123c2
add rsp, 0x30
pop rbx
ret
lea rdx, [0x1400a4c08]
mov dword [rsp + 0x40], 6
lea rcx, [rsp + 0x40]
call sub.VCRUNTIME140.dll__CxxThrowException
int3
lea rdx, [0x1400a4c08]
mov dword [rsp + 0x40], 6
lea rcx, [rsp + 0x40]
call sub.VCRUNTIME140.dll__CxxThrowException
int3