Function at 0x4df370
Capabilities:
Encode data using xor

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x98
test r9, r9
mov r15, rcx
mov r13, rdx
mov ebx, r8d
jne 0x4df3b0
mov esi, 0x37
mov eax, esi
add rsp, 0x98
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
cmp qword [rsp + 0x100], 0
je 0x4df391
mov edx, dword [rsp + 0x110]
test edx, edx
je 0x4df391
mov eax, dword [rsp + 0x108]
test eax, eax
je 0x4df391
mov ecx, r8d
mov qword [rsp + 0x28], r9
mov esi, 5
call fcn.004da710
test eax, eax
mov r14d, eax
je 0x4df396
mov rcx, r15
call fcn.004c85b0
test eax, eax
mov r9, qword [rsp + 0x28]
jne 0x4df5c6
mov rcx, qword [rsp + 0x118]
call fcn.004c85b0
test eax, eax
mov r9, qword [rsp + 0x28]
jne 0x4df5c6
mov eax, dword [rsp + 0x110]
xor edx, edx
mov ebp, dword [rsp + 0x110]
mov r12d, r14d
mov qword [rsp + 0x28], r9
sub eax, 1
div r14d
lea edx, [rax + 1]
imul eax, r14d
mov dword [rsp + 0x3c], edx
sub ebp, eax
mov rax, qword [rsp + 0x100]
add rax, 4
lea rcx, [rax + r12*2]
mov qword [rsp + 0x70], rax
call fcn.004c8550
test rax, rax
mov qword [rsp + 0x30], rax
je 0x4df625
mov r9, qword [rsp + 0x28]
mov r8d, 2
lea rcx, [rsp + 0x88]
mov edx, ebx
mov qword [rsp + 0x28], r9
call fcn.004d9f20
movzx esi, ax
mov rcx, qword [rsp + 0x30]
mov r9, qword [rsp + 0x28]
test esi, esi
jne 0x4df5bc
mov rbx, rcx
add rbx, qword [rsp + 0x70]
mov r8, qword [rsp + 0x100]
mov rdx, r9
call sub.msvcrt.dll_memcpy
lea rdi, [rbx + r12]
mov eax, ebp
mov dword [rsp + 0x28], 1
mov qword [rsp + 0x78], rax
mov rax, rdi
mov edi, r14d
mov r14, rax
mov edx, dword [rsp + 0x28]
xor ebp, ebp
mov eax, edx
shr eax, 0x18
mov dword [rsp + 0x40], eax
mov eax, edx
shr edx, 0x10
mov dword [rsp + 0x50], edx
mov edx, eax
shr edx, 8
mov dword [rsp + 0x60], edx
mov rcx, qword [rsp + 0x88]
mov r8, r13
mov rdx, r15
call fcn.004da4c0
movzx esi, ax
test esi, esi
jne 0x4df5aa
test ebp, ebp
je 0x4df64b
mov rcx, qword [rsp + 0x88]
mov r8, r12
mov rdx, r14
call fcn.004da310
mov rcx, qword [rsp + 0x88]
xor edx, edx
call fcn.004da6d0
mov r8, r12
mov rdx, rax
mov rcx, r14
call sub.msvcrt.dll_memcpy
xor r9d, r9d
nop
movzx eax, byte [r14 + r9]
xor byte [rbx + r9], al
add r9, 1
cmp edi, r9d
ja 0x4df550
add ebp, 1
cmp ebp, dword [rsp + 0x108]
jne 0x4df4f5
mov eax, dword [rsp + 0x3c]
cmp dword [rsp + 0x28], eax
je 0x4df631
mov rcx, qword [rsp + 0x118]
mov r8, r12
mov rdx, rbx
call sub.msvcrt.dll_memcpy
add qword [rsp + 0x118], r12
add dword [rsp + 0x28], 1
mov eax, dword [rsp + 0x3c]
cmp dword [rsp + 0x28], eax
jbe 0x4df4d4
mov rcx, qword [rsp + 0x88]
call fcn.004da300
mov rcx, qword [rsp + 0x30]
call fcn.004c8620
jmp 0x4df396
mov eax, dword [rsp + 0x110]
xor edx, edx
mov ebp, dword [rsp + 0x110]
mov r12d, r14d
mov qword [rsp + 0x28], r9
sub eax, 1
div r14d
lea edx, [rax + 1]
imul eax, r14d
mov dword [rsp + 0x3c], edx
sub ebp, eax
mov rax, qword [rsp + 0x100]
add rax, 4
lea rcx, [rax + r12*2]
mov qword [rsp + 0x70], rax
call fcn.004c8580
test rax, rax
mov qword [rsp + 0x30], rax
je 0x4df625
mov r8d, 3
mov r9, qword [rsp + 0x28]
jmp 0x4df477
call fcn.00512400
mov esi, eax
jmp 0x4df396
mov r8, qword [rsp + 0x78]
mov rcx, qword [rsp + 0x118]
mov rdx, rbx
call sub.msvcrt.dll_memcpy
jmp 0x4df597
movzx ecx, byte [rsp + 0x40]
mov rax, qword [rsp + 0x30]
mov rdx, qword [rsp + 0x100]
mov r8, qword [rsp + 0x70]
mov byte [rax + rdx], cl
movzx ecx, byte [rsp + 0x50]
mov byte [rax + rdx + 1], cl
movzx ecx, byte [rsp + 0x60]
mov byte [rax + rdx + 2], cl
movzx ecx, byte [rsp + 0x28]
mov byte [rax + rdx + 3], cl
mov rcx, qword [rsp + 0x88]
mov rdx, rax
call fcn.004da310
mov rcx, qword [rsp + 0x88]
xor edx, edx
call fcn.004da6d0
mov r8, r12
mov rcx, r14
mov rdx, rax
call sub.msvcrt.dll_memcpy
mov r8, r12
mov rdx, r14
mov rcx, rbx
call sub.msvcrt.dll_memcpy
jmp 0x4df562