Function at 0x180037990
Capabilities:
Encode data using xor
Encrypt data using rc4 ksa

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x40
mov rax, qword [0x180185680]
xor rax, rsp
mov qword [rsp + 0x38], rax
movzx r12d, byte [rcx]
mov r8d, 7
mov ebp, edx
mov dword [rsp + 0x24], edx
mov r14, rcx
mov dword [rsp + 0x28], r12d
lea esi, [r12 - 7]
cmp esi, r8d
jle 0x180037a31
nop word [rax + rax]
movzx eax, byte [r14]
imul eax, r8d
add eax, 6
movsxd rcx, eax
mov edx, eax
sar rcx, 3
and edx, 7
mov eax, 0xff
btc eax, edx
and byte [rcx + r14 + 1], al
movzx eax, byte [r14]
lea ecx, [rax + rax*2]
lea eax, [r8 + rcx*2]
add r8d, 2
movsxd rcx, eax
mov edx, eax
sar rcx, 3
and edx, 7
mov eax, 0xff
btc eax, edx
and byte [rcx + r14 + 1], al
cmp r8d, esi
jl 0x1800379e0
mov r11d, 0xffffffff
nop word [rax + rax]
lea eax, [r11 - 3]
mov r10d, 0xffffffff
cdq
mov edi, eax
xor edi, edx
sub edi, edx
lea ebx, [r10 - 3]
mov eax, ebx
cdq
xor eax, edx
sub eax, edx
cmp edi, eax
cmovg eax, edi
add eax, 0xfffffffe
test eax, 0xfffffffd
jne 0x180037af9
movzx ecx, byte [r14]
movzx eax, cl
test r10d, r10d
js 0x180037a9f
cmp r10d, ecx
jge 0x180037a9f
test r11d, r11d
js 0x180037a9f
cmp r11d, ecx
jge 0x180037a9f
xor r9d, r9d
mov r8d, r11d
mov edx, r10d
mov rcx, r14
call fcn.180039190
movzx eax, byte [r14]
lea edx, [r12 - 4]
movzx r8d, al
add edx, ebx
movzx ecx, al
js 0x180037ad0
cmp edx, r8d
jge 0x180037ad0
test r11d, r11d
js 0x180037ad0
cmp r11d, r8d
jge 0x180037ad0
xor r9d, r9d
mov r8d, r11d
mov rcx, r14
call fcn.180039190
movzx ecx, byte [r14]
movzx eax, cl
test r10d, r10d
js 0x180037af9
cmp r10d, eax
jge 0x180037af9
lea r8d, [r11 + rsi]
test r8d, r8d
js 0x180037af9
cmp r8d, eax
jge 0x180037af9
xor r9d, r9d
mov edx, r10d
mov rcx, r14
call fcn.180039190
inc r10d
lea eax, [r10 - 3]
cmp eax, 4
jle 0x180037a51
inc r11d
lea eax, [r11 - 3]
cmp eax, 4
jle 0x180037a40
xor r13d, r13d
cmp ebp, 1
jne 0x180037b26
mov r15d, r13d
jmp 0x180037b96
mov eax, 0x92492493
imul ebp
add edx, ebp
sar edx, 2
mov r15d, edx
shr r15d, 0x1f
add r15d, 2
add r15d, edx
cmp ebp, 0x20
jne 0x180037b4a
lea eax, [rbp - 6]
jmp 0x180037b62
lea eax, [r15 + rbp*2]
lea eax, [rax*2 + 1]
cdq
lea ecx, [r15*2 - 2]
idiv ecx
add eax, eax
lea ecx, [r15 - 1]
movsxd rdx, ecx
lea r8d, [rbp*4 + 0xa]
cmp rdx, 1
jl 0x180037b91
nop word [rax + rax]
mov byte [rsp + rdx + 0x2c], r8b
dec rdx
sub r8d, eax
cmp rdx, 1
jge 0x180037b80
mov byte [rsp + 0x2c], 6
movsxd rdx, r15d
mov ecx, r13d
mov dword [rsp + 0x20], ecx
test r15d, r15d
jle 0x180037d41
mov r12, r13
nop dword [rax]
mov ebp, r13d
mov rsi, r13
test r12, r12
jne 0x180037bd2
test rsi, rsi
je 0x180037d18
lea eax, [r15 - 1]
cmp ebp, eax
je 0x180037d18
jmp 0x180037bd6
lea eax, [r15 - 1]
cmp ecx, eax
jne 0x180037be3
test rsi, rsi
je 0x180037d18
mov r11d, 0xffffffff
nop dword [rax]
movzx edi, byte [rsp + rsi + 0x2c]
mov eax, 0xffffffff
movzx ebx, byte [rsp + r12 + 0x2c]
add edi, r11d
test eax, eax
jne 0x180037c10
test r11d, r11d
jne 0x180037c10
mov dl, 1
jmp 0x180037c12
xor dl, dl
movzx ecx, byte [r14]
imul ecx, edi
add ecx, ebx
add ecx, eax
movsxd r10, ecx
mov r8d, ecx
sar r10, 3
and r8d, 7
movzx r9d, byte [r10 + r14 + 1]
test dl, dl
je 0x180037c3f
movzx ecx, r9b
bts ecx, r8d
jmp 0x180037c4b
mov ecx, 0xff
btc ecx, r8d
and cl, r9b
mov byte [r10 + r14 + 1], cl
lea ecx, [rax + 1]
test ecx, ecx
jne 0x180037c61
test r11d, r11d
jne 0x180037c61
mov r8b, 1
jmp 0x180037c64
xor r8b, r8b
movzx ecx, byte [r14]
lea edx, [rax + 1]
imul ecx, edi
add ecx, ebx
add edx, ecx
movsxd r10, edx
mov r9d, edx
sar r10, 3
and r9d, 7
movzx edx, byte [r10 + r14 + 1]
test r8b, r8b
je 0x180037c94
movzx ecx, dl
bts ecx, r9d
jmp 0x180037c9f
mov ecx, 0xff
btc ecx, r9d
and cl, dl
mov byte [r10 + r14 + 1], cl
lea ecx, [rax + 2]
test ecx, ecx
jne 0x180037cb5
test r11d, r11d
jne 0x180037cb5
mov r8b, 1
jmp 0x180037cb8
xor r8b, r8b
movzx ecx, byte [r14]
lea edx, [rax + 2]
imul ecx, edi
add ecx, ebx
add edx, ecx
movsxd r10, edx
mov r9d, edx
sar r10, 3
and r9d, 7
movzx edx, byte [r10 + r14 + 1]
test r8b, r8b
je 0x180037ce8
movzx ecx, dl
bts ecx, r9d
jmp 0x180037cf3
mov ecx, 0xff
btc ecx, r9d
and cl, dl
add eax, 3
mov byte [r10 + r14 + 1], cl
cmp eax, 1
jle 0x180037c03
inc r11d
cmp r11d, 1
jle 0x180037bf0
mov ecx, dword [rsp + 0x20]
movsxd rdx, r15d
inc ebp
inc rsi
cmp rsi, rdx
jl 0x180037bb6
inc ecx
inc r12
mov dword [rsp + 0x20], ecx
cmp r12, rdx
jl 0x180037bb0
mov ebp, dword [rsp + 0x24]
mov r12d, dword [rsp + 0x28]
cmp ebp, 7
jl 0x180037f13
mov edx, ebp
mov r8d, 0xc
nop dword [rax]
nop word [rax + rax]
mov eax, edx
sar eax, 0xb
imul ecx, eax, 0x1f25
lea eax, [rdx + rdx]
xor ecx, eax
mov edx, ecx
sub r8, 1
jne 0x180037d60
shl ebp, 0xc
lea r10d, [r12 - 0xb]
or ebp, ecx
lea r11d, [r12 - 0xa]
lea ebx, [r12 - 9]
nop dword [rax]
movzx eax, byte [r14]
lea ecx, [r12 - 0xb]
imul eax, r13d
movzx r8d, bpl
add ecx, eax
movsxd r9, ecx
mov edx, ecx
sar r9, 3
and edx, 7
movzx ecx, byte [r9 + r14 + 1]
and r8b, 1
je 0x180037dc3
movzx eax, cl
bts eax, edx
jmp 0x180037dcd
mov eax, 0xff
btc eax, edx
and al, cl
mov byte [r9 + r14 + 1], al
movzx eax, byte [r14]
imul eax, r10d
add eax, r13d
movsxd r9, eax
mov ecx, eax
sar r9, 3
and ecx, 7
movzx edx, byte [r9 + r14 + 1]
test r8b, r8b
je 0x180037dfc
movzx eax, dl
bts eax, ecx
jmp 0x180037e06
mov eax, 0xff
btc eax, ecx
and al, dl
mov byte [r9 + r14 + 1], al
lea ecx, [r12 - 0xa]
movzx eax, byte [r14]
imul eax, r13d
sar ebp, 1
movzx r8d, bpl
add ecx, eax
movsxd r9, ecx
mov edx, ecx
sar r9, 3
and edx, 7
movzx ecx, byte [r9 + r14 + 1]
and r8b, 1
je 0x180037e40
movzx eax, cl
bts eax, edx
jmp 0x180037e4a
mov eax, 0xff
btc eax, edx
and al, cl
mov byte [r9 + r14 + 1], al
movzx eax, byte [r14]
imul eax, r11d
add eax, r13d
movsxd r9, eax
mov ecx, eax
sar r9, 3
and ecx, 7
movzx edx, byte [r9 + r14 + 1]
test r8b, r8b
je 0x180037e79
movzx eax, dl
bts eax, ecx
jmp 0x180037e83
mov eax, 0xff
btc eax, ecx
and al, dl
mov byte [r9 + r14 + 1], al
lea ecx, [r12 - 9]
movzx eax, byte [r14]
imul eax, r13d
sar ebp, 1
movzx r8d, bpl
add ecx, eax
movsxd r9, ecx
mov edx, ecx
sar r9, 3
and edx, 7
movzx ecx, byte [r9 + r14 + 1]
and r8b, 1
je 0x180037ebd
movzx eax, cl
bts eax, edx
jmp 0x180037ec7
mov eax, 0xff
btc eax, edx
and al, cl
mov byte [r9 + r14 + 1], al
movzx eax, byte [r14]
imul eax, ebx
add eax, r13d
movsxd r9, eax
mov ecx, eax
sar r9, 3
and ecx, 7
movzx edx, byte [r9 + r14 + 1]
test r8b, r8b
je 0x180037ef5
movzx eax, dl
bts eax, ecx
jmp 0x180037eff
mov eax, 0xff
btc eax, ecx
and al, dl
sar ebp, 1
inc r13d
mov byte [r9 + r14 + 1], al
cmp r13d, 6
jl 0x180037d90
mov rcx, qword [rsp + 0x38]
xor rcx, rsp
call fcn.18010faf0
mov rbx, qword [rsp + 0x90]
add rsp, 0x40
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret