Function at 0x140046d50
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov r11, rsp
mov qword [r11 + 0x20], r9
mov qword [r11 + 0x18], r8
mov qword [r11 + 0x10], rdx
mov qword [r11 + 8], rcx
push rsi
push r12
push r14
sub rsp, 0x160
mov r14d, dword [rsp + 0x1a0]
xor r12d, r12d
mov rax, qword [rcx]
mov rsi, rcx
mov dword [rsp + 0x1a0], r14d
mov dword [rax + 8], r12d
cmp r14d, 4
ja 0x140047762
mov qword [r11 - 0x20], rbx
mov qword [r11 - 0x38], r13
call fcn.14004b6b0
mov rcx, qword [rsi]
test eax, eax
jne 0x140046e10
movsxd rbx, dword [rcx + 8]
test rbx, rbx
jle 0x140046fa8
add rsi, 0x46d8
nop
mov rcx, qword [rsi]
test rcx, rcx
je 0x140046dd5
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rsi], r12
mov qword [rsi - 8], r12
mov rcx, qword [rsi + 8]
test rcx, rcx
je 0x140046dec
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rsi + 8], r12
mov qword [rsi + 0x18], r12
mov rcx, qword [rsi + 0x10]
test rcx, rcx
je 0x140046dff
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rsi + 0x10], r12
add rsi, 0x60
sub rbx, 1
jne 0x140046dc0
xor eax, eax
jmp 0x1400476b9
mov eax, dword [rcx + 8]
mov edx, 3
lea r13d, [rdx - 2]
test r14d, r14d
jne 0x140046e32
cmp eax, edx
mov r14d, r13d
cmovge r14d, edx
mov dword [rsp + 0x1a0], r14d
cmp eax, edx
jne 0x140046e5a
cmp dword [rsi + 0x4850], edx
je 0x140046e50
cmp dword [rsi + 0x484c], r12d
jne 0x140046e5a
cmp dword [rsi + 0x4848], r12d
jne 0x140046e5a
mov edx, r13d
mov qword [rsp + 0x38], r13
jmp 0x140046e6b
mov qword [rsp + 0x38], r12
mov edx, r12d
cmp eax, 3
jne 0x140046f4c
cmp r14d, 3
jge 0x140046f4c
test edx, edx
jne 0x140046f4c
mov eax, r13d
mov qword [rsp + 0x150], rbp
xorps xmm0, xmm0
mov qword [rsp + 0x148], rdi
xorps xmm1, xmm1
mov qword [rsp + 0x138], r15
mov r15d, eax
mov qword [rsp + 0x40], r15
movdqu xmmword [rsp + 0x48], xmm0
movdqu xmmword [rsp + 0x58], xmm1
test eax, eax
je 0x140047003
mov rbp, r12
lea rbx, [rsp + 0x88]
lea rdi, [rsi + 0x46a4]
nop dword [rax]
mov rax, qword [rsi]
mov ecx, dword [rax]
add ecx, 3
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rdi + 0x44], rax
test rax, rax
je 0x1400470fe
mov eax, dword [rsi + 0x4688]
cdq
mov dword [rbx + 0x10], r12d
idiv dword [rdi]
mov r9d, eax
mov dword [rbx], eax
mov eax, dword [rsi + 0x468c]
cdq
idiv dword [rdi + 4]
xor edx, edx
mov ecx, eax
mov dword [rbx + 4], eax
sar ecx, 1
mov r8d, eax
mov dword [rbx + 0xc], ecx
mov rcx, qword [rsi]
mov eax, dword [rcx]
mov rcx, qword [rdi + 0x2c]
dec eax
add eax, r9d
mov qword [rbx - 8], rcx
div r9d
mov qword [rbx - 0x10], rcx
mov dword [rbx + 8], eax
cmp r9d, r13d
jne 0x140046fbe
cmp r8d, r13d
jne 0x140046faf
lea rax, [0x1400477a0]
jmp 0x140046fe8
test eax, eax
jg 0x140046e80
movsxd rbx, eax
xor eax, eax
jmp 0x1400476b9
xor eax, eax
jmp 0x1400476b9
cmp r8d, 2
jne 0x140046fe1
lea rax, [0x1400569c0]
jmp 0x140046fe8
cmp r9d, 2
jne 0x140046fe1
cmp r8d, r13d
jne 0x140046fd2
lea rax, [0x140056610]
jmp 0x140046fe8
cmp r8d, 2
jne 0x140046fe1
mov rax, qword [rsi + 0x4880]
jmp 0x140046fe8
lea rax, [0x1400565d0]
mov qword [rbx - 0x18], rax
inc rbp
add rbx, 0x30
add rdi, 0x60
cmp rbp, r15
jl 0x140046ed0
mov rcx, qword [rsi]
mov r8d, dword [rcx + 4]
mov ecx, dword [rcx]
test r14d, r14d
js 0x1400476d6
test ecx, ecx
js 0x1400476d6
je 0x14004702d
mov eax, 0x7fffffff
cdq
idiv ecx
cmp r14d, eax
jg 0x1400476d6
mov r9d, ecx
imul r9d, r14d
test r9d, r9d
js 0x1400476d6
test r8d, r8d
js 0x1400476d6
je 0x14004705a
mov eax, 0x7fffffff
cdq
idiv r8d
cmp r9d, eax
jg 0x1400476d6
imul ecx, r8d
imul ecx, r14d
cmp ecx, 0x7ffffffe
jg 0x1400476d6
lea eax, [rcx + 1]
movsxd rcx, eax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov rcx, qword [rsi]
mov r12, rax
test rax, rax
je 0x1400476db
xor eax, eax
mov dword [rsp + 0x30], eax
cmp dword [rcx + 4], eax
jbe 0x140047600
mov r13, qword [rsp + 0x60]
mov rbp, qword [rsp + 0x58]
mov r15, qword [rsp + 0x50]
mov rdi, qword [rsp + 0x48]
nop dword [rax]
imul eax, dword [rcx]
imul eax, r14d
xor r14d, r14d
mov ebx, eax
add rbx, r12
cmp qword [rsp + 0x40], r14
jbe 0x1400471e0
lea rbp, [rsi + 0x46c0]
mov rsi, qword [rsp + 0x40]
lea rdi, [rsp + 0x94]
nop
mov r15d, dword [rdi - 8]
mov eax, r15d
mov r13d, dword [rdi]
mov ecx, dword [rdi - 0xc]
sar eax, 1
cmp r13d, eax
jl 0x140047162
mov rdx, qword [rdi - 0x14]
mov r8, qword [rdi - 0x1c]
jmp 0x14004716a
mov rax, qword [rsi]
movsxd rbx, dword [rax + 8]
test rbx, rbx
jle 0x140047738
add rsi, 0x46d8
mov rcx, qword [rsi]
test rcx, rcx
je 0x14004712a
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rsi], r12
mov qword [rsi - 8], r12
mov rcx, qword [rsi + 8]
test rcx, rcx
je 0x140047141
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rsi + 8], r12
mov qword [rsi + 0x18], r12
mov rcx, qword [rsi + 0x10]
test rcx, rcx
je 0x140047154
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rsi + 0x10], r12
add rsi, 0x60
sub rbx, r13
jne 0x140047115
jmp 0x140047738
mov rdx, qword [rdi - 0x1c]
mov r8, qword [rdi - 0x14]
mov r9d, dword [rdi - 4]
mov dword [rsp + 0x20], ecx
mov rcx, qword [rbp + 0x28]
call qword [rdi - 0x24]
mov qword [rsp + r14*8 + 0x48], rax
lea eax, [r13 + 1]
mov dword [rdi], eax
cmp eax, r15d
jl 0x1400471ad
inc dword [rdi + 4]
mov eax, dword [rdi + 4]
mov rcx, qword [rdi - 0x14]
mov dword [rdi], 0
mov qword [rdi - 0x1c], rcx
cmp eax, dword [rbp]
jge 0x1400471ad
movsxd rax, dword [rbp + 4]
add rax, rcx
mov qword [rdi - 0x14], rax
inc r14
add rdi, 0x30
add rbp, 0x60
cmp r14, rsi
jl 0x1400470e0
mov rsi, qword [rsp + 0x180]
mov r13, qword [rsp + 0x60]
mov rbp, qword [rsp + 0x58]
mov r15, qword [rsp + 0x50]
mov rcx, qword [rsi]
mov rdi, qword [rsp + 0x48]
movsxd r14, dword [rsp + 0x1a0]
cmp r14d, 3
jl 0x1400473d4
mov eax, dword [rcx + 8]
cmp eax, 3
jne 0x140047262
cmp qword [rsp + 0x38], 0
je 0x14004723d
xor edx, edx
cmp dword [rcx], edx
jbe 0x1400473cc
nop dword [rax]
movzx eax, byte [rdx + rdi]
mov byte [rbx], al
movzx eax, byte [rdx + r15]
mov byte [rbx + 1], al
movzx eax, byte [rdx + rbp]
inc edx
mov byte [rbx + 2], al
mov byte [rbx + 3], 0xff
add rbx, r14
mov rax, qword [rsi]
cmp edx, dword [rax]
jb 0x140047210
mov rcx, rax
jmp 0x1400475e7
mov eax, dword [rcx]
mov r9, rbp
mov rcx, rbx
mov dword [rsp + 0x28], r14d
mov r8, r15
mov dword [rsp + 0x20], eax
mov rdx, rdi
call qword [rsi + 0x4878]
mov rcx, qword [rsi]
jmp 0x1400475e7
cmp eax, 4
jne 0x1400473a8
mov eax, dword [rsi + 0x484c]
test eax, eax
jne 0x1400472ea
xor r9d, r9d
cmp dword [rcx], r9d
jbe 0x1400473cc
movzx r8d, byte [r9 + r13]
movzx ecx, byte [r9 + rdi]
imul ecx, r8d
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [rbx], al
movzx ecx, byte [r9 + r15]
imul ecx, r8d
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [rbx + 1], al
movzx ecx, byte [r9 + rbp]
inc r9d
mov byte [rbx + 3], 0xff
imul ecx, r8d
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [rbx + 2], al
add rbx, r14
mov rax, qword [rsi]
cmp r9d, dword [rax]
jb 0x140047281
mov rcx, rax
jmp 0x1400475e7
mov edx, dword [rcx]
mov r9, rbp
mov r10, qword [rsi + 0x4878]
mov r8, r15
mov dword [rsp + 0x28], r14d
mov rcx, rbx
mov dword [rsp + 0x20], edx
mov rdx, rdi
cmp eax, 2
jne 0x14004739d
call r10
mov rax, qword [rsi]
xor r8d, r8d
cmp dword [rax], r8d
jbe 0x1400473cc
nop dword [rax]
nop word [rax + rax]
movzx edx, byte [r8 + r13]
inc r8d
movzx eax, byte [rbx]
not al
movzx ecx, al
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [rbx], al
movzx eax, byte [rbx + 1]
not al
movzx ecx, al
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [rbx + 1], al
movzx eax, byte [rbx + 2]
not al
movzx ecx, al
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [rbx + 2], al
add rbx, r14
mov rax, qword [rsi]
cmp r8d, dword [rax]
jb 0x140047330
mov rcx, rax
jmp 0x1400475e7
call r10
mov rcx, qword [rsi]
jmp 0x1400475e7
xor edx, edx
cmp dword [rcx], edx
jbe 0x1400473cc
nop
movzx ecx, byte [rdx + rdi]
inc edx
mov byte [rbx + 2], cl
mov byte [rbx + 1], cl
mov byte [rbx], cl
mov byte [rbx + 3], 0xff
add rbx, r14
mov rax, qword [rsi]
cmp edx, dword [rax]
jb 0x1400473b0
mov rcx, qword [rsi]
jmp 0x1400475e7
cmp qword [rsp + 0x38], 0
je 0x140047492
mov eax, dword [rcx]
xor r9d, r9d
cmp r14d, 1
jne 0x14004743e
test eax, eax
je 0x1400475e7
nop dword [rax]
nop word [rax + rax]
movzx eax, byte [r9 + r15]
lea rbx, [rbx + 1]
imul r8d, eax, 0x96
movzx eax, byte [r9 + rbp]
imul ecx, eax, 0x1d
movzx eax, byte [r9 + rdi]
inc r9d
add r8d, ecx
imul ecx, eax, 0x4d
add r8d, ecx
shr r8d, 8
mov byte [rbx - 1], r8b
mov rcx, qword [rsi]
cmp r9d, dword [rcx]
jb 0x140047400
jmp 0x1400475e7
test eax, eax
je 0x1400475e7
nop word [rax + rax]
movzx eax, byte [r9 + r15]
lea rbx, [rbx + 2]
imul r8d, eax, 0x96
movzx eax, byte [r9 + rbp]
imul ecx, eax, 0x1d
movzx eax, byte [r9 + rdi]
inc r9d
mov byte [rbx - 1], 0xff
add r8d, ecx
imul ecx, eax, 0x4d
add r8d, ecx
shr r8d, 8
mov byte [rbx - 2], r8b
mov rcx, qword [rsi]
cmp r9d, dword [rcx]
jb 0x140047450
jmp 0x1400475e7
cmp dword [rcx + 8], 4
jne 0x140047595
mov eax, dword [rsi + 0x484c]
test eax, eax
jne 0x140047541
xor r10d, r10d
cmp dword [rcx], r10d
jbe 0x1400475e7
nop word [rax + rax]
movzx ecx, byte [r10 + r13]
movzx edx, byte [r10 + r15]
movzx r8d, byte [r10 + rbp]
movzx r9d, byte [r10 + rdi]
inc r10d
imul edx, ecx
imul r8d, ecx
imul r9d, ecx
mov byte [rbx + 1], 0xff
sub edx, 0xffffff80
mov eax, edx
sub r8d, 0xffffff80
shr eax, 8
sub r9d, 0xffffff80
add eax, edx
shr eax, 8
movzx eax, al
imul edx, eax, 0x96
mov eax, r8d
shr eax, 8
add eax, r8d
shr eax, 8
movzx eax, al
imul ecx, eax, 0x1d
mov eax, r9d
shr eax, 8
add eax, r9d
shr eax, 8
movzx eax, al
add edx, ecx
imul ecx, eax, 0x4d
add edx, ecx
shr edx, 8
mov byte [rbx], dl
add rbx, r14
mov rcx, qword [rsi]
cmp r10d, dword [rcx]
jb 0x1400474c0
jmp 0x1400475e7
cmp eax, 2
jne 0x140047595
xor r8d, r8d
cmp dword [rcx], r8d
jbe 0x1400475e7
nop dword [rax]
nop word [rax + rax]
movzx eax, byte [r8 + rdi]
not al
movzx edx, al
movzx eax, byte [r8 + r13]
inc r8d
imul edx, eax
mov byte [rbx + 1], 0xff
sub edx, 0xffffff80
mov eax, edx
shr eax, 8
add eax, edx
shr eax, 8
mov byte [rbx], al
add rbx, r14
mov rcx, qword [rsi]
cmp r8d, dword [rcx]
jb 0x140047560
jmp 0x1400475e7
mov eax, dword [rcx]
xor edx, edx
cmp r14d, 1
jne 0x1400475c2
test eax, eax
je 0x1400475e7
nop dword [rax]
nop word [rax + rax]
movzx eax, byte [rdx + rdi]
mov byte [rdx + rbx], al
inc edx
mov rcx, qword [rsi]
cmp edx, dword [rcx]
jb 0x1400475b0
jmp 0x1400475e7
test eax, eax
je 0x1400475e7
nop word [rax + rax]
movzx ecx, byte [rdx + rdi]
inc edx
mov byte [rbx], cl
mov byte [rbx + 1], 0xff
lea rbx, [rbx + 2]
mov rcx, qword [rsi]
cmp edx, dword [rcx]
jb 0x1400475d0
mov eax, dword [rsp + 0x30]
inc eax
mov dword [rsp + 0x30], eax
cmp eax, dword [rcx + 4]
jb 0x1400470b0
mov r13d, 1
movsxd rdi, dword [rcx + 8]
test rdi, rdi
jle 0x140047662
lea rbx, [rsi + 0x46d8]
mov rcx, qword [rbx]
test rcx, rcx
je 0x140047629
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
xor ebp, ebp
mov qword [rbx], rbp
mov qword [rbx - 8], rbp
jmp 0x14004762b
xor ebp, ebp
mov rcx, qword [rbx + 8]
test rcx, rcx
je 0x140047642
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rbx + 8], rbp
mov qword [rbx + 0x18], rbp
mov rcx, qword [rbx + 0x10]
test rcx, rcx
je 0x140047655
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rbx + 0x10], rbp
add rbx, 0x60
sub rdi, 1
jne 0x140047610
mov rcx, qword [rsi]
mov eax, dword [rcx]
mov rcx, qword [rsp + 0x188]
mov dword [rcx], eax
mov rcx, qword [rsi]
mov rax, qword [rsp + 0x190]
mov edx, dword [rcx + 4]
mov dword [rax], edx
mov rax, qword [rsp + 0x198]
test rax, rax
je 0x14004769e
mov rcx, qword [rsi]
cmp dword [rcx + 8], 3
mov ecx, 3
cmovge r13d, ecx
mov dword [rax], r13d
mov rax, r12
mov rbp, qword [rsp + 0x150]
mov rdi, qword [rsp + 0x148]
mov r15, qword [rsp + 0x138]
mov rbx, qword [rsp + 0x158]
mov r13, qword [rsp + 0x140]
add rsp, 0x160
pop r14
pop r12
pop rsi
ret
mov rcx, qword [rsi]
jmp 0x1400476de
xor r12d, r12d
movsxd rbx, dword [rcx + 8]
test rbx, rbx
jle 0x140047738
add rsi, 0x46d8
nop
mov rcx, qword [rsi]
test rcx, rcx
je 0x140047705
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rsi], r12
mov qword [rsi - 8], r12
mov rcx, qword [rsi + 8]
test rcx, rcx
je 0x14004771c
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rsi + 8], r12
mov qword [rsi + 0x18], r12
mov rcx, qword [rsi + 0x10]
test rcx, rcx
je 0x14004772f
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rsi + 0x10], r12
add rsi, 0x60
sub rbx, r13
jne 0x1400476f0
mov edx, dword [0x1402ff1e8]
mov rax, qword gs:[0x58]
mov ecx, 0x20
mov rax, qword [rax + rdx*8]
lea rdx, str.outofmem
mov qword [rcx + rax], rdx
xor eax, eax
jmp 0x1400476a1
mov edx, dword [0x1402ff1e8]
mov rax, qword gs:[0x58]
mov ecx, 0x20
mov rax, qword [rax + rdx*8]
lea rdx, str.bad_req_comp
mov qword [rcx + rax], rdx
xor eax, eax
add rsp, 0x160
pop r14
pop r12
pop rsi
ret