Function at 0x18017b660
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push rbp
push rbx
push r12
lea rbp, [rsp - 0x410]
sub rsp, 0x510
mov rax, qword [0x180672700]
xor rax, rsp
mov qword [rbp + 0x3e0], rax
mov qword [rbp - 0x30], rdx
mov rbx, rcx
lea rdx, [rbp - 0x70]
mov qword [rbp - 0x28], r8
xor r12d, r12d
mov dword [rbp - 0x54], 0xff
call fcn.18017b290
test rax, rax
je 0x18017b6e8
mov eax, dword [rbx + 4]
mov r9d, eax
neg r9d
mov dword [rbp - 0x80], eax
cmovs r9d, eax
mov dword [rbx + 4], r9d
cmp r9d, 0x1000000
jbe 0x18017b6ef
mov edx, dword [0x180677d3c]
mov rax, qword gs:[0x58]
mov ecx, 0x38
mov rax, qword [rax + rdx*8]
lea rdx, str.too_large
mov qword [rcx + rax], rdx
xor eax, eax
jmp 0x18017be3e
mov r8d, dword [rbx]
cmp r8d, 0x1000000
ja 0x18017b6c5
mov eax, dword [rbp - 0x64]
mov dword [rsp + 0x3c], eax
mov eax, dword [rbp - 0x60]
mov qword [rsp + 0x548], rsi
mov esi, dword [rbp - 0x58]
mov dword [rsp + 0x44], eax
mov eax, dword [rbp - 0x5c]
mov qword [rsp + 0x508], rdi
mov edi, dword [rbp - 0x70]
mov dword [rsp + 0x24], eax
mov eax, dword [rbp - 0x54]
mov qword [rsp + 0x500], r13
mov r13d, dword [rbp - 0x6c]
mov qword [rsp + 0x4f8], r14
mov r14d, dword [rbp - 0x68]
mov dword [rsp + 0x30], eax
mov eax, dword [rbp - 0x50]
mov dword [rsp + 0x50], eax
mov dword [rsp + 0x34], esi
mov dword [rsp + 0x2c], r13d
mov dword [rsp + 0x28], r14d
mov dword [rsp + 0x38], edi
cmp r14d, 0xc
jne 0x18017b784
cmp edi, 0x18
jge 0x18017b79b
mov ecx, r13d
sub ecx, eax
mov eax, 0x55555556
sub ecx, 0x18
imul ecx
mov r12d, edx
shr r12d, 0x1f
add r12d, edx
jmp 0x18017b796
cmp edi, 0x10
jge 0x18017b79b
mov r12d, r13d
sub r12d, eax
sub r12d, r14d
sar r12d, 2
test r12d, r12d
jne 0x18017b7e4
mov ecx, dword [rbx + 0xc0]
sub ecx, dword [rbx + 0xd0]
add ecx, dword [rbx + 0xb8]
lea eax, [rcx - 1]
cmp eax, 0x3ff
ja 0x18017c601
cmp r13d, ecx
jl 0x18017c5d7
mov edx, r13d
sub edx, ecx
cmp edx, 0x400
jg 0x18017c5d7
mov rcx, rbx
call fcn.1801715a0
mov r9d, dword [rbx + 4]
mov r8d, dword [rbx]
cmp edi, 0x18
jne 0x18017b7f6
cmp esi, 0xff000000
jne 0x18017b7f6
lea eax, [rdi - 0x15]
jmp 0x18017b800
xor eax, eax
test esi, esi
setne al
add eax, 3
mov dword [rbx + 8], eax
test r8d, r8d
js 0x18017c5ad
jne 0x18017b818
lea ecx, [r8*4]
jmp 0x18017b83a
mov eax, 0x7fffffff
cdq
idiv r8d
cmp eax, 4
jl 0x18017c5ad
lea ecx, [r8*4]
test ecx, ecx
js 0x18017c5ad
test r9d, r9d
js 0x18017c5ad
je 0x18017b856
mov eax, 0x7fffffff
cdq
idiv r9d
cmp ecx, eax
jg 0x18017c5ad
test r8d, r8d
je 0x18017b86d
mov eax, 0x7fffffff
cdq
idiv r8d
cmp eax, 4
jl 0x18017c583
lea ecx, [r8*4]
test r9d, r9d
je 0x18017b88b
mov eax, 0x7fffffff
cdq
idiv r9d
cmp ecx, eax
jg 0x18017c583
imul r8d, r9d
lea eax, [r8*4]
movsxd rcx, eax
call fcn.1802153c0
mov qword [rbp - 0x78], rax
mov rsi, rax
test rax, rax
je 0x18017c583
mov qword [rsp + 0x4f0], r15
cmp edi, 0x10
jge 0x18017be82
xor edi, edi
mov dword [rsp + 0x20], edi
test r12d, r12d
je 0x18017be59
cmp r12d, 0x100
jg 0x18017be59
test r12d, r12d
jle 0x18017ba3a
mov r13d, dword [rsp + 0x28]
lea r14, [rbx + 0x30]
xor r15d, r15d
movsxd rsi, r12d
lea rdi, [rbp - 0x1d]
nop dword [rax + rax]
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x18017b91f
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18017b949
cmp dword [rbx + 0x30], 0
lea r14, [rbx + 0x30]
je 0x18017b947
mov rcx, rbx
call fcn.180171520
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18017b949
xor cl, cl
lea rdx, [rbp - 0x1e]
mov qword [rsp + 0x60], r14
mov byte [rdx + r15*4], cl
cmp rax, qword [rbx + 0xc8]
jae 0x18017b96e
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18017b994
cmp dword [r14], 0
je 0x18017b992
mov rcx, rbx
call fcn.180171520
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18017b994
xor cl, cl
mov byte [rbp + r15*4 - 0x1f], cl
cmp rax, qword [rbx + 0xc8]
jae 0x18017b9b5
movzx ecx, byte [rax]
lea r14, [rbx + 0x30]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18017b9db
cmp dword [r14], 0
je 0x18017b9d9
mov rcx, rbx
call fcn.180171520
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18017b9db
xor cl, cl
lea rdx, [rbp - 0x20]
mov byte [rdx + r15*4], cl
cmp r13d, 0xc
je 0x18017ba17
cmp rax, qword [rbx + 0xc8]
jae 0x18017b9fe
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18017ba17
mov rax, qword [rsp + 0x60]
cmp dword [rax], 0
je 0x18017ba17
mov rcx, rbx
call fcn.180171520
inc qword [rbx + 0xc0]
mov byte [rdi + r15*4], 0xff
inc r15
cmp r15, rsi
jl 0x18017b900
mov edi, dword [rsp + 0x20]
mov rsi, qword [rbp - 0x78]
mov r13d, dword [rsp + 0x2c]
mov r14d, dword [rsp + 0x28]
xor eax, eax
mov rcx, rbx
cmp r14d, 0xc
setne al
add eax, 3
imul eax, r12d
sub r13d, eax
sub r13d, dword [rsp + 0x50]
sub r13d, r14d
mov edx, r13d
call fcn.1801715a0
mov r13d, dword [rsp + 0x38]
cmp r13d, 1
jne 0x18017ba78
mov r12d, dword [rbx]
add r12d, 7
shr r12d, 3
jmp 0x18017ba96
cmp r13d, 4
jne 0x18017ba89
mov r12d, dword [rbx]
inc r12d
shr r12d, 1
jmp 0x18017ba96
cmp r13d, 8
jne 0x18017bde9
mov r12d, dword [rbx]
mov eax, dword [rbx + 4]
neg r12d
and r12d, 3
mov edx, eax
cmp r13d, 1
jne 0x18017bc49
xor r13d, r13d
test eax, eax
jle 0x18017c4aa
xor edi, edi
nop dword [rax]
mov r8, qword [rbx + 0xc0]
mov r14d, 7
cmp r8, qword [rbx + 0xc8]
jae 0x18017bae6
movzx ecx, byte [r8]
inc r8
mov qword [rbx + 0xc0], r8
jmp 0x18017bb0d
cmp dword [rbx + 0x30], 0
je 0x18017bb0b
mov rcx, rbx
call fcn.180171520
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
lea r8, [rax + 1]
mov qword [rbx + 0xc0], r8
jmp 0x18017bb0d
xor cl, cl
mov r9d, dword [rbx]
xor r15d, r15d
movzx r10d, cl
mov rcx, r8
test r9d, r9d
jle 0x18017bbee
mov rdx, r8
nop word [rax + rax]
mov eax, r10d
mov ecx, r14d
sar eax, cl
mov r8d, edx
and eax, 1
lea rcx, [rax*4]
movzx eax, byte [rbp + rcx - 0x20]
mov byte [rdi + rsi], al
movzx eax, byte [rbp + rcx - 0x1f]
mov byte [rdi + rsi + 1], al
movzx eax, byte [rbp + rcx - 0x1e]
mov rcx, rdx
mov byte [rdi + rsi + 2], al
lea eax, [r15 + 1]
mov byte [rdi + rsi + 3], 0xff
mov r15d, eax
add rdi, 4
cmp eax, r9d
je 0x18017bbee
sub r14d, 1
jns 0x18017bbd5
mov r14d, 7
cmp rdx, qword [rbx + 0xc8]
jae 0x18017bba2
movzx r8d, byte [rdx]
lea rcx, [rdx + 1]
mov qword [rbx + 0xc0], rcx
movzx r10d, r8b
jmp 0x18017bbdc
cmp dword [rbx + 0x30], 0
je 0x18017bbcc
mov rcx, rbx
call fcn.180171520
mov rax, qword [rbx + 0xc0]
movzx r8d, byte [rax]
lea rcx, [rax + 1]
mov qword [rbx + 0xc0], rcx
movzx r10d, r8b
jmp 0x18017bbdc
xor r8b, r8b
movzx r10d, r8b
jmp 0x18017bbdc
mov rcx, qword [rbx + 0xc0]
mov r9d, dword [rbx]
mov rdx, rcx
mov r8d, ecx
cmp r15d, r9d
jl 0x18017bb30
test r12d, r12d
je 0x18017bc33
cmp qword [rbx + 0x10], 0
je 0x18017bc26
mov r9d, dword [rbx + 0xc8]
sub r9d, r8d
cmp r9d, r12d
jge 0x18017bc26
mov rax, qword [rbx + 0xc8]
mov edx, r12d
mov rcx, qword [rbx + 0x28]
sub edx, r9d
mov qword [rbx + 0xc0], rax
call qword [rbx + 0x18]
jmp 0x18017bc33
mov eax, r12d
add rax, rcx
mov qword [rbx + 0xc0], rax
mov eax, dword [rbx + 4]
inc r13d
mov edx, eax
cmp r13d, eax
jl 0x18017bac0
jmp 0x18017c4aa
xor r15d, r15d
test eax, eax
jle 0x18017c4aa
xor r14d, r14d
cmp dword [rbx], r14d
jle 0x18017bd90
mov r8, qword [rbx + 0xc0]
cmp r8, qword [rbx + 0xc8]
jae 0x18017bc80
movzx ecx, byte [r8]
inc r8
mov qword [rbx + 0xc0], r8
jmp 0x18017bca7
cmp dword [rbx + 0x30], 0
je 0x18017bca5
mov rcx, rbx
call fcn.180171520
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
lea r8, [rax + 1]
mov qword [rbx + 0xc0], r8
jmp 0x18017bca7
xor cl, cl
xor r9d, r9d
movzx eax, cl
cmp r13d, 4
jne 0x18017bcbd
mov r9d, eax
and r9d, 0xf
shr eax, 4
movsxd rcx, edi
lea rdx, [rax*4]
movzx eax, byte [rbp + rdx - 0x20]
inc edi
mov byte [rcx + rsi], al
movzx eax, byte [rbp + rdx - 0x1f]
movsxd rcx, edi
inc edi
mov byte [rcx + rsi], al
movzx eax, byte [rbp + rdx - 0x1e]
movsxd rcx, edi
inc edi
mov byte [rcx + rsi], al
movsxd rax, edi
inc edi
mov byte [rax + rsi], 0xff
lea eax, [r14 + 1]
cmp eax, dword [rbx]
je 0x18017bd90
cmp r13d, 8
jne 0x18017bd4b
cmp r8, qword [rbx + 0xc8]
jae 0x18017bd21
movzx ecx, byte [r8]
lea rax, [r8 + 1]
mov qword [rbx + 0xc0], rax
jmp 0x18017bd47
cmp dword [rbx + 0x30], 0
je 0x18017bd45
mov rcx, rbx
call fcn.180171520
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18017bd47
xor cl, cl
movzx r9d, cl
movsxd rcx, edi
lea rdx, [r9*4]
movzx eax, byte [rbp + rdx - 0x20]
inc edi
add r14d, 2
mov byte [rcx + rsi], al
movzx eax, byte [rbp + rdx - 0x1f]
movsxd rcx, edi
inc edi
mov byte [rcx + rsi], al
movzx eax, byte [rbp + rdx - 0x1e]
movsxd rcx, edi
inc edi
mov byte [rcx + rsi], al
movsxd rax, edi
inc edi
mov byte [rax + rsi], 0xff
cmp r14d, dword [rbx]
jl 0x18017bc60
test r12d, r12d
je 0x18017bdd3
cmp qword [rbx + 0x10], 0
je 0x18017bdc9
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, r12d
jge 0x18017bdc9
mov rax, qword [rbx + 0xc8]
mov edx, r12d
sub edx, ecx
mov qword [rbx + 0xc0], rax
mov rcx, qword [rbx + 0x28]
call qword [rbx + 0x18]
jmp 0x18017bdd3
mov eax, r12d
add qword [rbx + 0xc0], rax
mov eax, dword [rbx + 4]
inc r15d
mov edx, eax
cmp r15d, eax
jl 0x18017bc54
jmp 0x18017c4aa
mov rcx, rsi
call fcn.1802152c8
mov edx, dword [0x180677d3c]
mov rax, qword gs:[0x58]
mov ecx, 0x38
mov rax, qword [rax + rdx*8]
lea rdx, str.bad_bpp
mov qword [rcx + rax], rdx
xor eax, eax
mov r15, qword [rsp + 0x4f0]
mov r13, qword [rsp + 0x500]
mov rdi, qword [rsp + 0x508]
mov rsi, qword [rsp + 0x548]
mov r14, qword [rsp + 0x4f8]
mov rcx, qword [rbp + 0x3e0]
xor rcx, rsp
call fcn.1801fbc70
add rsp, 0x510
pop r12
pop rbx
pop rbp
ret
mov rcx, rsi
call fcn.1802152c8
mov edx, dword [0x180677d3c]
mov rax, qword gs:[0x58]
mov ecx, 0x38
mov rax, qword [rax + rdx*8]
lea rdx, str.invalid
jmp 0x18017be10
sub r13d, dword [rsp + 0x50]
mov rcx, rbx
sub r13d, r14d
mov dword [rsp + 0x40], 0
mov edx, r13d
mov dword [rsp + 0x48], 0
mov dword [rsp + 0x28], 0
xor r15d, r15d
mov dword [rsp + 0x4c], 0
xor edi, edi
xor r12d, r12d
call fcn.1801715a0
mov ecx, dword [rsp + 0x38]
cmp ecx, 0x18
jne 0x18017becd
mov eax, dword [rbx]
lea edx, [rax + rax*2]
jmp 0x18017beda
cmp ecx, 0x10
jne 0x18017bed8
mov edx, dword [rbx]
add edx, edx
jmp 0x18017beda
xor edx, edx
neg edx
and edx, 3
mov dword [rsp + 0x7c], edx
cmp ecx, 0x18
jne 0x18017bf0a
mov r13d, dword [rsp + 0x34]
mov r9d, edi
mov qword [rsp + 0x58], 1
mov r10d, edi
mov r8d, edi
mov r11d, edi
mov r14d, edi
jmp 0x18017c12c
mov r9d, dword [rsp + 0x44]
xor eax, eax
mov qword [rsp + 0x58], rax
cmp ecx, 0x20
jne 0x18017bf7a
mov qword [rsp + 0x58], rax
mov eax, dword [rsp + 0x24]
cmp eax, 0xff
jne 0x18017bf7e
xor eax, eax
mov qword [rsp + 0x58], rax
cmp r9d, 0xff00
jne 0x18017bf7a
cmp dword [rsp + 0x3c], 0xff0000
mov qword [rsp + 0x58], rax
jne 0x18017bf7a
mov r13d, dword [rsp + 0x34]
mov qword [rsp + 0x58], rax
cmp r13d, 0xff000000
jne 0x18017bfa2
mov qword [rsp + 0x58], 2
mov r9d, eax
mov r10d, eax
mov r8d, eax
mov r11d, eax
mov r14d, eax
jmp 0x18017c12c
mov eax, dword [rsp + 0x24]
mov edi, dword [rsp + 0x3c]
test edi, edi
je 0x18017c557
test r9d, r9d
je 0x18017c557
test eax, eax
je 0x18017c557
mov r13d, dword [rsp + 0x34]
jmp 0x18017bfa6
mov edi, dword [rsp + 0x3c]
mov ecx, edi
call fcn.18017b1b0
mov edx, edi
mov ecx, edi
shr edx, 1
and ecx, 0x55555555
and edx, 0x55555555
add edx, ecx
lea r11d, [rax - 7]
mov ecx, edx
mov dword [rsp + 0x40], r11d
and edx, 0x33333333
shr ecx, 2
and ecx, 0x33333333
add ecx, edx
mov edx, ecx
shr edx, 4
add edx, ecx
mov ecx, r9d
and edx, 0xf0f0f0f
mov eax, edx
shr eax, 8
add edx, eax
mov eax, edx
shr eax, 0x10
add eax, edx
movzx r10d, al
call fcn.18017b1b0
mov edi, dword [rsp + 0x24]
mov edx, r9d
shr edx, 1
mov ecx, r9d
and edx, 0x55555555
and ecx, 0x55555555
add edx, ecx
lea r14d, [rax - 7]
mov ecx, edx
mov dword [rsp + 0x48], r14d
and edx, 0x33333333
shr ecx, 2
and ecx, 0x33333333
add ecx, edx
mov edx, ecx
shr edx, 4
add edx, ecx
mov ecx, edi
and edx, 0xf0f0f0f
mov eax, edx
shr eax, 8
add edx, eax
mov eax, edx
shr eax, 0x10
add eax, edx
movzx r9d, al
call fcn.18017b1b0
sub eax, 7
mov edx, edi
shr edx, 1
mov ecx, edi
and edx, 0x55555555
mov dword [rsp + 0x28], eax
and ecx, 0x55555555
add edx, ecx
mov ecx, edx
and edx, 0x33333333
shr ecx, 2
and ecx, 0x33333333
add ecx, edx
mov edx, ecx
shr edx, 4
add edx, ecx
mov ecx, r13d
and edx, 0xf0f0f0f
mov eax, edx
shr eax, 8
add edx, eax
mov eax, edx
shr eax, 0x10
add eax, edx
movzx r15d, al
call fcn.18017b1b0
lea r8d, [rax - 7]
mov edx, r13d
shr edx, 1
mov ecx, r13d
and edx, 0x55555555
mov dword [rsp + 0x4c], r8d
and ecx, 0x55555555
add edx, ecx
mov ecx, edx
and edx, 0x33333333
shr ecx, 2
and ecx, 0x33333333
add ecx, edx
mov edx, ecx
shr edx, 4
add edx, ecx
and edx, 0xf0f0f0f
mov eax, edx
shr eax, 8
add edx, eax
mov eax, edx
shr eax, 0x10
add eax, edx
movzx edi, al
cmp r10d, 8
ja 0x18017c557
cmp r9d, 8
ja 0x18017c557
cmp r15d, 8
ja 0x18017c557
cmp edi, 8
ja 0x18017c557
mov eax, dword [rbx + 4]
mov edx, eax
mov dword [rsp + 0x20], r12d
test eax, eax
jle 0x18017c4aa
mov eax, r11d
mov qword [rsp + 0x60], rdi
neg eax
mov dword [rsp + 0x2c], eax
mov eax, 8
mov ecx, eax
sub ecx, r10d
mov dword [rsp + 0x50], ecx
mov ecx, r14d
neg ecx
mov dword [rsp + 0x34], ecx
mov ecx, eax
sub ecx, r9d
mov dword [rsp + 0x68], ecx
mov ecx, dword [rsp + 0x28]
neg ecx
mov dword [rsp + 0x6c], ecx
mov ecx, eax
sub ecx, r15d
mov dword [rsp + 0x70], ecx
mov ecx, r8d
neg ecx
sub eax, edi
mov dword [rsp + 0x74], ecx
mov dword [rsp + 0x78], eax
mov eax, r10d
mov qword [rbp - 0x48], rax
mov eax, r15d
mov r15, qword [rsp + 0x58]
mov ecx, r9d
mov qword [rbp - 0x38], rax
mov qword [rbp - 0x40], rcx
nop dword [rax + rax]
mov eax, dword [rbx]
movsxd rcx, r12d
test r15, r15
je 0x18017c304
xor r14d, r14d
test eax, eax
jle 0x18017c44f
lea rdi, [rcx + rsi]
nop dword [rax]
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x18017c1ef
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18017c215
cmp dword [rbx + 0x30], 0
je 0x18017c213
mov rcx, rbx
call fcn.180171520
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18017c215
xor cl, cl
mov byte [rdi + 2], cl
cmp rax, qword [rbx + 0xc8]
jae 0x18017c230
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18017c256
cmp dword [rbx + 0x30], 0
je 0x18017c254
mov rcx, rbx
call fcn.180171520
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18017c256
xor cl, cl
mov byte [rdi + 1], cl
cmp rax, qword [rbx + 0xc8]
jae 0x18017c271
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18017c297
cmp dword [rbx + 0x30], 0
je 0x18017c295
mov rcx, rbx
call fcn.180171520
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18017c297
xor cl, cl
mov byte [rdi], cl
cmp r15, 2
jne 0x18017c2df
cmp rax, qword [rbx + 0xc8]
jae 0x18017c2b7
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18017c2e1
cmp dword [rbx + 0x30], 0
je 0x18017c2db
mov rcx, rbx
call fcn.180171520
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18017c2e1
xor cl, cl
jmp 0x18017c2e1
mov cl, 0xff
movzx eax, cl
add r12d, 4
or dword [rsp + 0x30], eax
inc r14d
mov byte [rdi + 3], cl
add rdi, 4
cmp r14d, dword [rbx]
jl 0x18017c1d0
jmp 0x18017c44f
test eax, eax
jle 0x18017c44a
lea r14, [rcx + rsi]
mov esi, dword [rsp + 0x38]
mov rcx, rbx
call fcn.1801717c0
cmp esi, 0x10
je 0x18017c335
mov rcx, rbx
mov edi, eax
call fcn.1801717c0
shl eax, 0x10
add eax, edi
mov rdi, qword [rsp + 0x60]
mov r11d, dword [rsp + 0x40]
mov edx, eax
and edx, dword [rsp + 0x3c]
test r11d, r11d
jns 0x18017c34d
mov ecx, dword [rsp + 0x2c]
shl edx, cl
jmp 0x18017c352
mov ecx, r11d
shr edx, cl
mov r8, qword [rbp - 0x48]
lea r9, [0x180000000]
mov ecx, dword [rsp + 0x50]
shr edx, cl
imul edx, dword [r9 + r8*4 + 0x2821f0]
mov ecx, dword [r9 + r8*4 + 0x282218]
sar edx, cl
mov ecx, dword [rsp + 0x48]
mov byte [r14], dl
mov edx, eax
and edx, dword [rsp + 0x44]
test ecx, ecx
jns 0x18017c38f
mov ecx, dword [rsp + 0x34]
shl edx, cl
jmp 0x18017c391
shr edx, cl
mov r8, qword [rbp - 0x40]
mov ecx, dword [rsp + 0x68]
shr edx, cl
imul edx, dword [r9 + r8*4 + 0x2821f0]
mov ecx, dword [r9 + r8*4 + 0x282218]
sar edx, cl
mov ecx, dword [rsp + 0x28]
mov byte [r14 + 1], dl
mov edx, eax
and edx, dword [rsp + 0x24]
test ecx, ecx
jns 0x18017c3c8
mov ecx, dword [rsp + 0x6c]
shl edx, cl
jmp 0x18017c3ca
shr edx, cl
mov r8, qword [rbp - 0x38]
mov ecx, dword [rsp + 0x70]
shr edx, cl
imul edx, dword [r9 + r8*4 + 0x2821f0]
mov ecx, dword [r9 + r8*4 + 0x282218]
sar edx, cl
mov byte [r14 + 2], dl
test r13d, r13d
je 0x18017c425
mov r8d, dword [rsp + 0x4c]
and eax, r13d
test r8d, r8d
jns 0x18017c405
mov ecx, dword [rsp + 0x74]
shl eax, cl
jmp 0x18017c40a
mov ecx, r8d
shr eax, cl
mov ecx, dword [rsp + 0x78]
shr eax, cl
imul eax, dword [r9 + rdi*4 + 0x2821f0]
mov ecx, dword [r9 + rdi*4 + 0x282218]
sar eax, cl
jmp 0x18017c42a
mov eax, 0xff
or dword [rsp + 0x30], eax
add r12d, 4
mov byte [r14 + 3], al
inc r15d
add r14, 4
cmp r15d, dword [rbx]
jl 0x18017c314
mov rsi, qword [rbp - 0x78]
mov r15, qword [rsp + 0x58]
mov edx, dword [rsp + 0x7c]
test edx, edx
je 0x18017c48e
cmp qword [rbx + 0x10], 0
je 0x18017c487
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, edx
jge 0x18017c487
mov rax, qword [rbx + 0xc8]
sub edx, ecx
mov rcx, qword [rbx + 0x28]
mov qword [rbx + 0xc0], rax
call qword [rbx + 0x18]
jmp 0x18017c48e
add qword [rbx + 0xc0], rdx
mov ecx, dword [rsp + 0x20]
mov eax, dword [rbx + 4]
inc ecx
mov rdi, qword [rsp + 0x60]
mov edx, eax
mov dword [rsp + 0x20], ecx
cmp ecx, eax
jl 0x18017c1b0
cmp dword [rsp + 0x30], 0
jne 0x18017c4cf
imul eax, dword [rbx]
lea eax, [rax*4 - 1]
movsxd rcx, eax
test eax, eax
js 0x18017c4cf
mov byte [rcx + rsi], 0xff
sub rcx, 4
jns 0x18017c4c2
mov edx, dword [rbx + 4]
cmp dword [rbp - 0x80], 0
jle 0x18017c53e
xor r10d, r10d
test edx, 0xfffffffe
jle 0x18017c53e
mov ecx, dword [rbx]
sub edx, r10d
dec edx
mov r9d, ecx
imul edx, ecx
xor r8d, r8d
imul r9d, r10d
lea eax, [rcx*4]
shl edx, 2
mov r11d, edx
add rdx, rsi
shl r9d, 2
test eax, eax
jle 0x18017c52f
sub r9, r11
nop
movzx eax, byte [rdx]
inc r8d
movzx ecx, byte [r9 + rdx]
mov byte [r9 + rdx], al
mov byte [rdx], cl
lea rdx, [rdx + 1]
mov eax, dword [rbx]
shl eax, 2
cmp r8d, eax
jl 0x18017c510
mov edx, dword [rbx + 4]
inc r10d
mov eax, edx
sar eax, 1
cmp r10d, eax
jl 0x18017c4e0
mov eax, dword [rbx]
mov rcx, qword [rbp - 0x30]
mov dword [rcx], eax
mov eax, dword [rbx + 4]
mov rcx, qword [rbp - 0x28]
mov dword [rcx], eax
mov rax, rsi
jmp 0x18017be16
mov rcx, rsi
call fcn.1802152c8
mov edx, dword [0x180677d3c]
mov rax, qword gs:[0x58]
mov ecx, 0x38
mov rax, qword [rax + rdx*8]
lea rdx, str.bad_masks
jmp 0x18017be10
mov edx, dword [0x180677d3c]
mov rax, qword gs:[0x58]
mov ecx, 0x38
mov rax, qword [rax + rdx*8]
lea rdx, str.outofmem
mov qword [rcx + rax], rdx
xor eax, eax
jmp 0x18017be1e
mov edx, dword [0x180677d3c]
mov rax, qword gs:[0x58]
mov ecx, 0x38
mov rax, qword [rax + rdx*8]
lea rdx, str.too_large
mov qword [rcx + rax], rdx
xor eax, eax
jmp 0x18017be1e
mov edx, dword [0x180677d3c]
mov rax, qword gs:[0x58]
mov ecx, 0x38
mov rax, qword [rax + rdx*8]
lea rdx, str.bad_offset
mov qword [rcx + rax], rdx
xor eax, eax
jmp 0x18017be1e
mov edx, dword [0x180677d3c]
mov rax, qword gs:[0x58]
mov ecx, 0x38
mov rax, qword [rax + rdx*8]
lea rdx, str.bad_header
mov qword [rcx + rax], rdx
xor eax, eax
jmp 0x18017be1e