Function at 0x407400
Capabilities:
Encrypt data using rc4 prga

Disassembly:
mov rcx, qword gs:[0x28]
mov rcx, qword [rcx]
cmp rsp, qword [rcx + 0x10]
jbe 0x40781c
sub rsp, 0x78
mov qword [rsp + 0x70], rbp
lea rbp, [rsp + 0x70]
mov rax, qword [rsp + 0x80]
mov rdx, qword [rax + 0x28]
lea rbx, [rax + 0x28]
mov qword [rsp + 0x68], rbx
test rdx, rdx
je 0x4077e8
mov rsi, qword [rdx + 0x10]
lea rdi, [rdx + 0x10]
test rsi, rsi
je 0x4077e8
mov qword [rsp + 0x60], rsi
mov r8, qword [rsp + 0x88]
movzx r9d, word [r8 + 0x54]
mov r10, rsi
lea r10, [r9 + r10 - 8]
test byte [r8], al
mov r11, qword [r10]
test r11, r11
je 0x4077a3
mov edx, dword [0x005a1e00]
test edx, edx
jne 0x407772
mov qword [r10], 0
mov rdx, qword [rax + 0x28]
test byte [rdx], al
mov edi, dword [0x005a1e00]
lea r9, [rdx + 0x10]
test edi, edi
jne 0x407741
mov qword [rdx + 0x10], 0
movzx edx, byte [rax + 9]
cmp dl, 0x10
jae 0x4076e0
movzx ecx, word [rax + 0xa]
inc ecx
mov word [rax + 0xa], cx
mov qword [rsp + 0x48], rsi
mov rcx, qword [r8 + 0x40]
movzx ecx, byte [rcx + 0x17]
test cl, 0x80
je 0x407532
mov rcx, qword [rax + 0x28]
test rcx, rcx
je 0x407686
mov rcx, qword [rax + 0x28]
mov rcx, qword [rcx]
test rcx, rcx
je 0x40762c
mov rax, qword [rax + 0x28]
mov rcx, qword [rax]
test byte [rax], al
mov rax, qword [rcx + 0x10]
mov rdx, qword [rcx]
mov rbx, qword [rcx + 8]
lea rdi, [rbx + 1]
cmp rdi, rax
jg 0x407597
lea rax, [rbx + 1]
mov qword [rcx + 8], rax
mov eax, dword [0x005a1e00]
lea rcx, [rdx + rbx*8]
test eax, eax
jne 0x40757a
mov qword [rdx + rbx*8], rsi
movzx eax, word [r8 + 0x54]
mov rcx, qword [rsp + 0x90]
lea rax, [rcx + rax - 8]
test byte [rax], al
mov ecx, dword [0x005a1e00]
test ecx, ecx
jne 0x407565
mov qword [rax], rsi
mov qword [rsp + 0x98], rsi
mov rbp, qword [rsp + 0x70]
add rsp, 0x78
ret
mov qword [rsp], rax
mov qword [rsp + 8], rsi
call fcn.00410460
mov rsi, qword [rsp + 0x48]
jmp 0x407553
mov qword [rsp], rcx
mov qword [rsp + 8], rsi
call fcn.00410460
mov rsi, qword [rsp + 0x48]
mov r8, qword [rsp + 0x88]
jmp 0x407532
mov qword [rsp + 0x58], rcx
lea rcx, [0x004dc820]
mov qword [rsp], rcx
mov qword [rsp + 8], rdx
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rax
mov qword [rsp + 0x20], rdi
call fcn.0043d8d0
mov rax, qword [rsp + 0x28]
mov rcx, qword [rsp + 0x30]
mov rdx, qword [rsp + 0x38]
mov rbx, qword [rsp + 0x58]
mov qword [rbx + 0x10], rdx
mov edx, dword [0x005a1e00]
test edx, edx
jne 0x407603
mov qword [rbx], rax
mov rsi, qword [rsp + 0x48]
mov r8, qword [rsp + 0x88]
mov rdx, rax
mov rdi, rcx
mov rcx, rbx
mov rbx, rdi
jmp 0x407518
mov qword [rsp + 0x50], rax
mov qword [rsp + 0x40], rcx
mov qword [rsp], rbx
mov qword [rsp + 8], rax
call fcn.00410460
mov rax, qword [rsp + 0x50]
mov rcx, qword [rsp + 0x40]
mov rbx, qword [rsp + 0x58]
jmp 0x4075e5
lea rax, [0x004d0b20]
mov qword [rsp], rax
call fcn.0040faf0
mov rax, qword [rsp + 0x80]
mov rcx, qword [rax + 0x28]
test byte [rcx], al
mov edx, dword [0x005a1e00]
mov rbx, qword [rsp + 8]
test edx, edx
jne 0x40766e
mov qword [rcx], rbx
mov rsi, qword [rsp + 0x48]
mov r8, qword [rsp + 0x88]
jmp 0x4074fb
mov qword [rsp], rcx
mov qword [rsp + 8], rbx
call fcn.00410460
mov rax, qword [rsp + 0x80]
jmp 0x40765c
lea rax, [0x004e1860]
mov qword [rsp], rax
call fcn.0040faf0
mov eax, dword [0x005a1e00]
mov rcx, qword [rsp + 8]
test eax, eax
jne 0x4076c3
mov rax, qword [rsp + 0x80]
mov qword [rax + 0x28], rcx
mov rsi, qword [rsp + 0x48]
mov r8, qword [rsp + 0x88]
jmp 0x4074eb
mov rax, qword [rsp + 0x68]
mov qword [rsp], rax
mov qword [rsp + 8], rcx
call fcn.00410460
mov rax, qword [rsp + 0x80]
jmp 0x4076b1
mov rdi, qword gs:[0x28]
mov rdi, qword [rdi]
mov rdi, qword [rdi + 0x30]
mov r9d, dword [rdi + 0xec]
mov r10d, r9d
sar r9d, 0x1f
and r9d, 0xa8888eef
shl r10d, 1
xor r10d, r9d
mov dword [rdi + 0xec], r10d
lea ecx, [rdx - 0xf]
mov edx, 1
shl edx, cl
cmp cl, 0x20
sbb edi, edi
and edx, edi
dec edx
test edx, r10d
jne 0x4074cc
movzx ecx, word [rax + 0xa]
inc ecx
mov word [rax + 0xa], cx
jmp 0x4074cc
mov qword [rsp], r9
mov qword [rsp + 8], 0
call fcn.00410460
mov rax, qword [rsp + 0x80]
mov rbx, qword [rsp + 0x68]
mov rsi, qword [rsp + 0x60]
mov r8, qword [rsp + 0x88]
jmp 0x4074b5
mov qword [rsp], r10
mov qword [rsp + 8], 0
call fcn.00410460
mov rax, qword [rsp + 0x80]
mov rbx, qword [rsp + 0x68]
mov rsi, qword [rsp + 0x60]
mov r8, qword [rsp + 0x88]
jmp 0x407495
mov r10d, dword [0x005a1e00]
add r9, rsi
test r10d, r10d
jne 0x4077bb
mov qword [rdx + 0x10], r9
jmp 0x4074b5
mov qword [rsp], rdi
mov qword [rsp + 8], r9
call fcn.00410460
mov rax, qword [rsp + 0x80]
mov rbx, qword [rsp + 0x68]
mov rsi, qword [rsp + 0x60]
mov r8, qword [rsp + 0x88]
jmp 0x4074b5
mov rax, qword [rsp + 0x88]
mov rcx, qword [rax + 0x40]
mov qword [rsp], rcx
call fcn.0040faf0
mov rsi, qword [rsp + 8]
mov rax, qword [rsp + 0x80]
mov rbx, qword [rsp + 0x68]
mov r8, qword [rsp + 0x88]
jmp 0x4074b5
call fcn.00451b10
jmp fcn.00407400