Function at 0x1800827a0
Capabilities:
Encrypt data using rc4 ksa
Resolve function by parsing pe exports

Disassembly:
push rbx
push r12
push r15
sub rsp, 0x520
mov rax, qword [0x180211600]
xor rax, rsp
mov qword [rsp + 0x4f0], rax
mov qword [rsp + 0xd8], rdx
xor r15d, r15d
lea rdx, [rsp + 0x98]
mov qword [rsp + 0xe0], r8
mov r12d, r15d
mov dword [rsp + 0xb4], 0xff
mov rbx, rcx
call fcn.180082280
test rax, rax
je 0x180082839
mov eax, dword [rbx + 4]
mov r9d, eax
neg r9d
mov dword [rsp + 0x88], eax
cmovs r9d, eax
mov dword [rbx + 4], r9d
cmp r9d, 0x1000000
jbe 0x180082840
mov edx, dword [0x18023784c]
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 0x18008382b
mov r8d, dword [rbx]
cmp r8d, 0x1000000
ja 0x180082816
mov eax, dword [rsp + 0xa4]
mov r10d, dword [rsp + 0xb0]
mov qword [rsp + 0x558], rbp
mov ebp, dword [rsp + 0xa0]
mov qword [rsp + 0x518], rsi
mov esi, dword [rsp + 0xb8]
mov qword [rsp + 0x510], rdi
mov edi, dword [rsp + 0x98]
mov qword [rsp + 0x508], r13
mov r13d, dword [rsp + 0xb4]
mov dword [rsp + 0x3c], eax
mov eax, dword [rsp + 0xa8]
mov qword [rsp + 0x500], r14
movsxd r14, dword [rsp + 0x9c]
mov dword [rsp + 0x24], eax
mov eax, dword [rsp + 0xac]
mov dword [rsp + 0x30], r14d
mov dword [rsp + 0x44], eax
mov dword [rsp + 0x50], r10d
mov dword [rsp + 0x34], r13d
mov dword [rsp + 0x28], esi
mov dword [rsp + 0x2c], ebp
mov dword [rsp + 0x38], edi
cmp ebp, 0xc
jne 0x180082902
cmp edi, 0x18
jge 0x180082919
mov ecx, r14d
mov eax, 0x55555556
sub ecx, esi
sub ecx, 0x18
imul ecx
mov r12d, edx
shr r12d, 0x1f
add r12d, edx
jmp 0x180082914
cmp edi, 0x10
jge 0x180082919
mov r12d, r14d
sub r12d, esi
sub r12d, ebp
sar r12d, 2
test r12d, r12d
jne 0x180082952
movsxd rcx, dword [rbx + 0xb8]
sub rcx, qword [rbx + 0xd0]
add rcx, qword [rbx + 0xc0]
cmp r14, rcx
je 0x180082952
mov edx, dword [0x18023784c]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, str.bad_offset
jmp 0x1800837f8
cmp edi, 0x18
jne 0x180082967
cmp r10d, 0xff000000
jne 0x180082967
mov eax, 3
jmp 0x180082973
test r10d, r10d
mov eax, r15d
setne al
add eax, 3
mov dword [rbx + 8], eax
test r8d, r8d
js 0x1800837de
jne 0x18008298b
lea ecx, [r8*4]
jmp 0x1800829ad
mov eax, 0x7fffffff
cdq
idiv r8d
cmp eax, 4
jl 0x1800837de
lea ecx, [r8*4]
test ecx, ecx
js 0x1800837de
test r9d, r9d
js 0x1800837de
je 0x1800829c9
mov eax, 0x7fffffff
cdq
idiv r9d
cmp ecx, eax
jg 0x1800837de
test r8d, r8d
je 0x1800829e0
mov eax, 0x7fffffff
cdq
idiv r8d
cmp eax, 4
jl 0x1800837c2
lea ecx, [r8*4]
test r9d, r9d
je 0x1800829fe
mov eax, 0x7fffffff
cdq
idiv r9d
cmp ecx, eax
jg 0x1800837c2
imul r8d, r9d
lea eax, [r8*4]
movsxd rcx, eax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rsp + 0x90], rax
mov rdx, rax
test rax, rax
je 0x1800837c2
cmp edi, 0x10
jge 0x180082fcb
mov edi, r15d
test r12d, r12d
je 0x180082fa3
cmp r12d, 0x100
jg 0x180082fa3
mov rsi, rax
test r12d, r12d
jle 0x180082bac
mov r13d, dword [rsp + 0x2c]
lea rbp, [rbx + 0x30]
movsxd r14, r12d
nop dword [rax]
nop word [rax + rax]
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x180082a8f
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x180082ab8
cmp dword [rbx + 0x30], edi
lea rbp, [rbx + 0x30]
je 0x180082ab6
mov rcx, rbx
call fcn.1800787f0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x180082ab8
xor cl, cl
mov qword [rsp + 0x58], rbp
mov byte [rsp + r15*4 + 0xf2], cl
cmp rax, qword [rbx + 0xc8]
jae 0x180082add
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x180082b02
cmp dword [rbp], edi
je 0x180082b00
mov rcx, rbx
call fcn.1800787f0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x180082b02
xor cl, cl
mov byte [rsp + r15*4 + 0xf1], cl
cmp rax, qword [rbx + 0xc8]
jae 0x180082b26
movzx ecx, byte [rax]
lea rbp, [rbx + 0x30]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x180082b4b
cmp dword [rbp], edi
je 0x180082b49
mov rcx, rbx
call fcn.1800787f0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x180082b4b
xor cl, cl
mov byte [rsp + r15*4 + 0xf0], cl
cmp r13d, 0xc
je 0x180082b86
cmp rax, qword [rbx + 0xc8]
jae 0x180082b6e
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x180082b86
mov rax, qword [rsp + 0x58]
cmp dword [rax], edi
je 0x180082b86
mov rcx, rbx
call fcn.1800787f0
inc qword [rbx + 0xc0]
mov byte [rsp + r15*4 + 0xf3], 0xff
inc r15
cmp r15, r14
jl 0x180082a70
mov r14d, dword [rsp + 0x30]
xor r15d, r15d
mov r13d, dword [rsp + 0x34]
mov ebp, dword [rsp + 0x2c]
cmp ebp, 0xc
mov eax, r15d
setne al
add eax, 3
imul eax, r12d
sub r14d, eax
sub r14d, dword [rsp + 0x28]
sub r14d, ebp
je 0x180082c1c
test r14d, r14d
jns 0x180082bde
mov rax, qword [rbx + 0xc8]
mov qword [rbx + 0xc0], rax
jmp 0x180082c1c
cmp qword [rbx + 0x10], rdi
je 0x180082c12
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, r14d
jge 0x180082c12
mov rax, qword [rbx + 0xc8]
sub r14d, ecx
mov rcx, qword [rbx + 0x28]
mov edx, r14d
mov qword [rbx + 0xc0], rax
call qword [rbx + 0x18]
jmp 0x180082c1c
movsxd rax, r14d
add qword [rbx + 0xc0], rax
mov r12d, dword [rsp + 0x38]
cmp r12d, 1
jne 0x180082c34
mov r15d, dword [rbx]
add r15d, 7
shr r15d, 3
jmp 0x180082c52
cmp r12d, 4
jne 0x180082c45
mov r15d, dword [rbx]
inc r15d
shr r15d, 1
jmp 0x180082c52
cmp r12d, 8
jne 0x180082f7b
mov r15d, dword [rbx]
mov eax, dword [rbx + 4]
neg r15d
and r15d, 3
mov edx, eax
cmp r12d, 1
jne 0x180082dca
xor r12d, r12d
test eax, eax
jle 0x1800836d9
mov rax, qword [rbx + 0xc0]
mov r14d, 7
cmp rax, qword [rbx + 0xc8]
jae 0x180082c98
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x180082cbe
cmp dword [rbx + 0x30], 0
je 0x180082cbc
mov rcx, rbx
call fcn.1800787f0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x180082cbe
xor cl, cl
xor ebp, ebp
movzx edx, cl
cmp dword [rbx], ebp
jle 0x180082d71
nop dword [rax + rax]
sarx eax, edx, r14d
and eax, 1
lea rcx, [rax*4]
movzx eax, byte [rsp + rcx + 0xf0]
mov byte [rdi + rsi], al
movzx eax, byte [rsp + rcx + 0xf1]
mov byte [rdi + rsi + 1], al
movzx eax, byte [rsp + rcx + 0xf2]
mov byte [rdi + rsi + 2], al
lea eax, [rbp + 1]
mov byte [rdi + rsi + 3], 0xff
add rdi, 4
cmp eax, dword [rbx]
je 0x180082d71
sub r14d, 1
jns 0x180082d67
mov rax, qword [rbx + 0xc0]
mov r14d, 7
cmp rax, qword [rbx + 0xc8]
jae 0x180082d3e
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x180082d64
cmp dword [rbx + 0x30], 0
je 0x180082d62
mov rcx, rbx
call fcn.1800787f0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x180082d64
xor cl, cl
movzx edx, cl
inc ebp
cmp ebp, dword [rbx]
jl 0x180082cd0
test r15d, r15d
je 0x180082db4
cmp qword [rbx + 0x10], 0
je 0x180082daa
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, r15d
jge 0x180082daa
mov rax, qword [rbx + 0xc8]
mov edx, r15d
sub edx, ecx
mov qword [rbx + 0xc0], rax
mov rcx, qword [rbx + 0x28]
call qword [rbx + 0x18]
jmp 0x180082db4
mov eax, r15d
add qword [rbx + 0xc0], rax
mov eax, dword [rbx + 4]
inc r12d
mov edx, eax
cmp r12d, eax
jl 0x180082c73
jmp 0x1800836d9
xor r14d, r14d
test eax, eax
jle 0x1800836d9
xor ebp, ebp
cmp dword [rbx], ebp
jle 0x180082f22
nop
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x180082dff
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x180082e25
cmp dword [rbx + 0x30], 0
je 0x180082e23
mov rcx, rbx
call fcn.1800787f0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x180082e25
xor cl, cl
xor r8d, r8d
movzx eax, cl
cmp r12d, 4
jne 0x180082e3b
mov r8d, eax
and r8d, 0xf
shr eax, 4
movsxd rcx, edi
lea rdx, [rax*4]
movzx eax, byte [rsp + rdx + 0xf0]
inc edi
mov byte [rcx + rsi], al
movzx eax, byte [rsp + rdx + 0xf1]
movsxd rcx, edi
inc edi
mov byte [rcx + rsi], al
movzx eax, byte [rsp + rdx + 0xf2]
movsxd rcx, edi
inc edi
mov byte [rcx + rsi], al
movsxd rax, edi
inc edi
mov byte [rax + rsi], 0xff
lea eax, [rbp + 1]
cmp eax, dword [rbx]
je 0x180082f22
cmp r12d, 8
jne 0x180082ed6
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x180082eac
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x180082ed2
cmp dword [rbx + 0x30], 0
je 0x180082ed0
mov rcx, rbx
call fcn.1800787f0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x180082ed2
xor cl, cl
movzx r8d, cl
movsxd rcx, edi
lea rdx, [r8*4]
movzx eax, byte [rsp + rdx + 0xf0]
inc edi
add ebp, 2
mov byte [rcx + rsi], al
movzx eax, byte [rsp + rdx + 0xf1]
movsxd rcx, edi
inc edi
mov byte [rcx + rsi], al
movzx eax, byte [rsp + rdx + 0xf2]
movsxd rcx, edi
inc edi
mov byte [rcx + rsi], al
movsxd rax, edi
inc edi
mov byte [rax + rsi], 0xff
cmp ebp, dword [rbx]
jl 0x180082de0
test r15d, r15d
je 0x180082f65
cmp qword [rbx + 0x10], 0
je 0x180082f5b
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, r15d
jge 0x180082f5b
mov rax, qword [rbx + 0xc8]
mov edx, r15d
sub edx, ecx
mov qword [rbx + 0xc0], rax
mov rcx, qword [rbx + 0x28]
call qword [rbx + 0x18]
jmp 0x180082f65
mov eax, r15d
add qword [rbx + 0xc0], rax
mov eax, dword [rbx + 4]
inc r14d
mov edx, eax
cmp r14d, eax
jl 0x180082dd5
jmp 0x1800836d9
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov edx, dword [0x18023784c]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, str.bad_bpp
jmp 0x1800837f8
mov rcx, rdx
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov edx, dword [0x18023784c]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, str.invalid
jmp 0x1800837f8
sub r14d, esi
mov dword [rsp + 0x40], r15d
mov dword [rsp + 0x28], r15d
mov r8d, r15d
mov dword [rsp + 0x34], r15d
mov r10d, r15d
mov dword [rsp + 0x2c], r15d
mov r9d, r15d
mov edi, r15d
mov r12d, r15d
sub r14d, ebp
je 0x18008305a
test r14d, r14d
jns 0x18008300b
mov rax, qword [rbx + 0xc8]
mov qword [rbx + 0xc0], rax
jmp 0x18008305a
cmp qword [rbx + 0x10], r8
je 0x180083050
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, r14d
jge 0x180083050
mov rax, qword [rbx + 0xc8]
sub r14d, ecx
mov rcx, qword [rbx + 0x28]
mov edx, r14d
mov qword [rbx + 0xc0], rax
call qword [rbx + 0x18]
mov rdx, qword [rsp + 0x90]
mov r9d, r12d
mov r10d, r12d
mov r8d, r12d
jmp 0x18008305a
movsxd rax, r14d
add qword [rbx + 0xc0], rax
mov ecx, dword [rsp + 0x38]
cmp ecx, 0x18
jne 0x18008306b
mov eax, dword [rbx]
lea r11d, [rax + rax*2]
jmp 0x18008307b
cmp ecx, 0x10
jne 0x180083078
mov r11d, dword [rbx]
add r11d, r11d
jmp 0x18008307b
xor r11d, r11d
neg r11d
mov rsi, rdx
and r11d, 3
mov dword [rsp + 0x20], r11d
cmp ecx, 0x18
jne 0x1800830a8
mov qword [rsp + 0x48], 1
mov ebp, r12d
mov qword [rsp + 0x60], rdx
mov r14d, r12d
jmp 0x1800832e4
xor eax, eax
mov qword [rsp + 0x48], rax
cmp ecx, 0x20
jne 0x180083114
cmp dword [rsp + 0x44], 0xff
mov qword [rsp + 0x48], rax
jne 0x180083114
mov qword [rsp + 0x48], rax
mov eax, dword [rsp + 0x24]
cmp eax, 0xff00
jne 0x180083118
xor eax, eax
cmp dword [rsp + 0x3c], 0xff0000
mov qword [rsp + 0x48], rax
jne 0x180083114
mov r11d, dword [rsp + 0x50]
mov qword [rsp + 0x48], rax
mov qword [rsp + 0x60], rsi
cmp r11d, 0xff000000
jne 0x18008314e
mov qword [rsp + 0x48], 2
mov ebp, eax
mov qword [rsp + 0x60], rdx
mov r14d, eax
jmp 0x1800832df
mov eax, dword [rsp + 0x24]
mov r9d, dword [rsp + 0x3c]
test r9d, r9d
je 0x18008379d
test eax, eax
je 0x18008379d
mov edi, dword [rsp + 0x44]
mov qword [rsp + 0x60], rsi
mov qword [rsp + 0x90], rdx
test edi, edi
je 0x18008379d
mov r11d, dword [rsp + 0x50]
jmp 0x180083157
mov r9d, dword [rsp + 0x3c]
mov edi, dword [rsp + 0x44]
mov ecx, r9d
call fcn.1800821a0
mov edx, r9d
mov ecx, r9d
mov r9d, dword [rsp + 0x24]
and ecx, 0x55555555
shr edx, 1
and edx, 0x55555555
lea ebp, [rax - 7]
add edx, ecx
mov dword [rsp + 0x40], ebp
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 r10d, al
call fcn.1800821a0
mov edx, r9d
mov ecx, r9d
shr edx, 1
and ecx, 0x55555555
and edx, 0x55555555
add edx, ecx
lea r14d, [rax - 7]
mov ecx, edx
mov dword [rsp + 0x28], 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.1800821a0
sub eax, 7
mov edx, edi
shr edx, 1
mov ecx, edi
and edx, 0x55555555
mov dword [rsp + 0x34], 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 r12d, al
call fcn.1800821a0
lea r8d, [rax - 7]
mov edx, r11d
shr edx, 1
mov ecx, r11d
and edx, 0x55555555
mov dword [rsp + 0x2c], 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 0x18008379d
cmp r9d, 8
ja 0x18008379d
cmp r12d, 8
ja 0x18008379d
cmp edi, 8
ja 0x18008379d
mov r11d, dword [rsp + 0x20]
mov eax, dword [rbx + 4]
mov edx, eax
mov dword [rsp + 0x30], r15d
test eax, eax
jle 0x1800836d9
neg r14d
mov qword [rsp + 0x58], rdi
mov eax, ebp
mov dword [rsp + 0x74], r14d
mov r14, qword [rsp + 0x48]
neg eax
mov dword [rsp + 0x6c], eax
mov eax, 8
mov ecx, eax
sub ecx, r10d
mov dword [rsp + 0x70], ecx
mov ecx, eax
sub ecx, r9d
mov dword [rsp + 0x78], ecx
mov ecx, dword [rsp + 0x34]
neg ecx
mov dword [rsp + 0x7c], ecx
mov ecx, eax
sub ecx, r12d
mov dword [rsp + 0x80], ecx
mov ecx, r8d
neg ecx
sub eax, edi
mov dword [rsp + 0x84], ecx
mov dword [rsp + 0x68], eax
mov eax, r10d
mov qword [rsp + 0xc0], rax
mov eax, r12d
mov r12d, dword [rsp + 0x68]
mov ecx, r9d
mov qword [rsp + 0xd0], rax
mov qword [rsp + 0xc8], rcx
nop word [rax + rax]
mov eax, dword [rbx]
xor ebp, ebp
movsxd rcx, r15d
test r14, r14
je 0x1800834e6
test eax, eax
jle 0x180083675
lea rdi, [rcx + rsi]
nop dword [rax]
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x1800833bf
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1800833e5
cmp dword [rbx + 0x30], 0
je 0x1800833e3
mov rcx, rbx
call fcn.1800787f0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1800833e5
xor cl, cl
mov byte [rdi + 2], cl
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x180083407
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18008342d
cmp dword [rbx + 0x30], 0
je 0x18008342b
mov rcx, rbx
call fcn.1800787f0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x18008342d
xor cl, cl
mov byte [rdi + 1], cl
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x18008344f
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x180083475
cmp dword [rbx + 0x30], 0
je 0x180083473
mov rcx, rbx
call fcn.1800787f0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x180083475
xor cl, cl
mov byte [rdi], cl
cmp r14, 2
jne 0x1800834c4
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x18008349c
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1800834c6
cmp dword [rbx + 0x30], 0
je 0x1800834c0
mov rcx, rbx
call fcn.1800787f0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1800834c6
xor cl, cl
jmp 0x1800834c6
mov cl, 0xff
mov byte [rdi + 3], cl
add r15d, 4
movzx eax, cl
add rdi, 4
or r13d, eax
inc ebp
cmp ebp, dword [rbx]
jl 0x1800833a0
jmp 0x180083670
test eax, eax
jle 0x180083675
lea r14, [rcx + rsi]
mov esi, dword [rsp + 0x38]
mov rcx, rbx
call fcn.180078a00
cmp esi, 0x10
jne 0x180083507
mov edx, eax
jmp 0x18008351d
mov rcx, rbx
mov edi, eax
call fcn.180078a00
mov edx, eax
shl edx, 0x10
add edx, edi
mov rdi, qword [rsp + 0x58]
mov ecx, dword [rsp + 0x40]
mov eax, edx
and eax, dword [rsp + 0x3c]
test ecx, ecx
jns 0x180083536
mov ecx, dword [rsp + 0x6c]
shlx ecx, eax, ecx
jmp 0x18008353b
shrx ecx, eax, ecx
mov r8, qword [rsp + 0xc0]
lea r9, [0x180000000]
mov eax, dword [rsp + 0x70]
shrx ecx, ecx, eax
imul ecx, dword [r9 + r8*4 + 0x1e44e8]
mov eax, dword [r9 + r8*4 + 0x1e44c0]
sarx ecx, ecx, eax
mov eax, edx
mov byte [r14], cl
and eax, dword [rsp + 0x24]
mov ecx, dword [rsp + 0x28]
test ecx, ecx
jns 0x180083585
mov ecx, dword [rsp + 0x74]
shlx ecx, eax, ecx
jmp 0x18008358a
shrx ecx, eax, ecx
mov r8, qword [rsp + 0xc8]
mov eax, dword [rsp + 0x78]
shrx ecx, ecx, eax
imul ecx, dword [r9 + r8*4 + 0x1e44e8]
mov eax, dword [r9 + r8*4 + 0x1e44c0]
sarx ecx, ecx, eax
mov eax, edx
mov byte [r14 + 1], cl
and eax, dword [rsp + 0x44]
mov ecx, dword [rsp + 0x34]
test ecx, ecx
jns 0x1800835ce
mov ecx, dword [rsp + 0x7c]
shlx ecx, eax, ecx
jmp 0x1800835d3
shrx ecx, eax, ecx
mov r8, qword [rsp + 0xd0]
mov eax, dword [rsp + 0x80]
mov r11d, dword [rsp + 0x50]
shrx ecx, ecx, eax
imul ecx, dword [r9 + r8*4 + 0x1e44e8]
mov eax, dword [r9 + r8*4 + 0x1e44c0]
sarx ecx, ecx, eax
mov byte [r14 + 2], cl
test r11d, r11d
je 0x180083648
mov r8d, dword [rsp + 0x2c]
and edx, r11d
test r8d, r8d
jns 0x180083626
mov eax, dword [rsp + 0x84]
shlx eax, edx, eax
jmp 0x18008362b
shrx eax, edx, r8d
shrx ecx, eax, r12d
imul ecx, dword [r9 + rdi*4 + 0x1e44e8]
mov eax, dword [r9 + rdi*4 + 0x1e44c0]
sarx edx, ecx, eax
jmp 0x18008364d
mov edx, 0xff
mov byte [r14 + 3], dl
or r13d, edx
add r14, 4
add r15d, 4
inc ebp
cmp ebp, dword [rbx]
jl 0x1800834f6
mov rsi, qword [rsp + 0x60]
mov r14, qword [rsp + 0x48]
mov r11d, dword [rsp + 0x20]
test r11d, r11d
je 0x1800836bd
cmp qword [rbx + 0x10], 0
je 0x1800836b3
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, r11d
jge 0x1800836b3
mov rax, qword [rbx + 0xc8]
mov edx, r11d
sub edx, ecx
mov qword [rbx + 0xc0], rax
mov rcx, qword [rbx + 0x28]
call qword [rbx + 0x18]
mov r11d, dword [rsp + 0x20]
jmp 0x1800836bd
mov eax, r11d
add qword [rbx + 0xc0], rax
mov ecx, dword [rsp + 0x30]
mov eax, dword [rbx + 4]
inc ecx
mov rdi, qword [rsp + 0x58]
mov edx, eax
mov dword [rsp + 0x30], ecx
cmp ecx, eax
jl 0x180083380
test r13d, r13d
jne 0x18008370d
imul eax, dword [rbx]
lea eax, [rax*4 - 1]
movsxd rcx, eax
test eax, eax
js 0x18008370d
mov rax, qword [rsp + 0x90]
nop word [rax + rax]
mov byte [rax + rcx], 0xff
sub rcx, 4
jns 0x180083700
mov edx, dword [rbx + 4]
cmp dword [rsp + 0x88], 0
jle 0x18008377f
xor r10d, r10d
test edx, 0xfffffffe
jle 0x18008377f
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
shl r9d, 2
add rdx, rsi
add r9, rsi
test eax, eax
jle 0x180083770
sub r9, rdx
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 0x180083751
mov edx, dword [rbx + 4]
inc r10d
mov eax, edx
sar eax, 1
cmp r10d, eax
jl 0x180083722
mov eax, dword [rbx]
mov rcx, qword [rsp + 0xd8]
mov dword [rcx], eax
mov eax, dword [rbx + 4]
mov rcx, qword [rsp + 0xe0]
mov dword [rcx], eax
mov rax, rsi
jmp 0x180083803
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov edx, dword [0x18023784c]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, str.bad_masks
jmp 0x1800837f8
mov edx, dword [0x18023784c]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, str.outofmem
jmp 0x1800837f8
mov edx, dword [0x18023784c]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, str.too_large
mov ecx, 0x38
mov qword [rcx + rax], rdx
xor eax, eax
mov r13, qword [rsp + 0x508]
mov rdi, qword [rsp + 0x510]
mov rsi, qword [rsp + 0x518]
mov rbp, qword [rsp + 0x558]
mov r14, qword [rsp + 0x500]
mov rcx, qword [rsp + 0x4f0]
xor rcx, rsp
call fcn.18016cc50
add rsp, 0x520
pop r15
pop r12
pop rbx
ret