Function at 0x1800d5940
Capabilities:
Encrypt data using rc4 prga

Disassembly:
mov dword [rsp + 0x20], r9d
mov qword [rsp + 0x10], rdx
push rdi
push r12
push r14
push r15
sub rsp, 0x48
cmp dword [rdx], 0
mov r12d, r9d
mov r14, r8
mov r15, rdx
mov rdi, rcx
je 0x1800d5c45
cmp dword [rdx + 4], 0
je 0x1800d5c45
mov r8, qword [r8]
mov edx, dword [r8]
cmp edx, 0x10000000
jae 0x1800d5c45
mov r9, qword [r14 + 8]
mov ecx, dword [r9]
cmp ecx, 0x10000000
jae 0x1800d5c45
mov qword [rsp + 0x40], rbp
mov r10d, edx
mov qword [rsp + 0x38], rsi
mov ebp, pe_nt_image_headers64
xor esi, esi
mov qword [rsp + 0x70], rbx
mov qword [rsp + 0x30], r13
and r10d, 0x800000
je 0x1800d59c7
cmp dword [r8 + 4], 8
je 0x1800d59de
mov r11d, ecx
and r11d, 0x800000
je 0x1800d5a5c
cmp dword [r9 + 4], 8
jne 0x1800d5a5c
mov ebx, 0x16
mov dword [rsp + 0x20], reloc.WS2_32.dll_inet_ntoa
mov ebp, 2
mov rsi, r15
mov r15d, 0x800
mov r12d, 0x5b00
lea r13d, [rbp + 0x7e]
mov edx, dword [rsi]
mov ecx, edx
shr ecx, 0x18
and ecx, 0x1f
lea eax, [rcx - 0xd]
cmp eax, 1
jbe 0x1800d5aef
lea eax, [rcx - 0x15]
cmp eax, 1
jbe 0x1800d5b23
mov rax, qword [r14]
mov ecx, dword [rax]
movzx eax, bx
shr ecx, 0xc
not cx
shl ax, 5
and cx, r15w
or cx, ax
movzx eax, bx
or cx, 0x13
or ax, r12w
mov word [rdi + 0xba], cx
mov word [rdi + 0xbc], ax
jmp 0x1800d5b12
mov dword [rsp + 0x20], inet_ntoa
mov ebx, 0x15
cmp r12d, 0xa
jge 0x1800d59eb
mov eax, ecx
or eax, edx
bt eax, 0x1a
jb 0x1800d59eb
cmp dword [r8 + 4], 4
jne 0x1800d59eb
cmp dword [r9 + 4], 4
jne 0x1800d59eb
xor ecx, edx
bt ecx, 0x17
jae 0x1800d5ae2
movzx eax, word [r15 + 4]
mov edx, 0x8000
cmp ax, dx
jae 0x1800d5ab9
mov ecx, eax
mov rax, qword [rdi + 0x20]
cmp dword [rax + rcx*8], esi
jge 0x1800d5ae2
movzx eax, word [r15]
cmp ax, dx
jae 0x1800d59eb
mov ecx, eax
mov rax, qword [rdi + 0x20]
cmp dword [rax + rcx*8], esi
jl 0x1800d59eb
test r11d, r11d
mov ebx, esi
setne bl
add ebx, 0x13
jmp 0x1800d5b58
test r10d, r10d
mov ebx, esi
setne bl
add ebx, 0x13
jmp 0x1800d5b58
movzx eax, bx
or ax, r12w
mov word [rdi + 0xbc], ax
movzx eax, bx
or ax, r13w
shl ax, 5
or ax, cx
mov word [rdi + 0xba], ax
mov rcx, rdi
mov word [rdi + 0xb8], dx
call fcn.1800cc0b0
mov dword [rsi], eax
add r14, 8
add rsi, 4
sub rbp, 1
jne 0x1800d5a03
mov r12d, dword [rsp + 0x88]
mov r15, qword [rsp + 0x78]
mov r13d, dword [rsp + 0x20]
cmp r12d, 0xa
jge 0x1800d5bd5
xor esi, esi
mov ebp, pe_nt_image_headers64
cmp r12d, 4
jne 0x1800d5b65
lea edx, [r12 + 4]
jmp 0x1800d5b7e
cmp r12d, 6
lea eax, [rbx - 0x14]
mov edx, 2
cmove edx, esi
test eax, 0xfffffffd
jne 0x1800d5b7e
add edx, 4
movzx eax, word [r15]
movzx ecx, word [r15 + 4]
shl dx, 8
or dx, bx
mov word [rdi + 0xb8], ax
or dx, bp
mov word [rdi + 0xba], cx
mov word [rdi + 0xbc], dx
mov eax, 0x2007ffd
mov dword [rdi + 0x174], 2
mov rbx, qword [rsp + 0x70]
mov r13, qword [rsp + 0x30]
mov rbp, qword [rsp + 0x40]
mov rsi, qword [rsp + 0x38]
add rsp, 0x48
pop r15
pop r14
pop r12
pop rdi
ret
movzx r9d, word [r15 + 4]
mov eax, 0x100
movzx r8d, word [r15]
add r12w, 0x1f
movzx ecx, r12w
imul ecx, eax
mov word [rdi + 0xb8], r8w
mov word [rdi + 0xba], r9w
or cx, bx
mov word [rdi + 0xbc], cx
mov rcx, rdi
call fcn.1800cc0b0
mov edx, r13d
mov rcx, rdi
mov ebx, eax
call fcn.1800c2a50
mov ecx, 0x548a
mov word [rdi + 0xb8], ax
mov word [rdi + 0xbc], cx
mov rcx, rdi
mov word [rdi + 0xba], bx
call fcn.1800cc0b0
jmp 0x1800d5bb5
xor eax, eax
add rsp, 0x48
pop r15
pop r14
pop r12
pop rdi
ret