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

Disassembly:
mov qword [rsp + 0x20], r9
mov qword [rsp + 0x18], r8
mov qword [rsp + 0x10], rdx
push rbx
push r12
sub rsp, 0x4e8
lea rdx, [rsp + 0x80]
mov dword [rsp + 0x9c], 0xff
mov rbx, rcx
xor r12d, r12d
call fcn.140044e70
test rax, rax
je 0x1400453b6
mov eax, dword [rbx + 4]
mov r9d, eax
neg r9d
mov dword [rsp + 0x6c], eax
cmovs r9d, eax
mov dword [rbx + 4], r9d
cmp r9d, 0x1000000
jbe 0x1400453c3
mov rax, qword gs:[0x58]
mov edx, 0x18
mov rcx, qword [rax]
lea rax, str.too_large
mov qword [rdx + rcx], rax
xor eax, eax
add rsp, 0x4e8
pop r12
pop rbx
ret
mov r8d, dword [rbx]
cmp r8d, 0x1000000
ja 0x14004539a
mov eax, dword [rsp + 0x8c]
mov r10d, dword [rsp + 0x98]
mov dword [rsp + 0x528], eax
mov eax, dword [rsp + 0x90]
mov dword [rsp + 0x30], eax
mov eax, dword [rsp + 0x94]
mov qword [rsp + 0x500], rbp
mov ebp, dword [rsp + 0x88]
mov dword [rsp + 0x38], eax
mov eax, dword [rsp + 0x9c]
mov qword [rsp + 0x4d0], r13
mov r13d, dword [rsp + 0x80]
mov qword [rsp + 0x4c8], r14
movsxd r14, dword [rsp + 0x84]
mov dword [rsp + 0x520], eax
mov eax, dword [rsp + 0xa0]
mov dword [rsp + 0x20], eax
mov dword [rsp + 0x48], r10d
mov dword [rsp + 0x2c], r14d
mov dword [rsp + 0x28], ebp
mov dword [rsp + 0x518], r13d
cmp ebp, 0xc
jne 0x14004547f
cmp r13d, 0x18
jge 0x140045497
mov ecx, r14d
sub ecx, eax
mov eax, 0x55555556
sub ecx, 0x18
imul ecx
mov r12d, edx
shr r12d, 0x1f
add r12d, edx
jmp 0x140045492
cmp r13d, 0x10
jge 0x140045497
mov r12d, r14d
sub r12d, eax
sub r12d, ebp
sar r12d, 2
test r12d, r12d
jne 0x1400454d4
movsxd rcx, dword [rbx + 0xb8]
add rcx, qword [rbx + 0xc0]
sub rcx, rbx
sub rcx, 0x38
cmp r14, rcx
je 0x1400454d4
mov rax, qword gs:[0x58]
mov edx, 0x18
mov rcx, qword [rax]
lea rax, str.bad_offset
mov qword [rdx + rcx], rax
xor eax, eax
jmp 0x140045bae
cmp r13d, 0x18
jne 0x1400454e9
cmp r10d, 0xff000000
jne 0x1400454e9
lea eax, [r13 - 0x15]
jmp 0x1400454f4
xor eax, eax
test r10d, r10d
setne al
add eax, 3
mov dword [rbx + 8], eax
test r8d, r8d
js 0x1400463c7
jne 0x14004550c
lea ecx, [r8*4]
jmp 0x14004552e
mov eax, 0x7fffffff
cdq
idiv r8d
cmp eax, 4
jl 0x1400463c7
lea ecx, [r8*4]
test ecx, ecx
js 0x1400463c7
test r9d, r9d
js 0x1400463c7
je 0x14004554a
mov eax, 0x7fffffff
cdq
idiv r9d
cmp ecx, eax
jg 0x1400463c7
mov qword [rsp + 0x4e0], rsi
test r8d, r8d
je 0x140045569
mov eax, 0x7fffffff
cdq
idiv r8d
cmp eax, 4
jl 0x1400463a4
lea ecx, [r8*4]
test r9d, r9d
je 0x140045587
mov eax, 0x7fffffff
cdq
idiv r9d
cmp ecx, eax
jg 0x1400463a4
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 + 0x70], rax
mov rsi, rax
test rax, rax
je 0x1400463a4
mov qword [rsp + 0x4d8], rdi
xor edi, edi
mov qword [rsp + 0x4c0], r15
cmp r13d, 0x10
jge 0x140045bf4
test r12d, r12d
je 0x140045bd1
cmp r12d, 0x100
jg 0x140045bd1
test r12d, r12d
jle 0x14004573b
mov esi, dword [rsp + 0x28]
lea rbp, [rbx + 0x30]
xor r15d, r15d
movsxd r14, r12d
nop word [rax + rax]
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x14004561f
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x140045648
cmp dword [rbx + 0x30], edi
lea rbp, [rbx + 0x30]
je 0x140045646
mov rcx, rbx
call fcn.14003b1e0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x140045648
xor cl, cl
mov r13, rbp
mov byte [rsp + r15*4 + 0xc2], cl
cmp rax, qword [rbx + 0xc8]
jae 0x14004566b
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x140045690
cmp dword [rbp], edi
je 0x14004568e
mov rcx, rbx
call fcn.14003b1e0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x140045690
xor cl, cl
mov byte [rsp + r15*4 + 0xc1], cl
cmp rax, qword [rbx + 0xc8]
jae 0x1400456b4
movzx ecx, byte [rax]
lea rbp, [rbx + 0x30]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1400456d9
cmp dword [rbp], edi
je 0x1400456d7
mov rcx, rbx
call fcn.14003b1e0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1400456d9
xor cl, cl
mov byte [rsp + r15*4 + 0xc0], cl
cmp esi, 0xc
je 0x140045710
cmp rax, qword [rbx + 0xc8]
jae 0x1400456fb
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x140045710
cmp dword [r13], edi
je 0x140045710
mov rcx, rbx
call fcn.14003b1e0
inc qword [rbx + 0xc0]
mov byte [rsp + r15*4 + 0xc3], 0xff
inc r15
cmp r15, r14
jl 0x140045600
mov rsi, qword [rsp + 0x70]
mov r14d, dword [rsp + 0x2c]
mov ebp, dword [rsp + 0x28]
mov r13d, dword [rsp + 0x518]
xor eax, eax
cmp ebp, 0xc
setne al
add eax, 3
imul eax, r12d
sub r14d, eax
sub r14d, dword [rsp + 0x20]
sub r14d, ebp
je 0x1400457aa
test r14d, r14d
jns 0x14004576c
mov rax, qword [rbx + 0xc8]
mov qword [rbx + 0xc0], rax
jmp 0x1400457aa
cmp qword [rbx + 0x10], rdi
je 0x1400457a0
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, r14d
jge 0x1400457a0
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 0x1400457aa
movsxd rax, r14d
add qword [rbx + 0xc0], rax
cmp r13d, 1
jne 0x1400457bd
mov r15d, dword [rbx]
add r15d, 7
shr r15d, 3
jmp 0x1400457db
cmp r13d, 4
jne 0x1400457ce
mov r15d, dword [rbx]
inc r15d
shr r15d, 1
jmp 0x1400457db
cmp r13d, 8
jne 0x140045b6f
mov r15d, dword [rbx]
mov eax, dword [rbx + 4]
neg r15d
and r15d, 3
mov ecx, eax
cmp r13d, 1
jne 0x140045999
xor r12d, r12d
test eax, eax
jle 0x1400462b9
nop dword [rax]
mov r9, qword [rbx + 0xc0]
mov ebp, 7
cmp r9, qword [rbx + 0xc8]
jae 0x140045825
movzx ecx, byte [r9]
inc r9
mov qword [rbx + 0xc0], r9
jmp 0x14004584c
cmp dword [rbx + 0x30], 0
je 0x14004584a
mov rcx, rbx
call fcn.14003b1e0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
lea r9, [rax + 1]
mov qword [rbx + 0xc0], r9
jmp 0x14004584c
xor cl, cl
mov edx, dword [rbx]
xor r14d, r14d
movzx r11d, cl
mov rcx, r9
test edx, edx
jle 0x14004593e
mov r8, r9
mov r10d, edx
nop word [rax + rax]
mov eax, r11d
mov ecx, ebp
sar eax, cl
mov r9d, r8d
and eax, 1
lea rcx, [rax*4]
movzx eax, byte [rsp + rcx + 0xc0]
mov byte [rdi + rsi], al
movzx eax, byte [rsp + rcx + 0xc1]
mov byte [rdi + rsi + 1], al
movzx eax, byte [rsp + rcx + 0xc2]
mov rcx, r8
mov byte [rdi + rsi + 2], al
lea eax, [r14 + 1]
mov byte [rdi + rsi + 3], 0xff
mov r14d, eax
add rdi, 4
cmp eax, edx
je 0x14004593e
sub ebp, 1
jns 0x140045922
mov ebp, 7
cmp r8, qword [rbx + 0xc8]
jae 0x1400458ea
movzx r9d, byte [r8]
lea rcx, [r8 + 1]
mov qword [rbx + 0xc0], rcx
mov edx, r10d
movzx r11d, r9b
jmp 0x14004592c
cmp dword [rbx + 0x30], 0
je 0x140045916
mov rcx, rbx
call fcn.14003b1e0
mov rax, qword [rbx + 0xc0]
movzx r9d, byte [rax]
lea rcx, [rax + 1]
mov qword [rbx + 0xc0], rcx
mov edx, dword [rbx]
movzx r11d, r9b
jmp 0x14004592c
xor r9b, r9b
mov edx, r10d
movzx r11d, r9b
jmp 0x14004592c
mov rcx, qword [rbx + 0xc0]
mov edx, r10d
mov r8, rcx
mov r9d, ecx
mov r10d, edx
cmp r14d, edx
jl 0x140045870
test r15d, r15d
je 0x140045983
cmp qword [rbx + 0x10], 0
je 0x140045976
mov r8d, dword [rbx + 0xc8]
sub r8d, r9d
cmp r8d, r15d
jge 0x140045976
mov rax, qword [rbx + 0xc8]
mov edx, r15d
mov rcx, qword [rbx + 0x28]
sub edx, r8d
mov qword [rbx + 0xc0], rax
call qword [rbx + 0x18]
jmp 0x140045983
mov eax, r15d
add rax, rcx
mov qword [rbx + 0xc0], rax
mov eax, dword [rbx + 4]
inc r12d
mov ecx, eax
cmp r12d, eax
jl 0x140045800
jmp 0x1400462b9
xor r14d, r14d
test eax, eax
jle 0x1400462b9
nop dword [rax]
nop dword [rax + rax]
mov r8d, dword [rbx]
xor ebp, ebp
test r8d, r8d
jle 0x140045b16
nop
mov r9, qword [rbx + 0xc0]
cmp r9, qword [rbx + 0xc8]
jae 0x1400459e0
movzx ecx, byte [r9]
inc r9
mov qword [rbx + 0xc0], r9
jmp 0x140045a0a
cmp dword [rbx + 0x30], 0
je 0x140045a08
mov rcx, rbx
call fcn.14003b1e0
mov rax, qword [rbx + 0xc0]
mov r8d, dword [rbx]
movzx ecx, byte [rax]
lea r9, [rax + 1]
mov qword [rbx + 0xc0], r9
jmp 0x140045a0a
xor cl, cl
mov edx, 0x30
xor r10d, r10d
mov rax, rbx
movzx eax, cl
lea r11, [rbx + rdx]
cmp r13d, 4
jne 0x140045a2c
mov r10d, eax
and r10d, 0xf
shr eax, 4
movsxd rcx, edi
lea rdx, [rax*4]
movzx eax, byte [rsp + rdx + 0xc0]
inc edi
mov byte [rcx + rsi], al
movzx eax, byte [rsp + rdx + 0xc1]
movsxd rcx, edi
inc edi
mov byte [rcx + rsi], al
movzx eax, byte [rsp + rdx + 0xc2]
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, r8d
je 0x140045b16
cmp r13d, 8
jne 0x140045ac6
cmp r9, qword [rbx + 0xc8]
jae 0x140045a99
movzx ecx, byte [r9]
lea rax, [r9 + 1]
mov qword [rbx + 0xc0], rax
jmp 0x140045ac2
cmp dword [r11], 0
je 0x140045ac0
mov rcx, rbx
call fcn.14003b1e0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
mov r8d, dword [rbx]
jmp 0x140045ac2
xor cl, cl
movzx r10d, cl
movsxd rcx, edi
lea rdx, [r10*4]
movzx eax, byte [rsp + rdx + 0xc0]
inc edi
add ebp, 2
mov r9d, r8d
mov byte [rcx + rsi], al
movzx eax, byte [rsp + rdx + 0xc1]
movsxd rcx, edi
inc edi
mov byte [rcx + rsi], al
movzx eax, byte [rsp + rdx + 0xc2]
movsxd rcx, edi
inc edi
mov byte [rcx + rsi], al
movsxd rax, edi
inc edi
mov byte [rax + rsi], 0xff
cmp ebp, r8d
jl 0x1400459c0
test r15d, r15d
je 0x140045b59
cmp qword [rbx + 0x10], 0
je 0x140045b4f
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, r15d
jge 0x140045b4f
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 0x140045b59
mov eax, r15d
add qword [rbx + 0xc0], rax
mov eax, dword [rbx + 4]
inc r14d
mov ecx, eax
cmp r14d, eax
jl 0x1400459b0
jmp 0x1400462b9
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rax, qword gs:[0x58]
mov edx, 0x18
mov rcx, qword [rax]
lea rax, str.bad_bpp
mov qword [rdx + rcx], rax
xor eax, eax
mov rdi, qword [rsp + 0x4d8]
mov r15, qword [rsp + 0x4c0]
mov rsi, qword [rsp + 0x4e0]
mov r13, qword [rsp + 0x4d0]
mov rbp, qword [rsp + 0x500]
mov r14, qword [rsp + 0x4c8]
add rsp, 0x4e8
pop r12
pop rbx
ret
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rax, qword gs:[0x58]
mov edx, 0x18
mov rcx, qword [rax]
lea rax, str.invalid
jmp 0x140045b90
sub r14d, dword [rsp + 0x20]
xor r11d, r11d
xor r8d, r8d
mov dword [rsp + 0x2c], r11d
xor r9d, r9d
mov dword [rsp + 0x34], r11d
xor r13d, r13d
mov dword [rsp + 0x3c], r11d
xor r12d, r12d
mov dword [rsp + 0x28], r8d
xor r15d, r15d
sub r14d, ebp
je 0x140045c80
test r14d, r14d
jns 0x140045c39
mov rax, qword [rbx + 0xc8]
mov qword [rbx + 0xc0], rax
jmp 0x140045c80
cmp qword [rbx + 0x10], rdi
je 0x140045c76
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, r14d
jge 0x140045c76
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 r9d, edi
mov r8d, edi
mov r11d, edi
jmp 0x140045c80
movsxd rax, r14d
add qword [rbx + 0xc0], rax
mov ecx, dword [rsp + 0x518]
cmp ecx, 0x18
jne 0x140045c93
mov eax, dword [rbx]
lea edx, [rax + rax*2]
jmp 0x140045ca0
cmp ecx, 0x10
jne 0x140045c9e
mov edx, dword [rbx]
add edx, edx
jmp 0x140045ca0
xor edx, edx
neg edx
and edx, 3
mov dword [rsp + 0x24], edx
cmp ecx, 0x18
jne 0x140045cc1
mov qword [rsp + 0x40], 1
mov ebp, edi
mov r14d, edi
jmp 0x140045ee9
mov r14d, dword [rsp + 0x30]
xor eax, eax
mov qword [rsp + 0x40], rax
cmp ecx, 0x20
jne 0x140045d27
cmp dword [rsp + 0x38], 0xff
mov qword [rsp + 0x40], rax
jne 0x140045d27
mov qword [rsp + 0x40], rax
cmp r14d, 0xff00
jne 0x140045d27
cmp dword [rsp + 0x528], 0xff0000
mov qword [rsp + 0x40], rax
jne 0x140045d27
mov r10d, dword [rsp + 0x48]
mov qword [rsp + 0x40], rax
cmp r10d, 0xff000000
jne 0x140045d54
mov qword [rsp + 0x40], 2
mov ebp, eax
mov r14d, eax
jmp 0x140045ee9
mov r9d, dword [rsp + 0x528]
test r9d, r9d
je 0x14004637e
test r14d, r14d
je 0x14004637e
mov edi, dword [rsp + 0x38]
test edi, edi
je 0x14004637e
mov r10d, dword [rsp + 0x48]
jmp 0x140045d60
mov r9d, dword [rsp + 0x528]
mov edi, dword [rsp + 0x38]
mov ecx, r9d
call fcn.140044e00
mov edx, r9d
mov ecx, r9d
shr edx, 1
and ecx, 0x55555555
and edx, 0x55555555
add edx, ecx
lea r11d, [rax - 7]
mov ecx, edx
mov dword [rsp + 0x2c], r11d
and edx, 0x33333333
shr ecx, 2
and ecx, 0x33333333
add ecx, edx
mov edx, ecx
shr edx, 4
add edx, ecx
mov ecx, r14d
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.140044e00
mov edx, r14d
mov ecx, r14d
shr edx, 1
and ecx, 0x55555555
and edx, 0x55555555
add edx, ecx
lea ebp, [rax - 7]
mov ecx, edx
mov dword [rsp + 0x34], ebp
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 r13d, al
call fcn.140044e00
mov edx, edi
mov ecx, edi
shr edx, 1
and ecx, 0x55555555
and edx, 0x55555555
add edx, ecx
lea r14d, [rax - 7]
mov ecx, edx
mov dword [rsp + 0x3c], r14d
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 r12d, al
call fcn.140044e00
lea r8d, [rax - 7]
mov edx, r10d
mov dword [rsp + 0x28], r8d
shr edx, 1
mov ecx, r10d
and edx, 0x55555555
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 r9d, 8
ja 0x14004637e
cmp r13d, 8
ja 0x14004637e
cmp r12d, 8
ja 0x14004637e
cmp edi, 8
ja 0x14004637e
mov edx, dword [rsp + 0x24]
mov eax, dword [rbx + 4]
xor r10d, r10d
mov dword [rsp + 0x20], r10d
mov ecx, eax
test eax, eax
jle 0x1400462b9
mov eax, r11d
mov qword [rsp + 0x78], rdi
neg eax
mov dword [rsp + 0x54], eax
mov eax, 8
mov ecx, eax
sub ecx, r9d
mov dword [rsp + 0x58], ecx
mov ecx, ebp
neg ecx
mov dword [rsp + 0x5c], ecx
mov ecx, eax
sub ecx, r13d
mov dword [rsp + 0x60], ecx
mov ecx, r14d
neg ecx
mov dword [rsp + 0x64], ecx
mov ecx, eax
sub ecx, r12d
mov dword [rsp + 0x68], ecx
mov ecx, r8d
neg ecx
sub eax, edi
mov dword [rsp + 0x50], ecx
mov dword [rsp + 0x4c], eax
mov eax, r9d
mov ecx, r13d
mov r13d, dword [rsp + 0x4c]
mov qword [rsp + 0xa8], rax
mov eax, r12d
mov r12, qword [rsp + 0x40]
mov qword [rsp + 0xb8], rax
mov qword [rsp + 0xb0], rcx
nop word [rax + rax]
mov eax, dword [rbx]
xor ebp, ebp
movsxd rcx, r15d
test r12, r12
je 0x1400460e2
test eax, eax
jle 0x140046258
lea r14, [rcx + rsi]
lea rdi, [rbx + 0x30]
mov rax, qword [rbx + 0xc0]
cmp rax, qword [rbx + 0xc8]
jae 0x140045fbf
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x140045fe9
cmp dword [rbx + 0x30], 0
lea rdi, [rbx + 0x30]
je 0x140045fe7
mov rcx, rbx
call fcn.14003b1e0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x140045fe9
xor cl, cl
mov byte [r14 + 2], cl
cmp rax, qword [rbx + 0xc8]
jae 0x140046005
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14004602a
cmp dword [rdi], 0
je 0x140046028
mov rcx, rbx
call fcn.14003b1e0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14004602a
xor cl, cl
mov byte [r14 + 1], cl
cmp rax, qword [rbx + 0xc8]
jae 0x14004604a
movzx ecx, byte [rax]
lea rdi, [rbx + 0x30]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14004606f
cmp dword [rdi], 0
je 0x14004606d
mov rcx, rbx
call fcn.14003b1e0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x14004606f
xor cl, cl
mov byte [r14], cl
cmp r12, 2
jne 0x1400460bb
cmp rax, qword [rbx + 0xc8]
jae 0x140046094
movzx ecx, byte [rax]
lea rdi, [rbx + 0x30]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1400460bd
cmp dword [rdi], 0
je 0x1400460b7
mov rcx, rbx
call fcn.14003b1e0
mov rax, qword [rbx + 0xc0]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xc0], rax
jmp 0x1400460bd
xor cl, cl
jmp 0x1400460bd
mov cl, 0xff
movzx eax, cl
add r15d, 4
or dword [rsp + 0x520], eax
inc ebp
mov byte [r14 + 3], cl
add r14, 4
cmp ebp, dword [rbx]
jl 0x140045fa0
jmp 0x14004624f
test eax, eax
jle 0x140046258
mov r12d, dword [rsp + 0x50]
lea r14, [rcx + rsi]
mov esi, dword [rsp + 0x518]
nop word [rax + rax]
mov rcx, rbx
call fcn.14003b3f0
cmp esi, 0x10
je 0x140046121
mov rcx, rbx
mov edi, eax
call fcn.14003b3f0
shl eax, 0x10
add eax, edi
mov rdi, qword [rsp + 0x78]
mov r11d, dword [rsp + 0x2c]
mov edx, eax
and edx, dword [rsp + 0x528]
test r11d, r11d
jns 0x14004613c
mov ecx, dword [rsp + 0x54]
shl edx, cl
jmp 0x140046141
mov ecx, r11d
shr edx, cl
mov r8, qword [rsp + 0xa8]
lea r9, [0x140000000]
mov ecx, dword [rsp + 0x58]
shr edx, cl
imul edx, dword [r9 + r8*4 + 0xb4b88]
mov ecx, dword [r9 + r8*4 + 0xb4d40]
sar edx, cl
mov ecx, dword [rsp + 0x34]
mov byte [r14], dl
mov edx, eax
and edx, dword [rsp + 0x30]
test ecx, ecx
jns 0x140046182
mov ecx, dword [rsp + 0x5c]
shl edx, cl
jmp 0x140046184
shr edx, cl
mov r8, qword [rsp + 0xb0]
mov ecx, dword [rsp + 0x60]
shr edx, cl
imul edx, dword [r9 + r8*4 + 0xb4b88]
mov ecx, dword [r9 + r8*4 + 0xb4d40]
sar edx, cl
mov ecx, dword [rsp + 0x3c]
mov byte [r14 + 1], dl
mov edx, eax
and edx, dword [rsp + 0x38]
test ecx, ecx
jns 0x1400461bf
mov ecx, dword [rsp + 0x64]
shl edx, cl
jmp 0x1400461c1
shr edx, cl
mov r8, qword [rsp + 0xb8]
mov ecx, dword [rsp + 0x68]
mov r10d, dword [rsp + 0x48]
shr edx, cl
imul edx, dword [r9 + r8*4 + 0xb4b88]
mov ecx, dword [r9 + r8*4 + 0xb4d40]
sar edx, cl
mov byte [r14 + 2], dl
test r10d, r10d
je 0x140046223
mov r8d, dword [rsp + 0x28]
and eax, r10d
test r8d, r8d
jns 0x140046204
mov ecx, r12d
shl eax, cl
jmp 0x140046209
mov ecx, r8d
shr eax, cl
mov ecx, r13d
shr eax, cl
imul eax, dword [r9 + rdi*4 + 0xb4b88]
mov ecx, dword [r9 + rdi*4 + 0xb4d40]
sar eax, cl
jmp 0x140046228
mov eax, 0xff
or dword [rsp + 0x520], eax
add r15d, 4
mov byte [r14 + 3], al
inc ebp
add r14, 4
cmp ebp, dword [rbx]
jl 0x140046100
mov rsi, qword [rsp + 0x70]
mov r12, qword [rsp + 0x40]
mov r10d, dword [rsp + 0x20]
mov edx, dword [rsp + 0x24]
test edx, edx
je 0x14004629e
cmp qword [rbx + 0x10], 0
je 0x140046295
mov ecx, dword [rbx + 0xc8]
sub ecx, dword [rbx + 0xc0]
cmp ecx, edx
jge 0x140046295
mov rax, qword [rbx + 0xc8]
sub edx, ecx
mov rcx, qword [rbx + 0x28]
mov qword [rbx + 0xc0], rax
call qword [rbx + 0x18]
mov edx, dword [rsp + 0x24]
mov r10d, dword [rsp + 0x20]
jmp 0x14004629e
mov eax, edx
add qword [rbx + 0xc0], rax
mov eax, dword [rbx + 4]
inc r10d
mov rdi, qword [rsp + 0x78]
mov ecx, eax
mov dword [rsp + 0x20], r10d
cmp r10d, eax
jl 0x140045f80
cmp dword [rsp + 0x520], 0
jne 0x1400462e1
imul eax, dword [rbx]
lea eax, [rax*4 - 1]
movsxd rdx, eax
test eax, eax
js 0x1400462e1
mov byte [rdx + rsi], 0xff
sub rdx, 4
jns 0x1400462d4
mov ecx, dword [rbx + 4]
cmp dword [rsp + 0x6c], 0
jle 0x140046360
xor r10d, r10d
mov edx, ecx
test ecx, 0xfffffffe
jle 0x140046360
nop word [rax + rax]
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 0x14004634f
sub r9, rdx
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 0x140046330
mov ecx, dword [rbx + 4]
inc r10d
mov eax, ecx
mov edx, ecx
sar eax, 1
cmp r10d, eax
jl 0x140046300
mov eax, dword [rbx]
mov rdx, qword [rsp + 0x508]
mov dword [rdx], eax
mov rax, qword [rsp + 0x510]
mov dword [rax], ecx
mov rax, rsi
jmp 0x140045b96
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rax, qword gs:[0x58]
mov edx, 0x18
mov rcx, qword [rax]
lea rax, str.bad_masks
jmp 0x140045b90
mov rax, qword gs:[0x58]
mov edx, 0x18
mov rcx, qword [rax]
lea rax, str.outofmem
mov qword [rdx + rcx], rax
xor eax, eax
jmp 0x140045ba6
mov rax, qword gs:[0x58]
mov edx, 0x18
mov rcx, qword [rax]
lea rax, str.too_large
mov qword [rdx + rcx], rax
xor eax, eax
jmp 0x140045bae