Function at 0x1405db4a0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov qword [rsp + 0x20], r9
mov qword [rsp + 0x18], r8
mov qword [rsp + 0x10], rdx
push rbp
push rbx
push rsi
lea rbp, [rsp - 0x3c0]
sub rsp, 0x4c0
xor esi, esi
mov dword [rbp - 0x6c], 0xff
lea rdx, [rsp + 0x78]
mov dword [rsp + 0x20], esi
mov rbx, rcx
call fcn.1405dafc0
test rax, rax
je 0x1405db512
mov eax, dword [rbx + 4]
mov dword [rsp + 0x68], eax
cdq
xor eax, edx
sub eax, edx
mov dword [rbx + 4], eax
cmp eax, 0x1000000
jbe 0x1405db51f
mov rax, qword gs:[0x58]
mov edx, 0x1aa8
mov rcx, qword [rax]
lea rax, str.too_large
mov qword [rdx + rcx], rax
xor eax, eax
add rsp, 0x4c0
pop rsi
pop rbx
pop rbp
ret
cmp dword [rbx], 0x1000000
ja 0x1405db4f6
mov eax, dword [rbp - 0x7c]
mov qword [rsp + 0x4e0], rdi
mov edi, dword [rbp - 0x6c]
mov qword [rsp + 0x4b8], r12
mov r12d, dword [rbp - 0x80]
mov dword [rbp + 0x400], eax
mov eax, dword [rbp - 0x78]
mov qword [rsp + 0x4b0], r13
mov r13d, dword [rsp + 0x78]
mov dword [rsp + 0x2c], eax
mov eax, dword [rbp - 0x74]
mov qword [rsp + 0x4a8], r14
mov r14d, dword [rbp - 0x70]
mov dword [rsp + 0x30], eax
mov eax, dword [rbp - 0x68]
mov qword [rsp + 0x4a0], r15
mov r15d, dword [rsp + 0x7c]
mov dword [rsp + 0x38], eax
mov dword [rsp + 0x34], r14d
mov dword [rbp + 0x408], edi
mov dword [rsp + 0x24], r12d
mov dword [rsp + 0x28], r13d
cmp r12d, 0xc
jne 0x1405db5bb
cmp r13d, 0x18
jge 0x1405db5d8
mov ecx, r15d
sub ecx, eax
mov eax, 0x55555556
sub ecx, 0x18
imul ecx
mov esi, edx
shr esi, 0x1f
add esi, edx
jmp 0x1405db5cc
cmp r13d, 0x10
jge 0x1405db5d8
mov esi, r15d
sub esi, eax
sub esi, r12d
sar esi, 2
mov dword [rsp + 0x20], esi
test esi, esi
jne 0x1405db665
mov edx, dword [rbx + 0xb8]
sub edx, dword [rbx + 0xd0]
mov r8d, dword [rbx + 0xc0]
add edx, r8d
lea eax, [rdx - 1]
cmp eax, 0x3ff
ja 0x1405dc388
cmp r15d, edx
jl 0x1405dc373
mov ecx, r15d
sub ecx, edx
cmp ecx, 0x400
jg 0x1405dc373
test ecx, ecx
je 0x1405db665
jns 0x1405db62c
mov rax, qword [rbx + 0xc8]
mov qword [rbx + 0xc0], rax
jmp 0x1405db665
cmp qword [rbx + 0x10], 0
je 0x1405db65b
mov edx, dword [rbx + 0xc8]
sub edx, r8d
cmp edx, ecx
jge 0x1405db65b
mov rax, qword [rbx + 0xc8]
sub ecx, edx
mov edx, ecx
mov qword [rbx + 0xc0], rax
mov rcx, qword [rbx + 0x28]
call qword [rbx + Ordinal_26]
jmp 0x1405db665
movsxd rax, ecx
add qword [rbx + 0xc0], rax
cmp r13d, 0x18
jne 0x1405db67a
cmp r14d, 0xff000000
jne 0x1405db67a
lea eax, [r13 - 0x15]
jmp 0x1405db685
xor eax, eax
test r14d, r14d
setne al
add eax, 3
mov dword [rbx + 8], eax
mov r8d, dword [rbx]
mov ecx, dword [rbx + 4]
test r8d, r8d
js 0x1405dc35e
jne 0x1405db6a6
lea r9d, [r8*4]
mov r10d, r9d
jmp 0x1405db6cc
mov eax, 0x7fffffff
cdq
idiv r8d
cmp eax, 4
jl 0x1405dc35e
lea r9d, [r8*4]
mov r10d, r9d
test r9d, r9d
js 0x1405dc35e
test ecx, ecx
js 0x1405dc35e
je 0x1405db6e7
mov eax, 0x7fffffff
cdq
idiv ecx
cmp r10d, eax
jg 0x1405dc35e
test r8d, r8d
je 0x1405db708
xor edx, edx
mov eax, 0x7fffffff
div r8d
cmp eax, 4
jl 0x1405dc349
test r9d, r9d
js 0x1405dc349
test ecx, ecx
je 0x1405db71e
xor edx, edx
mov eax, 0x7fffffff
div ecx
cmp r9d, eax
jg 0x1405dc349
imul ecx, r8d
shl ecx, 2
movsxd rcx, ecx
call qword [0x140646a40]
mov qword [rsp + 0x70], rax
mov r14, rax
test rax, rax
je 0x1405dc349
cmp r13d, 0x10
jge 0x1405dbcdb
xor edi, edi
test esi, esi
je 0x1405dbcba
cmp esi, 0x100
jg 0x1405dbcba
movsxd rax, esi
mov qword [rsp + 0x60], rax
test esi, esi
jle 0x1405db8a5
mov rax, qword [rbx + 0xc0]
xor r12d, r12d
mov r14d, dword [rsp + 0x24]
mov r13, qword [rsp + 0x60]
mov rcx, qword [rbx + 0xc8]
cmp rax, rcx
jb 0x1405db7aa
cmp dword [rbx + 0x30], edi
je 0x1405db7cd
mov rcx, rbx
call fcn.1405d1010
mov rax, qword [rbx + 0xc0]
mov rcx, qword [rbx + 0xc8]
movzx edx, byte [rax]
lea rsi, [r12*4]
inc rax
mov byte [rbp + rsi - 0x5e], dl
mov qword [rbx + 0xc0], rax
mov r8, rsi
cmp rax, rcx
jae 0x1405db7dd
jmp 0x1405db7f8
lea rsi, [r12*4]
mov byte [rbp + rsi - 0x5e], dil
mov r8, rsi
cmp dword [rbx + 0x30], edi
je 0x1405db81d
mov rcx, rbx
call fcn.1405d1010
mov rax, qword [rbx + 0xc0]
mov rcx, qword [rbx + 0xc8]
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
mov byte [rbp + rsi - 0x5f], dl
cmp rax, rcx
jae 0x1405db822
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1405db847
mov byte [rbp + r8 - 0x5f], dil
cmp dword [rbx + 0x30], edi
je 0x1405db845
mov rcx, rbx
call fcn.1405d1010
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1405db847
xor cl, cl
mov byte [rbp + rsi - 0x60], cl
cmp r14d, 0xc
je 0x1405db881
cmp rax, qword [rbx + 0xc8]
jae 0x1405db866
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1405db881
cmp dword [rbx + 0x30], edi
je 0x1405db881
mov rcx, rbx
call fcn.1405d1010
inc qword [rbx + 0xc0]
mov rax, qword [rbx + 0xc0]
inc r12
mov byte [rbp + rsi - 0x5d], 0xff
cmp r12, r13
jl 0x1405db783
mov r14, qword [rsp + 0x70]
mov r13d, dword [rsp + 0x28]
mov esi, dword [rsp + 0x20]
mov r12d, dword [rsp + 0x24]
xor eax, eax
cmp r12d, 0xc
setne al
add eax, 3
imul eax, esi
sub r15d, eax
sub r15d, dword [rsp + 0x38]
sub r15d, r12d
je 0x1405db914
test r15d, r15d
jns 0x1405db8d6
mov rax, qword [rbx + 0xc8]
mov qword [rbx + 0xc0], rax
jmp 0x1405db914
cmp qword [rbx + 0x10], rdi
je 0x1405db90a
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, r15d
jge 0x1405db90a
mov rax, qword [rbx + 0xc8]
sub r15d, ecx
mov rcx, qword [rbx + 0x28]
mov edx, r15d
mov qword [rbx + 0xc0], rax
call qword [rbx + Ordinal_26]
jmp 0x1405db914
movsxd rax, r15d
add qword [rbx + 0xc0], rax
cmp r13d, 1
jne 0x1405db927
mov r12d, dword [rbx]
add r12d, 7
shr r12d, 3
jmp 0x1405db945
cmp r13d, 4
jne 0x1405db938
mov r12d, dword [rbx]
inc r12d
shr r12d, 1
jmp 0x1405db945
cmp r13d, 8
jne 0x1405dbc99
mov r12d, dword [rbx]
mov eax, dword [rbx + 4]
neg r12d
and r12d, 3
mov ecx, eax
cmp r13d, 1
jne 0x1405dbade
xor r13d, r13d
test eax, eax
jle 0x1405dc262
nop word [rax + rax]
mov rax, qword [rbx + 0xc0]
mov esi, 7
cmp rax, qword [rbx + 0xc8]
jae 0x1405db994
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1405db9ba
cmp dword [rbx + 0x30], 0
je 0x1405db9b8
mov rcx, rbx
call fcn.1405d1010
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1405db9ba
xor cl, cl
mov edx, dword [rbx]
xor r15d, r15d
movzx r9d, cl
test edx, edx
jle 0x1405dba85
mov r8d, edx
nop
mov eax, r9d
mov ecx, esi
sar eax, cl
and eax, 1
lea rcx, [rax*4]
movzx eax, byte [rbp + rcx - 0x60]
mov byte [rdi + r14], al
movzx eax, byte [rbp + rcx - 0x5f]
mov byte [rdi + r14 + 1], al
movzx eax, byte [rbp + rcx - 0x5e]
mov byte [rdi + r14 + 2], al
mov byte [rdi + r14 + 3], 0xff
add rdi, 4
inc r15d
cmp r15d, edx
je 0x1405dba85
sub esi, 1
jns 0x1405dba76
mov rax, qword [rbx + 0xc0]
mov esi, 7
cmp rax, qword [rbx + 0xc8]
jae 0x1405dba41
movzx ecx, byte [rax]
mov edx, r8d
inc rax
movzx r9d, cl
mov qword [rbx + 0xc0], rax
jmp 0x1405dba79
cmp dword [rbx + 0x30], 0
je 0x1405dba6b
mov rcx, rbx
call fcn.1405d1010
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
mov edx, dword [rbx]
movzx r9d, cl
jmp 0x1405dba79
xor cl, cl
mov edx, r8d
movzx r9d, cl
jmp 0x1405dba79
mov edx, r8d
mov r8d, edx
cmp r15d, edx
jl 0x1405db9d0
test r12d, r12d
je 0x1405dbac8
cmp qword [rbx + 0x10], 0
je 0x1405dbabe
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, r12d
jge 0x1405dbabe
mov rax, qword [rbx + 0xc8]
mov edx, r12d
sub edx, ecx
mov qword [rbx + 0xc0], rax
mov rcx, qword [rbx + 0x28]
call qword [rbx + Ordinal_26]
jmp 0x1405dbac8
mov eax, r12d
add qword [rbx + 0xc0], rax
mov eax, dword [rbx + 4]
inc r13d
mov ecx, eax
cmp r13d, eax
jl 0x1405db970
jmp 0x1405dc262
xor r15d, r15d
test eax, eax
jle 0x1405dc262
nop dword [rax]
mov r8d, dword [rbx]
xor esi, esi
test r8d, r8d
jle 0x1405dbc40
nop
mov r9, qword [rbx + 0xc0]
cmp r9, qword [rbx + 0xc8]
jae 0x1405dbb20
movzx ecx, byte [r9]
inc r9
mov qword [rbx + 0xc0], r9
jmp 0x1405dbb4a
cmp dword [rbx + 0x30], 0
je 0x1405dbb48
mov rcx, rbx
call fcn.1405d1010
mov rax, qword [rbx + 0xc0]
mov r8d, dword [rbx]
movzx ecx, byte [rax]
lea r9, [rax + 1]
mov qword [rbx + 0xc0], r9
jmp 0x1405dbb4a
xor cl, cl
xor r10d, r10d
movzx eax, cl
cmp r13d, 4
jne 0x1405dbb60
mov r10d, eax
and r10d, 0xf
shr eax, 4
movsxd rcx, edi
lea rdx, [rax*4]
movzx eax, byte [rbp + rdx - 0x60]
inc edi
mov byte [rcx + r14], al
movzx eax, byte [rbp + rdx - 0x5f]
movsxd rcx, edi
inc edi
mov byte [rcx + r14], al
movzx eax, byte [rbp + rdx - 0x5e]
movsxd rcx, edi
inc edi
mov byte [rcx + r14], al
movsxd rax, edi
inc edi
mov byte [rax + r14], 0xff
lea eax, [rsi + 1]
cmp eax, r8d
je 0x1405dbc40
cmp r13d, 8
jne 0x1405dbbf5
cmp r9, qword [rbx + 0xc8]
jae 0x1405dbbc8
movzx ecx, byte [r9]
lea rax, [r9 + 1]
mov qword [rbx + 0xc0], rax
jmp 0x1405dbbf1
cmp dword [rbx + 0x30], 0
je 0x1405dbbef
mov rcx, rbx
call fcn.1405d1010
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
mov r8d, dword [rbx]
jmp 0x1405dbbf1
xor cl, cl
movzx r10d, cl
movsxd rcx, edi
lea rdx, [r10*4]
movzx eax, byte [rbp + rdx - 0x60]
inc edi
add esi, 2
mov r9d, r8d
mov byte [rcx + r14], al
movzx eax, byte [rbp + rdx - 0x5f]
movsxd rcx, edi
inc edi
mov byte [rcx + r14], al
movzx eax, byte [rbp + rdx - 0x5e]
movsxd rcx, edi
inc edi
mov byte [rcx + r14], al
movsxd rax, edi
inc edi
mov byte [rax + r14], 0xff
cmp esi, r8d
jl 0x1405dbb00
test r12d, r12d
je 0x1405dbc83
cmp qword [rbx + 0x10], 0
je 0x1405dbc79
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, r12d
jge 0x1405dbc79
mov rax, qword [rbx + 0xc8]
mov edx, r12d
sub edx, ecx
mov qword [rbx + 0xc0], rax
mov rcx, qword [rbx + 0x28]
call qword [rbx + Ordinal_26]
jmp 0x1405dbc83
mov eax, r12d
add qword [rbx + 0xc0], rax
mov eax, dword [rbx + 4]
inc r15d
mov ecx, eax
cmp r15d, eax
jl 0x1405dbaf0
jmp 0x1405dc262
mov rcx, r14
call qword [0x140646a20]
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.bad_bpp
jmp 0x1405dc39b
mov rcx, r14
call qword [0x140646a20]
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.invalid
jmp 0x1405dc39b
sub r15d, dword [rsp + 0x38]
xor eax, eax
mov dword [rsp + 0x44], eax
mov r13d, eax
mov dword [rsp + 0x4c], eax
mov dword [rsp + 0x54], eax
mov dword [rsp + 0x60], eax
mov dword [rsp + 0x40], eax
mov dword [rsp + 0x48], eax
mov dword [rsp + 0x50], eax
mov dword [rsp + 0x58], eax
sub r15d, r12d
je 0x1405dbd5f
test r15d, r15d
jns 0x1405dbd1f
mov rax, qword [rbx + 0xc8]
mov qword [rbx + 0xc0], rax
jmp 0x1405dbd5d
cmp qword [rbx + 0x10], rax
je 0x1405dbd53
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, r15d
jge 0x1405dbd53
mov rax, qword [rbx + 0xc8]
sub r15d, ecx
mov rcx, qword [rbx + 0x28]
mov edx, r15d
mov qword [rbx + 0xc0], rax
call qword [rbx + Ordinal_26]
jmp 0x1405dbd5d
movsxd rax, r15d
add qword [rbx + 0xc0], rax
xor eax, eax
mov ecx, dword [rsp + 0x28]
cmp ecx, 0x18
jne 0x1405dbd6f
mov eax, dword [rbx]
lea edx, [rax + rax*2]
jmp 0x1405dbd7c
cmp ecx, 0x10
jne 0x1405dbd7a
mov edx, dword [rbx]
add edx, edx
jmp 0x1405dbd7c
mov edx, eax
neg edx
and edx, 3
mov dword [rsp + 0x24], edx
cmp ecx, 0x18
jne 0x1405dbd9a
mov r12d, 1
mov qword [rsp + 0x38], r12
jmp 0x1405dbfaa
mov r11d, dword [rsp + 0x30]
cmp ecx, 0x20
mov ecx, dword [rbp + 0x400]
mov r10d, dword [rsp + 0x2c]
jne 0x1405dbde7
cmp r11d, 0xff
jne 0x1405dbde7
cmp r10d, 0xff00
jne 0x1405dbde7
cmp ecx, 0xff0000
jne 0x1405dbde7
mov r9d, dword [rsp + 0x34]
cmp r9d, 0xff000000
jne 0x1405dbe06
mov r12d, 2
mov qword [rsp + 0x38], r12
jmp 0x1405dbfaa
test ecx, ecx
je 0x1405dc32b
test r10d, r10d
je 0x1405dc32b
test r11d, r11d
je 0x1405dc32b
mov r9d, dword [rsp + 0x34]
call fcn.1405dae50
mov edx, dword [rbp + 0x400]
sub eax, 7
mov ecx, dword [rbp + 0x400]
shr edx, 1
and ecx, 0x55555555
and edx, 0x55555555
mov dword [rsp + 0x44], eax
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, r10d
and edx, 0xf0f0f0f
mov eax, edx
shr eax, 8
add edx, eax
mov eax, edx
shr eax, 0x10
add eax, edx
movzx r15d, al
mov dword [rsp + 0x40], r15d
call fcn.1405dae50
sub eax, 7
mov edx, r10d
shr edx, 1
mov ecx, r10d
and edx, 0x55555555
mov dword [rsp + 0x4c], 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, r11d
and edx, 0xf0f0f0f
mov eax, edx
shr eax, 8
add edx, eax
mov eax, edx
shr eax, 0x10
add eax, edx
movzx esi, al
mov dword [rsp + 0x48], esi
call fcn.1405dae50
sub eax, 7
mov edx, r11d
shr edx, 1
mov ecx, r11d
and edx, 0x55555555
mov dword [rsp + 0x54], 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, r9d
and edx, 0xf0f0f0f
mov eax, edx
shr eax, 8
add edx, eax
mov eax, edx
shr eax, 0x10
add eax, edx
movzx r11d, al
mov dword [rsp + 0x50], r11d
call fcn.1405dae50
sub eax, 7
mov edx, r9d
shr edx, 1
mov ecx, r9d
and edx, 0x55555555
mov dword [rsp + 0x60], 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
and edx, 0xf0f0f0f
mov eax, edx
shr eax, 8
add edx, eax
mov eax, edx
shr eax, 0x10
add eax, edx
movzx r8d, al
mov dword [rsp + 0x58], r8d
cmp r15d, 8
ja 0x1405dc32b
cmp esi, 8
ja 0x1405dc32b
cmp r11d, 8
ja 0x1405dc32b
xor r12d, r12d
mov qword [rsp + 0x38], r12
cmp r8d, 8
ja 0x1405dc32b
mov edx, dword [rsp + 0x24]
mov eax, dword [rbx + 4]
xor esi, esi
mov dword [rsp + 0x20], esi
mov ecx, eax
test eax, eax
jle 0x1405dc262
nop dword [rax]
mov eax, dword [rbx]
movsxd rcx, r13d
test r12, r12
je 0x1405dc162
xor esi, esi
test eax, eax
jle 0x1405dc117
mov r15d, dword [rbp + 0x408]
lea rdi, [rcx + r14]
nop dword [rax]
nop word [rax + rax]
mov rcx, qword [rbx + 0xc8]
mov rax, qword [rbx + 0xc0]
cmp rax, rcx
jb 0x1405dc01f
cmp dword [rbx + 0x30], 0
je 0x1405dc036
mov rcx, rbx
call fcn.1405d1010
mov rax, qword [rbx + 0xc0]
mov rcx, qword [rbx + 0xc8]
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
mov byte [rdi + 2], dl
cmp rax, rcx
jae 0x1405dc03a
jmp 0x1405dc056
mov byte [rdi + 2], 0
cmp dword [rbx + 0x30], 0
je 0x1405dc07a
mov rcx, rbx
call fcn.1405d1010
mov rax, qword [rbx + 0xc0]
mov rcx, qword [rbx + 0xc8]
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
mov byte [rdi + 1], dl
cmp rax, rcx
jae 0x1405dc07e
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1405dc0a4
mov byte [rdi + 1], 0
cmp dword [rbx + 0x30], 0
je 0x1405dc0a2
mov rcx, rbx
call fcn.1405d1010
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1405dc0a4
xor cl, cl
mov byte [rdi], cl
cmp r12, 2
jne 0x1405dc0ec
cmp rax, qword [rbx + 0xc8]
jae 0x1405dc0c4
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1405dc0ee
cmp dword [rbx + 0x30], 0
je 0x1405dc0e8
mov rcx, rbx
call fcn.1405d1010
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1405dc0ee
xor cl, cl
jmp 0x1405dc0ee
mov cl, 0xff
movzx eax, cl
add r13d, 4
mov byte [rdi + 3], cl
or r15d, eax
add rdi, 4
inc esi
cmp esi, dword [rbx]
jl 0x1405dbff0
mov edx, dword [rsp + 0x24]
mov edi, r15d
mov dword [rbp + 0x408], r15d
mov esi, dword [rsp + 0x20]
test edx, edx
je 0x1405dc24f
cmp qword [rbx + 0x10], 0
je 0x1405dc246
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, edx
jge 0x1405dc246
mov rax, qword [rbx + 0xc8]
sub edx, ecx
mov rcx, qword [rbx + 0x28]
mov qword [rbx + 0xc0], rax
call qword [rbx + Ordinal_26]
mov edx, dword [rsp + 0x24]
jmp 0x1405dc24f
test eax, eax
jle 0x1405dc23c
lea r15, [rcx + r14]
mov r14d, dword [rsp + 0x28]
mov rcx, rbx
call fcn.1405d1220
cmp r14d, 0x10
jne 0x1405dc185
mov esi, eax
jmp 0x1405dc19c
mov rcx, rbx
mov edi, eax
call fcn.1405d1220
mov esi, eax
shl esi, 0x10
add esi, edi
mov edi, dword [rbp + 0x408]
mov r8d, dword [rsp + 0x40]
mov ecx, esi
and ecx, dword [rbp + 0x400]
mov edx, dword [rsp + 0x44]
call fcn.1405daec0
mov r8d, dword [rsp + 0x48]
mov ecx, esi
and ecx, dword [rsp + 0x2c]
mov edx, dword [rsp + 0x4c]
mov byte [r15], al
call fcn.1405daec0
mov r8d, dword [rsp + 0x50]
mov ecx, esi
and ecx, dword [rsp + 0x30]
mov edx, dword [rsp + 0x54]
mov byte [r15 + 1], al
call fcn.1405daec0
mov r9d, dword [rsp + 0x34]
mov byte [r15 + 2], al
test r9d, r9d
je 0x1405dc204
mov r8d, dword [rsp + 0x58]
and esi, r9d
mov edx, dword [rsp + 0x60]
mov ecx, esi
call fcn.1405daec0
jmp 0x1405dc209
mov eax, 0xff
or edi, eax
mov byte [r15 + 3], al
add r15, 4
mov dword [rbp + 0x408], edi
add r13d, 4
inc r12d
cmp r12d, dword [rbx]
jl 0x1405dc173
mov r14, qword [rsp + 0x70]
mov edx, dword [rsp + 0x24]
mov r12, qword [rsp + 0x38]
jmp 0x1405dc117
mov r12, qword [rsp + 0x38]
jmp 0x1405dc11b
mov eax, edx
add qword [rbx + 0xc0], rax
mov eax, dword [rbx + 4]
inc esi
mov dword [rsp + 0x20], esi
mov ecx, eax
cmp esi, eax
jl 0x1405dbfc0
cmp dword [rbp + 0x408], 0
jne 0x1405dc28e
imul eax, dword [rbx]
lea eax, [rax*4 - 1]
movsxd rdx, eax
test eax, eax
js 0x1405dc28e
nop dword [rax]
mov byte [rdx + r14], 0xff
sub rdx, 4
jns 0x1405dc280
mov ecx, dword [rbx + 4]
cmp dword [rsp + 0x68], 0
jle 0x1405dc301
xor r10d, r10d
mov edx, ecx
test ecx, 0xfffffffe
jle 0x1405dc301
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, r14
shl r9d, 2
test eax, eax
jle 0x1405dc2f0
sub r9, r11
movzx eax, byte [rdx]
inc r8d
movzx ecx, byte [rdx + r9]
mov byte [rdx + r9], al
mov byte [rdx], cl
lea rdx, [rdx + 1]
mov eax, dword [rbx]
shl eax, 2
cmp r8d, eax
jl 0x1405dc2d1
mov ecx, dword [rbx + 4]
inc r10d
mov eax, ecx
mov edx, ecx
sar eax, 1
cmp r10d, eax
jl 0x1405dc2a2
mov eax, dword [rbx]
mov rdx, qword [rbp + 0x3e8]
mov dword [rdx], eax
mov rax, qword [rbp + 0x3f0]
mov dword [rax], ecx
mov rcx, qword [rbp + 0x3f8]
test rcx, rcx
je 0x1405dc326
mov eax, dword [rbx + 8]
mov dword [rcx], eax
mov rax, r14
jmp 0x1405dc3a6
mov rcx, r14
call qword [0x140646a20]
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.bad_masks
jmp 0x1405dc39b
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.outofmem
jmp 0x1405dc39b
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.too_large
jmp 0x1405dc39b
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.bad_offset
jmp 0x1405dc39b
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.bad_header
mov edx, 0x1aa8
mov qword [rdx + rcx], rax
xor eax, eax
mov r14, qword [rsp + 0x4a8]
mov r13, qword [rsp + 0x4b0]
mov r12, qword [rsp + 0x4b8]
mov rdi, qword [rsp + 0x4e0]
mov r15, qword [rsp + 0x4a0]
add rsp, 0x4c0
pop rsi
pop rbx
pop rbp
ret