Function at 0x4f78fc
Capabilities:
Encode data using xor

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0xb8
mov rdi, rdx
mov rsi, rcx
mov edx, 2
mov rcx, rdi
call fcn.004f2d34
test rax, rax
je 0x4f7d5d
cmp rdx, 2
jne 0x4f7d5d
movzx eax, word [rax]
rol ax, 8
movzx edx, ax
mov rcx, rdi
call fcn.004f2d34
test rax, rax
je 0x4f7d8c
mov qword [rsp + 0x50], rsi
mov qword [rsp + 0x90], rax
mov qword [rsp + 0x98], rdx
xor eax, eax
mov qword [rsp + 0xa0], rax
mov qword [rsp + 0x60], rax
mov qword [rsp + 0x68], 8
mov qword [rsp + 0x70], rax
test rdx, rdx
je 0x4f7d34
mov edx, 8
lea r15, [rsp + 0x90]
xor edi, edi
mov qword [rsp + 0xa8], rdx
lea rcx, [rsp + 0x28]
mov rdx, r15
call fcn.004f6bc6
mov rbp, qword [rsp + 0x28]
movzx r14d, word [rsp + 0x30]
movzx r12d, r14w
movzx esi, word [rsp + 0x32]
cmp rbp, 0x14
jne 0x4f7db7
mov r13d, 2
mov edx, 2
mov rcx, r15
call fcn.004f2d34
mov ebp, 0xb
test rax, rax
je 0x4f7dd3
cmp rdx, 2
jne 0x4f7dd3
movzx eax, word [rax]
rol ax, 8
movzx edx, ax
mov rcx, r15
call fcn.004f2d34
test rax, rax
je 0x4f7de1
mov r15, rax
mov r13, rdx
mov qword [rsp + 0x78], rax
mov qword [rsp + 0x80], rdx
mov qword [rsp + 0x88], 0
lea eax, [r12 - 0xb]
cmp eax, 0x19
ja case.default.0x4f7a4a
lea rcx, [0x004f7e98]
movsxd rax, dword [rcx + rax*4]
add rax, rcx
jmp rax
lea rcx, [rsp + 0x28]
lea rdx, [rsp + 0x78]
call fcn.004f6e08
cmp qword [rsp + 0x28], 0
mov rbp, qword [rsp + 0x30]
mov r12, qword [rsp + 0x38]
mov r13, qword [rsp + 0x40]
jne 0x4f7dec
xor r15d, r15d
jmp 0x4f7c4b
test r12d, r12d
je 0x4f7c4d
cmp r12d, 5
jne case.0x4f7a4a.12
mov r15w, 8
jmp 0x4f7c52
mov qword [rsp + 0x88], r13
mov rcx, r13
xor edx, edx
call fcn.00516e63
mov rbp, rax
mov r12, rdx
mov rcx, rdx
mov rdx, r15
mov r8, r13
call sub.msvcrt.dll_memcpy
mov r15w, 0xd
jmp 0x4f7c52
mov r15w, 2
jmp 0x4f7c52
lea rcx, [rsp + 0x28]
lea rdx, [rsp + 0x78]
call fcn.004f7350
movzx r14d, word [rsp + 0x40]
mov rbp, qword [rsp + 0x28]
mov r12, qword [rsp + 0x30]
mov r13, qword [rsp + 0x38]
cmp r14w, 0xb
je 0x4f7dec
movzx esi, word [rsp + 0x42]
mov edx, dword [rsp + 0x44]
mov r15w, 5
jmp 0x4f7c52
lea rcx, [rsp + 0x28]
lea rdx, [rsp + 0x78]
call fcn.004f3067
cmp qword [rsp + 0x28], 0
mov rbp, qword [rsp + 0x30]
mov r12, qword [rsp + 0x38]
mov r13, qword [rsp + 0x40]
mov r15w, 3
jmp 0x4f7b67
lea rcx, [rsp + 0x28]
lea rdx, [rsp + 0x78]
call fcn.004f7198
cmp qword [rsp + 0x28], 0
mov rbp, qword [rsp + 0x30]
mov r12, qword [rsp + 0x38]
mov r13, qword [rsp + 0x40]
mov r15w, 4
je 0x4f7c52
jmp 0x4f7dec
mov r15w, 7
jmp 0x4f7c52
mov r13d, 2
mov edx, 2
lea rcx, [rsp + 0x78]
call fcn.004f2d34
mov ebp, 0xb
test rax, rax
je 0x4f7e68
cmp rdx, 2
jne 0x4f7e68
movzx ecx, word [rax]
rol cx, 8
mov r15w, 6
jmp 0x4f7c52
mov r15w, 0xc
jmp 0x4f7c52
lea rcx, [rsp + 0x28]
lea rdx, [rsp + 0x78]
call fcn.004f58bb
mov rbp, qword [rsp + 0x28]
movzx ecx, word [rsp + 0x30]
movzx eax, word [rsp + 0x32]
cmp rbp, 0x14
jne 0x4f7e74
mov r15w, 9
jmp 0x4f7c52
mov qword [rsp + 0x88], r13
mov rcx, r13
xor edx, edx
call fcn.00516e63
mov rbp, rax
mov r12, rdx
mov rcx, rdx
mov rdx, r15
mov r8, r13
call sub.msvcrt.dll_memcpy
mov r15w, 0xa
jmp 0x4f7c4b
mov qword [rsp + 0x88], r13
mov rcx, r13
xor edx, edx
call fcn.00516e63
mov rbp, rax
mov r12, rdx
mov rcx, rdx
mov rdx, r15
mov r8, r13
call sub.msvcrt.dll_memcpy
mov r15w, 0xb
jmp 0x4f7c52
mov r15w, 1
mov r8, qword [rsp + 0x88]
mov word [rsp + 0x28], r15w
mov word [rsp + 0x2a], cx
mov word [rsp + 0x2c], ax
mov qword [rsp + 0x30], rbp
mov qword [rsp + 0x38], r12
mov qword [rsp + 0x40], r13
mov word [rsp + 0x48], r14w
mov word [rsp + 0x4a], si
mov dword [rsp + 0x4c], edx
cmp r8, qword [rsp + 0x80]
jb 0x4f7df1
lea rcx, [rsp + 0x2a]
movzx eax, word [rcx + 4]
mov ecx, dword [rcx]
mov rsi, qword [rsp + 0x48]
mov dword [rsp + 0x58], ecx
mov word [rsp + 0x5c], ax
cmp rdi, qword [rsp + 0x60]
jne 0x4f7ccf
lea rcx, [rsp + 0x60]
mov rdx, rdi
call fcn.004f0b38
mov rdx, qword [rsp + 0x68]
mov rdi, qword [rsp + 0x70]
jmp 0x4f7cd7
mov rdx, qword [rsp + 0xa8]
lea rax, [rdi + rdi*4]
mov word [rdx + rax*8], r15w
mov ecx, dword [rsp + 0x58]
mov dword [rdx + rax*8 + 2], ecx
movzx ecx, word [rsp + 0x5c]
mov word [rdx + rax*8 + 6], cx
mov qword [rdx + rax*8 + 8], rbp
mov rbx, r12
mov qword [rdx + rax*8 + 0x10], r12
mov qword [rdx + rax*8 + 0x18], r13
mov qword [rdx + rax*8 + 0x20], rsi
mov rdi, qword [rsp + 0x70]
inc rdi
mov qword [rsp + 0x70], rdi
mov rax, qword [rsp + 0xa0]
cmp rax, qword [rsp + 0x98]
lea r15, [rsp + 0x90]
jb 0x4f799a
mov rax, qword [rsp + 0x70]
mov rcx, qword [rsp + 0x50]
mov qword [rcx + 0x18], rax
mov rax, qword [rsp + 0x60]
mov qword [rcx + 8], rax
mov rax, qword [rsp + 0x68]
mov qword [rcx + 0x10], rax
mov qword [rcx], 0
jmp 0x4f7da3
mov qword [rsi + 8], 0xb
lea rax, [0x005ebd9a]
mov word [rsi + 0x10], ax
mov rcx, rax
shr rcx, 0x30
mov word [rsi + 0x16], cx
shr rax, 0x10
mov dword [rsi + 0x12], eax
mov qword [rsi + 0x18], 2
jmp 0x4f7d9c
mov qword [rsi + 8], 0xa
mov qword [rsi + 0x18], 0
mov qword [rsi], 1
add rsp, 0xb8
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
movzx ecx, si
mov eax, dword [rsp + 0x34]
shl rax, 0x20
or rax, r12
mov r13, qword [rsp + 0x38]
shl rcx, 0x10
or rcx, rax
jmp 0x4f7e0d
mov rax, qword [rsp + 0x50]
lea rcx, [0x005ebd9a]
jmp 0x4f7e12
mov ebp, 0xa
xor r13d, r13d
mov r12, rbx
mov rcx, r12
jmp 0x4f7e0d
lea rcx, [rsp + 0x28]
call fcn.004ec87c
mov ebp, 0xe
mov r13d, 0xf
lea rcx, str.ServerExtensionClientHelloPayload
mov rax, qword [rsp + 0x50]
mov qword [rax + 8], rbp
mov qword [rax + 0x10], rcx
mov qword [rax + 0x18], r13
mov qword [rax], 1
mov rsi, qword [rsp + 0x68]
test rdi, rdi
je 0x4f7e56
xor eax, eax
mov rcx, rax
xor rcx, 1
mov edx, eax
and edx, 1
lea rbx, [rcx + rdx*2]
lea rax, [rax + rax*4]
lea rcx, [rsi + rax*8]
call fcn.004ec87c
mov rax, rbx
cmp rbx, rdi
jne 0x4f7e31
mov rcx, qword [rsp + 0x60]
mov rdx, rsi
call fcn.0044b972
jmp 0x4f7da3
lea r12, [0x005ebd9a]
jmp 0x4f7dec
movzx ecx, cx
movzx r12d, ax
mov eax, dword [rsp + 0x34]
shl rax, 0x20
or rax, rcx
mov r13, qword [rsp + 0x38]
shl r12, 0x10
or r12, rax
jmp 0x4f7dec