Function at 0x1400fa040
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov qword [rsp + 0x18], rbx
mov qword [rsp + 0x10], rdx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x80
mov rax, qword [rcx + 0xb8]
mov r15, r9
mov r13, r8
mov rbx, rcx
cmp rax, qword [rcx + 0xc0]
jae 0x1400fa084
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400fa0a7
cmp dword [rcx + 0x30], 0
je 0x1400fa0a5
call fcn.1400ef9e0
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400fa0a7
xor cl, cl
movzx eax, cl
mov dword [rsp + 0x58], eax
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x1400fa0cd
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400fa0f3
cmp dword [rbx + 0x30], 0
je 0x1400fa0f1
mov rcx, rbx
call fcn.1400ef9e0
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400fa0f3
xor cl, cl
movzx eax, cl
mov dword [rsp + 0x38], eax
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x1400fa119
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400fa13f
cmp dword [rbx + 0x30], 0
je 0x1400fa13d
mov rcx, rbx
call fcn.1400ef9e0
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400fa13f
xor cl, cl
movzx ebp, cl
xor esi, esi
mov rcx, rbx
mov dword [rsp + 0xe8], esi
call fcn.1400efc60
mov rcx, rbx
mov dword [rsp + 0x60], eax
call fcn.1400efc60
mov rcx, qword [rbx + 0xb8]
mov dword [rsp + 0x3c], eax
cmp rcx, qword [rbx + 0xc0]
jae 0x1400fa182
movzx edx, byte [rcx]
inc rcx
mov qword [rbx + 0xb8], rcx
jmp 0x1400fa1a7
cmp dword [rbx + 0x30], esi
je 0x1400fa1a5
mov rcx, rbx
call fcn.1400ef9e0
mov rax, qword [rbx + 0xb8]
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400fa1a7
xor dl, dl
mov rcx, rbx
movzx r14d, dl
call fcn.1400efc60
mov rcx, rbx
call fcn.1400efc60
mov rcx, rbx
call fcn.1400efc60
mov rcx, rbx
mov dword [rsp + 0x30], eax
call fcn.1400efc60
mov rcx, qword [rbx + 0xb8]
mov dword [rsp + 0x34], eax
cmp rcx, qword [rbx + 0xc0]
jae 0x1400fa1f2
movzx edx, byte [rcx]
inc rcx
mov qword [rbx + 0xb8], rcx
jmp 0x1400fa217
cmp dword [rbx + 0x30], esi
je 0x1400fa215
mov rcx, rbx
call fcn.1400ef9e0
mov rax, qword [rbx + 0xb8]
movzx edx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400fa217
xor dl, dl
mov rax, qword [rbx + 0xb8]
movzx edx, dl
mov dword [rsp + 0x48], edx
cmp rax, qword [rbx + 0xc0]
jae 0x1400fa23d
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400fa266
cmp dword [rbx + 0x30], esi
je 0x1400fa264
mov rcx, rbx
call fcn.1400ef9e0
mov rax, qword [rbx + 0xb8]
mov edx, dword [rsp + 0x48]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400fa266
xor cl, cl
movzx eax, cl
mov r12d, esi
xor ecx, ecx
mov qword [rsp + 0x68], rsi
mov byte [rsp + 0xc0], sil
mov word [rsp + 0xc1], cx
mov byte [rsp + 0xc3], cl
lea edi, [rcx + 1]
cmp ebp, 8
jb 0x1400fa29c
sub ebp, 8
mov dword [rsp + 0xe8], edi
shr eax, 5
mov ecx, edi
and eax, edi
mov dword [rsp + 0xe0], esi
sub ecx, eax
mov dword [rsp + 0x4c], ecx
cmp dword [rsp + 0x38], esi
je 0x1400fa2d3
mov ecx, r14d
sub ecx, 8
je 0x1400fa32b
sub ecx, 7
je 0x1400fa31c
sub ecx, edi
je 0x1400fa31c
sub ecx, 8
je 0x1400fa2f0
cmp ecx, 8
jne 0x1400fa2f9
jmp 0x1400fa2f0
mov ecx, edx
sub ecx, 8
je 0x1400fa32b
sub ecx, 7
je 0x1400fa31c
sub ecx, edi
je 0x1400fa311
sub ecx, 8
je 0x1400fa2ed
cmp ecx, 8
jne 0x1400fa2f9
mov r14d, edx
shr r14d, 3
test r14d, r14d
jne 0x1400fa32e
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.bad_format
jmp 0x1400fa982
cmp ebp, 3
jne 0x1400fa31c
lea r14d, [rbp - 1]
jmp 0x1400fa32e
mov r14d, 3
mov dword [rsp + 0xe0], edi
jmp 0x1400fa32e
mov r14d, edi
mov rax, qword [rsp + 0xc8]
mov r10d, dword [rsp + 0x30]
mov dword [rax], r10d
mov eax, dword [rsp + 0x34]
mov dword [r13], eax
test r15, r15
je 0x1400fa34e
mov dword [r15], r14d
test r10d, r10d
js 0x1400fa96f
mov r13d, eax
test eax, eax
js 0x1400fa96f
test eax, eax
je 0x1400fa37f
mov eax, 0x7fffffff
mov ecx, esi
cdq
idiv r13d
cmp r10d, eax
setle cl
test ecx, ecx
je 0x1400fa96f
mov r8d, r13d
imul r8d, r10d
mov dword [rsp + 0x50], r8d
test r8d, r8d
js 0x1400fa96f
xor edx, edx
mov eax, 0x7fffffff
div r14d
mov ecx, esi
cmp r8d, eax
mov ebp, eax
setle cl
test ecx, ecx
je 0x1400fa96f
xor r9d, r9d
mov r8d, r14d
mov edx, r13d
mov ecx, r10d
call fcn.1400ef1b0
test eax, eax
je 0x1400fa95a
mov eax, r14d
imul eax, r13d
imul eax, dword [rsp + 0x30]
movsxd rcx, eax
call fcn.140280918
mov qword [rsp + 0x40], rax
mov r15, rax
test rax, rax
je 0x1400fa95a
mov edx, dword [rsp + 0x58]
mov rcx, rbx
call fcn.1400efa50
cmp dword [rsp + 0x38], esi
jne 0x1400fa475
mov ecx, dword [rsp + 0xe8]
test ecx, ecx
jne 0x1400fa577
mov eax, dword [rsp + 0xe0]
test eax, eax
jne 0x1400fa577
test r13d, r13d
jle 0x1400fa8f6
mov ecx, dword [rsp + 0x30]
lea edi, [r13 - 1]
movsxd r15, dword [rsp + 0x4c]
mov ebp, r14d
mov r12, qword [rsp + 0x40]
imul ebp, ecx
nop
mov eax, esi
test r15, r15
mov r8d, ebp
cmovne eax, edi
imul eax, r14d
imul eax, ecx
mov rcx, rbx
movsxd rdx, eax
add rdx, r12
call fcn.1400efab0
mov ecx, dword [rsp + 0x30]
inc esi
dec edi
cmp esi, r13d
jl 0x1400fa440
mov r15, r12
jmp 0x1400fa8ef
mov edx, dword [rsp + 0x60]
mov rcx, rbx
call fcn.1400efa50
mov ecx, dword [rsp + 0x3c]
test ecx, ecx
js 0x1400fa952
cmp ecx, ebp
mov eax, esi
setle al
test eax, eax
je 0x1400fa952
mov ebp, r14d
imul ebp, ecx
movsxd rcx, ebp
call fcn.140280918
mov qword [rsp + 0x68], rax
test rax, rax
je 0x1400fa952
cmp dword [rsp + 0xe0], esi
je 0x1400fa5e0
mov r15, rax
mov eax, dword [rsp + 0x3c]
test eax, eax
jle 0x1400fa56b
mov r13d, r14d
mov ebp, eax
nop dword [rax]
mov rcx, rbx
call fcn.1400efc60
movzx r8d, ax
mov eax, r8d
shr eax, 0xa
and eax, 0x1f
imul ecx, eax, 0xff
mov eax, 0x84210843
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, r8d
shr eax, 5
and r8d, 0x1f
and eax, 0x1f
mov byte [r15], dl
imul ecx, eax, 0xff
mov eax, 0x84210843
imul ecx
add edx, ecx
imul ecx, r8d, 0xff
sar edx, 4
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, 0x84210843
mov byte [r15 + 1], dl
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add edx, eax
mov byte [r15 + 2], dl
add r15, r13
sub rbp, 1
jne 0x1400fa4e0
mov r13d, dword [rsp + 0x34]
mov r15, qword [rsp + 0x40]
mov ecx, dword [rsp + 0xe8]
mov eax, dword [rsp + 0x50]
mov ebp, r14d
test eax, eax
jle 0x1400fa85c
movsxd r11, r14d
mov r8, r15
mov r10, r11
mov qword [rsp + 0x60], r15
neg r10
mov qword [rsp + 0x58], rax
mov qword [rsp + 0x78], r10
neg r15
mov r9d, eax
mov r13d, esi
nop word [rax + rax]
test ecx, ecx
je 0x1400fa666
test r12d, r12d
jne 0x1400fa659
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x1400fa620
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400fa645
mov r8d, ebp
mov rdx, rax
mov rcx, rbx
call fcn.1400efab0
test eax, eax
jne 0x1400fa570
mov rcx, r15
call fcn.1402804a8
mov rcx, qword [rsp + 0x68]
call fcn.1402804a8
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.bad_palette
jmp 0x1400fa982
cmp dword [rbx + 0x30], esi
je 0x1400fa643
mov rcx, rbx
call fcn.1400ef9e0
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400fa645
xor cl, cl
movzx r13d, cl
mov r12d, r13d
and r12d, 0x7f
inc r12d
shr r13d, 7
jmp 0x1400fa666
test r13d, r13d
je 0x1400fa666
test edi, edi
je 0x1400fa807
cmp dword [rsp + 0x38], esi
je 0x1400fa6ff
cmp dword [rsp + 0x48], 8
jne 0x1400fa6c6
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x1400fa699
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
movzx eax, cl
jmp 0x1400fa6ce
cmp dword [rbx + 0x30], esi
je 0x1400fa6bf
mov rcx, rbx
call fcn.1400ef9e0
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
movzx eax, cl
jmp 0x1400fa6ce
xor cl, cl
movzx eax, cl
jmp 0x1400fa6ce
mov rcx, rbx
call fcn.1400efc60
cmp eax, dword [rsp + 0x3c]
cmovge eax, esi
test r14d, r14d
je 0x1400fa7f3
imul eax, r14d
lea rcx, [rsp + 0xc0]
mov r8, rbp
movsxd rdx, eax
add rdx, qword [rsp + 0x68]
call fcn.140278ed0
jmp 0x1400fa7f3
cmp dword [rsp + 0xe0], esi
je 0x1400fa791
mov rcx, rbx
call fcn.1400efc60
movzx r8d, ax
mov eax, r8d
shr eax, 0xa
and eax, 0x1f
imul ecx, eax, 0xff
mov eax, 0x84210843
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, r8d
shr eax, 5
and r8d, 0x1f
and eax, 0x1f
mov byte [rsp + 0xc0], dl
imul ecx, eax, 0xff
mov eax, 0x84210843
imul ecx
add edx, ecx
imul ecx, r8d, 0xff
sar edx, 4
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, 0x84210843
mov byte [rsp + 0xc1], dl
imul ecx
add edx, ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add edx, eax
mov byte [rsp + 0xc2], dl
jmp 0x1400fa7f3
mov rdi, rsi
test r14d, r14d
je 0x1400fa7f3
nop dword [rax]
mov rax, qword [rbx + 0xb8]
cmp rax, qword [rbx + 0xc0]
jae 0x1400fa7bf
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400fa7e4
cmp dword [rbx + 0x30], esi
je 0x1400fa7e2
mov rcx, rbx
call fcn.1400ef9e0
mov rax, qword [rbx + 0xb8]
movzx ecx, byte [rax]
inc rax
mov qword [rbx + 0xb8], rax
jmp 0x1400fa7e4
xor cl, cl
mov byte [rsp + rdi + 0xc0], cl
inc rdi
cmp rdi, rbp
jl 0x1400fa7a0
mov r8, qword [rsp + 0x60]
mov edi, esi
mov r9, qword [rsp + 0x58]
mov r10, qword [rsp + 0x78]
movsxd r11, r14d
test r14d, r14d
je 0x1400fa833
lea rdx, [rsp + 0xc0]
mov rcx, r8
add rdx, r15
nop word [rax + rax]
movzx eax, byte [rdx + rcx]
mov byte [rcx], al
lea rcx, [rcx + 1]
lea rax, [r15 + rcx]
cmp rax, rbp
jl 0x1400fa820
mov ecx, dword [rsp + 0xe8]
add r8, r11
dec r12d
mov qword [rsp + 0x60], r8
add r15, r10
sub r9, 1
mov qword [rsp + 0x58], r9
jne 0x1400fa5b0
mov r13d, dword [rsp + 0x34]
cmp dword [rsp + 0x4c], esi
je 0x1400fa8d8
test r13d, r13d
jle 0x1400fa8d8
mov r12, qword [rsp + 0x40]
lea r10d, [r13 - 1]
mov ebx, r14d
imul r10d, r14d
imul ebx, dword [rsp + 0x30]
mov r11d, esi
mov edi, ebx
neg edi
imul r10d, dword [rsp + 0x30]
nop dword [rax]
mov r8d, ebx
test ebx, ebx
jle 0x1400fa8ca
movsxd rax, r11d
movsxd r9, r10d
sub r9, rax
lea rdx, [rax + r12]
nop dword [rax]
nop dword [rax + rax]
movzx eax, byte [rdx + r9]
dec r8d
movzx ecx, byte [rdx]
mov byte [rdx], al
mov byte [rdx + r9], cl
lea rdx, [rdx + 1]
test r8d, r8d
jg 0x1400fa8b0
add r11d, ebx
add r10d, edi
add esi, 2
cmp esi, r13d
jl 0x1400fa890
mov rax, qword [rsp + 0x68]
test rax, rax
je 0x1400fa8ea
mov rcx, rax
call fcn.1402804a8
mov r15, qword [rsp + 0x40]
mov eax, dword [rsp + 0xe0]
cmp r14d, 3
jb 0x1400fa929
test eax, eax
jne 0x1400fa929
mov eax, dword [rsp + 0x50]
mov r8, r15
test eax, eax
jle 0x1400fa929
mov r9d, r14d
mov edx, eax
movzx ecx, byte [r8]
movzx eax, byte [r8 + 2]
mov byte [r8], al
mov byte [r8 + 2], cl
add r8, r9
sub rdx, 1
jne 0x1400fa910
cmp r14d, 4
je 0x1400fa94d
mov r9d, dword [rsp + 0x30]
mov r8d, 4
mov edx, r14d
mov dword [rsp + 0x20], r13d
mov rcx, r15
call fcn.1400efd10
mov r15, rax
mov rax, r15
jmp 0x1400fa98d
mov rcx, r15
call fcn.1402804a8
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, str.outofmem
jmp 0x1400fa982
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
lea rax, [0x14035a8a8]
mov edx, reloc.WS2_32.dll_recv
mov qword [rdx + rcx], rax
xor eax, eax
mov rbx, qword [rsp + 0xd0]
add rsp, 0x80
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret