Function at 0x487b60
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
mov rax, rsp
sub rsp, 0xf8
mov r10, qword [rcx]
mov rdx, qword [rcx + 8]
mov qword [rax + 0x18], rbx
mov qword [rax - 8], rsi
mov qword [rax - 0x18], r12
mov qword [rax - 0x20], r13
mov word [rsp + 0x24], 0xffff
mov qword [rax - 0x28], r14
mov r14, qword [rcx + 0x18]
movzx r8d, byte [r14 + 0x10]
mov qword [rax - 0x30], r15
mov rax, qword [r10 + 8]
imul r8, r8, 0x78
mov r15, qword [r8 + rax + 0x78]
mov rbx, qword [r8 + rax + 0x28]
lea r12, [r8 + rax + 8]
mov r9d, 1
xor r13d, r13d
test r15, r15
mov rsi, rcx
mov qword [rsp + 0x48], r10
mov dword [rsp + 0x20], r9d
mov qword [rsp + 0x28], r12
mov qword [rsp + 0x40], rbx
mov qword [rsp + 0x30], rdx
jne 0x487c81
test byte [rbx + 0x48], 0x20
je 0x487bf7
mov r15, qword [rbx + 0x10]
jmp 0x487c81
xor edx, edx
lea rcx, [rsp + 0x50]
lea r8d, [rdx + 0x68]
call sub.msvcrt.dll_memset
mov word [rsp + 0xae], 1
mov word [rsp + 0xb0], 1
mov byte [rsp + 0xb2], 5
mov qword [rsp + 0x68], rbx
lea rax, [rsp + 0x24]
mov qword [rsp + 0x58], rax
lea rax, [rsp + 0x38]
mov qword [rsp + 0x60], rax
movzx eax, word [rbx + 0x46]
mov word [rsp + 0xac], ax
movzx eax, word [rbx + 0x38]
mov word [rsp + 0x3a], r13w
mov word [rsp + 0x38], ax
test byte [r12 + 0x40], 1
jne 0x487c6d
mov rax, qword [r12 + 0x20]
mov rcx, qword [rax + 0x10]
mov qword [rsp + 0x78], rcx
mov rdx, qword [rsp + 0x30]
mov r9d, dword [rsp + 0x20]
mov r10, qword [rsp + 0x48]
lea r15, [rsp + 0x50]
mov qword [rsp + 0x118], rbp
movzx ebp, word [rbx + 0x38]
lea r8, [0x00400000]
cmp bp, 0xa
mov qword [rsp + 0xe8], rdi
jg 0x487caa
xor di, di
jmp 0x487d24
movsx rax, bp
mov cx, Ordinal_41
cmp rax, 8
jae 0x487cd2
cmp rax, 2
jae 0x487cc3
xor di, di
jmp 0x487d20
add rax, rax
add cx, 0xfff6
cmp rax, 8
jb 0x487cc3
jmp 0x487d0d
cmp rax, 0xff
jbe 0x487cf0
nop
nop
shr rax, 4
add cx, 0x28
cmp rax, 0xff
ja 0x487ce0
cmp rax, 0xf
jbe 0x487d0d
nop
nop
nop
shr rax, 1
add cx, 0xa
cmp rax, 0xf
ja 0x487d00
and eax, 7
movzx edi, word [r8 + rax*2 + 0x32d468]
add di, cx
sub di, 0xa
sub di, 0x21
cmp qword [rsi + 0x20], r13
jne 0x487e6c
mov rax, qword [r10]
mov rcx, qword [rax]
bt dword [rcx + 0x2c], 0x14
jae 0x487e6c
cmp qword [r12 + 0x70], r13
jne 0x487e6c
mov eax, dword [r12 + 0x40]
test al, 4
jne 0x487e6c
test al, 1
jne 0x487e6c
test byte [rbx + 0x48], 0x20
jne 0x487e6c
test al, 2
jne 0x487e6c
test al, 8
jne 0x487e6c
movsxd rsi, dword [rdx + 0x14]
mov rbx, qword [rdx + 0x20]
imul rsi, rsi, 0x38
add rsi, rbx
nop
nop
cmp rbx, rsi
jae 0x487e59
mov rax, qword [r14 + 8]
test qword [rbx + 0x28], rax
jne 0x487e47
xor r8d, r8d
mov rdx, r12
mov rcx, rbx
call fcn.004565e0
test eax, eax
je 0x487e47
mov rax, qword [r14 + 0x30]
mov rcx, qword [rsp + 0x40]
mov word [r14 + 0x18], 1
mov word [r14 + 0x1a], 0
mov qword [r14 + 0x20], 0
mov word [r14 + 0x2c], 1
mov qword [rax], rbx
lea eax, [rbp + rdi + 4]
mov word [r14 + 0x12], ax
cmp qword [rcx + 0x18], 0
jne 0x487e05
test byte [rcx + 0x48], 2
jne 0x487e05
add ax, 0x18
mov word [r14 + 0x12], ax
mov dx, Ordinal_46
movzx ecx, di
mov word [r14 + 0x16], Ordinal_46
call fcn.00427200
mov rcx, qword [rsp + 0x100]
mov dword [r14 + 0x28], 0x4000
mov word [r14 + 0x14], ax
mov rax, qword [rbx + 0x28]
mov rdx, r14
or rax, qword [rsp + 0x108]
mov qword [r14], rax
call fcn.0044c560
mov r13d, eax
add rbx, 0x38
test r13d, r13d
je 0x487d90
jmp 0x4882a9
test r13d, r13d
jne 0x4882a9
mov rdx, qword [rsp + 0x30]
mov r9d, dword [rsp + 0x20]
mov ebp, 0x240
test r15, r15
je 0x4882a9
mov rbx, qword [r15 + 0x48]
test rbx, rbx
je 0x487f52
mov ebp, dword [r12 + 0x48]
mov r12, qword [rdx + 0x20]
xor esi, esi
cmp dword [rdx + 0x14], esi
jle 0x4882f4
nop
nop
mov rdi, qword [r12]
mov r8d, ebp
mov rdx, rbx
mov rcx, rdi
call fcn.00446190
test eax, eax
je 0x487f24
cmp byte [rbx], 0x47
jne 0x487ee1
mov rdx, qword [rbx + 0x10]
mov r8d, ebp
mov rcx, rdi
call fcn.00446350
test eax, eax
jne 0x487f3c
mov rdx, qword [rbx + 0x18]
mov r8d, ebp
mov rcx, rdi
call fcn.00446350
test eax, eax
jne 0x487f30
cmp byte [rbx], 0x4d
jne 0x487f05
mov rdx, qword [rbx + 0x10]
mov rcx, qword [rdi + 0x10]
mov r8d, ebp
call fcn.00446190
test eax, eax
jne 0x487f05
movzx eax, byte [rdi]
cmp al, 0x4c
je 0x487f05
cmp al, 0x49
jne 0x487f48
mov rdx, qword [rsp + 0x30]
inc esi
add r12, 0x38
cmp esi, dword [rdx + 0x14]
jl 0x487ea0
mov r12, qword [rsp + 0x28]
mov r9d, dword [rsp + 0x20]
jmp 0x48828f
mov r12, qword [rsp + 0x28]
mov ebp, 0x240
jmp 0x487f52
mov r12, qword [rsp + 0x28]
mov ebp, 0x240
jmp 0x487f52
mov r12, qword [rsp + 0x28]
mov ebp, 0x240
jmp 0x487f52
mov r12, qword [rsp + 0x28]
mov ebp, 0x240
mov rax, qword [r15 + 0x10]
movzx edi, word [rax]
mov rax, qword [rsp + 0x108]
mov word [r14 + 0x18], 0
mov qword [r14], rax
mov word [r14 + 0x1a], 0
mov word [r14 + 0x2c], 0
mov byte [r14 + 0x11], 0
mov word [r14 + 0x12], 0
mov word [r14 + 0x16], di
mov qword [r14 + 0x20], r15
mov ebx, dword [r15 + 0x64]
test bl, 4
je 0x487fa7
mov rsi, qword [rsp + 0x100]
xor r11d, r11d
jmp 0x488055
mov rsi, qword [rsp + 0x100]
mov rax, qword [rsi]
mov rcx, qword [rax + 0x10]
test rcx, rcx
jne 0x487fc3
xor r11d, r11d
jmp 0x488055
mov r11d, dword [rcx]
xor r10d, r10d
test r11d, r11d
jle 0x488052
mov r9, qword [rcx + 8]
mov rcx, qword [r9]
test rcx, rcx
je 0x488005
nop
mov eax, dword [rcx + 4]
bt eax, 0xc
jae 0x488005
bt eax, 0x12
jae 0x487ffc
mov rax, qword [rcx + 0x20]
mov rcx, qword [rax + 8]
mov rcx, qword [rcx]
jmp 0x488000
mov rcx, qword [rcx + 0x10]
test rcx, rcx
jne 0x487fe0
cmp byte [rcx], 0x9a
jne 0x4880ab
mov eax, dword [r12 + 0x48]
cmp dword [rcx + 0x2c], eax
jne 0x488046
movzx r8d, word [rcx + 0x30]
test r8w, r8w
js 0x4880b0
movzx edx, word [r15 + 0x5e]
xor ecx, ecx
test edx, edx
jle 0x488046
mov rax, qword [r15 + 8]
cmp r8w, word [rax]
je 0x4880b8
inc ecx
add rax, 2
cmp ecx, edx
jl 0x488036
inc r10d
add r9, 0x28
cmp r10d, r11d
jl 0x487fd6
xor r11d, r11d
cmp dword [r15 + 0x58], 0
jg 0x4880c0
movzx eax, byte [rsp + 0x20]
xor ecx, ecx
test r11d, r11d
cmovne ecx, eax
lea eax, [rdi + 0x10]
movzx r8d, di
mov byte [r14 + 0x11], cl
mov rcx, qword [rsp + 0x30]
mov rdx, r14
mov dword [r14 + 0x28], 0x100
mov word [r14 + 0x14], ax
call fcn.00437b00
mov rdx, r14
mov rcx, rsi
call fcn.0044c560
mov word [r14 + 0x16], di
test eax, eax
jne 0x4882ac
jmp 0x488269
xor r11d, r11d
jmp 0x488055
mov r11d, 1
jmp 0x488055
mov r11d, 1
jmp 0x488055
test bl, 0x20
je 0x4880ce
mov dword [r14 + 0x28], ebp
xor r10d, r10d
jmp 0x488119
movzx eax, word [r15 + 0x60]
xor r9d, r9d
dec eax
movsxd rdx, eax
js 0x488102
mov rax, qword [r15 + 8]
lea r8, [rax + rdx*2]
movsx ecx, word [r8]
cmp ecx, 0x3e
ja 0x4880f9
mov eax, 1
shl rax, cl
or r9, rax
sub r8, 2
dec rdx
jns 0x4880e5
mov r10, qword [r12 + 0x60]
not r9
mov eax, 0x200
and r10, r9
cmove eax, ebp
mov dword [r14 + 0x28], eax
test r11d, r11d
jne 0x488178
mov rax, qword [rsp + 0x40]
test byte [rax + 0x48], 0x20
jne 0x488178
test r10, r10
jne 0x488269
test byte [r15 + 0x64], 4
jne 0x488269
movzx eax, word [rax + 0x46]
cmp word [r15 + 0x5c], ax
jge 0x488269
mov rax, qword [rsp + 0x48]
test byte [rax + 0x32], 4
jne 0x488269
cmp dword [reloc.WS2_32.dll_accept], r10d
je 0x488269
mov rax, qword [rax]
mov rcx, qword [rax]
test byte [rcx + 0x4c], 0x40
jne 0x488269
movzx eax, byte [rsp + 0x20]
xor ecx, ecx
test r11d, r11d
cmovne ecx, eax
mov byte [r14 + 0x11], cl
movsx eax, word [r15 + 0x5c]
mov rcx, qword [rsp + 0x40]
movsx ecx, word [rcx + 0x46]
imul eax, eax, 0xf
cdq
idiv ecx
mov r8d, eax
add r8w, di
inc r8w
test r10, r10
mov word [r14 + 0x14], r8w
je 0x488244
lea edx, [rdi + 0x10]
cmp r8w, dx
jl 0x4881fc
movsx ecx, dx
movsx r9d, r8w
lea eax, [rcx + 0x31]
cmp r9d, eax
jg 0x48823f
lea eax, [rcx + 0x1f]
cmp r9d, eax
jle 0x4881dc
inc r8w
jmp 0x48823f
movsx rcx, r8w
movsx rax, dx
sub rcx, rax
lea rax, [0x00400000]
movzx eax, byte [rcx + rax + 0x29b360]
add r8w, ax
jmp 0x48823f
movsx ecx, r8w
movsx r9d, dx
lea eax, [rcx + 0x31]
cmp r9d, eax
jle 0x488212
mov r8w, dx
jmp 0x48823f
lea eax, [rcx + 0x1f]
cmp r9d, eax
jle 0x488220
lea r8d, [rdx + 1]
jmp 0x48823f
movsx rax, r8w
movsx rcx, dx
sub rcx, rax
lea rax, [0x00400000]
movzx r8d, byte [rcx + rax + 0x29b360]
add r8w, dx
mov word [r14 + 0x14], r8w
mov rcx, qword [rsp + 0x30]
movzx r8d, di
mov rdx, r14
call fcn.00437b00
mov rdx, r14
mov rcx, rsi
call fcn.0044c560
mov word [r14 + 0x16], di
test eax, eax
jne 0x4882ac
xor r9d, r9d
mov r8, r15
mov rdx, r12
mov rcx, rsi
call fcn.004872d0
cmp qword [r12 + 0x70], 0
mov r13d, eax
jne 0x4882ac
mov rdx, qword [rsp + 0x30]
mov r9d, dword [rsp + 0x20]
mov r15, qword [r15 + 0x28]
inc r9d
test r13d, r13d
mov dword [rsp + 0x20], r9d
mov ebp, 0x240
je 0x487e71
mov eax, r13d
mov r15, qword [rsp + 0xc8]
mov r14, qword [rsp + 0xd0]
mov r13, qword [rsp + 0xd8]
mov r12, qword [rsp + 0xe0]
mov rdi, qword [rsp + 0xe8]
mov rsi, qword [rsp + 0xf0]
mov rbp, qword [rsp + 0x118]
mov rbx, qword [rsp + 0x110]
add rsp, 0xf8
ret
mov r12, qword [rsp + 0x28]
jmp 0x48828f