Function at 0x51f300
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc4
mov eax, dword [0x68cc00]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
mov edx, dword [ebp + 0x10]
mov dword [ebp - 0x9c], ecx
mov ecx, dword [ebp + 8]
mov dword [ebp - 0xac], ecx
mov ecx, dword [ebp + 0x14]
push ebx
mov ebx, dword [ebp + 0x20]
mov dword [ebp - 0xa0], ecx
mov ecx, dword [ebp - 0x9c]
push esi
mov esi, dword [ebp + 0x24]
push edi
mov edi, dword [ebp + 0x1c]
cmp dword [ecx + 0x48], 3
mov ecx, dword [ebp - 0xac]
mov dword [ebp - 0xa8], eax
mov dword [ebp - 0xb4], edx
mov dword [ebp - 0xb8], edi
mov dword [ebp - 0xb0], esi
jne 0x51f394
push esi
push ebx
push edi
push dword [ebp + 0x18]
push dword [ebp - 0xa0]
push edx
push eax
push ecx
mov ecx, dword [ebp - 0x9c]
call fcn.0051c350
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005af5a8
mov esp, ebp
pop ebp
ret 0x20
push edx
call fcn.0040e3c0
mov ecx, dword [ebp + 0x18]
add esp, 4
add ecx, 0x14
mov dword [ebp - 0x9c], eax
add eax, ecx
mov dword [ebp - 0xc4], eax
cmp eax, 0x80
ja 0x51f635
mov ecx, dword [ebp - 0xa8]
push dword [ebp - 0x9c]
push dword [ebp - 0xb4]
lea eax, [ecx + 1]
cdq
sub eax, edx
sar eax, 1
sub ecx, eax
mov dword [ebp - 0xa4], eax
add ecx, dword [ebp - 0xac]
lea eax, [ebp - 0x84]
push eax
mov dword [ebp - 0xa8], ecx
call sub.VCRUNTIME140.dll_memcpy
push dword [ebp + 0x18]
mov eax, dword [ebp - 0x9c]
lea ecx, [ebp - 0x84]
push dword [ebp - 0xa0]
add eax, ecx
push eax
call sub.VCRUNTIME140.dll_memcpy
push esi
lea eax, [ebp - 0x94]
push eax
mov eax, dword [ebp - 0x9c]
add eax, dword [ebp + 0x18]
push eax
lea eax, [ebp - 0x84]
push eax
push dword [ebp - 0xa4]
push dword [ebp - 0xac]
call fcn.0046eb80
add esp, 0x30
test ebx, ebx
jle 0x51f608
mov ecx, dword [ebp - 0x9c]
mov eax, ebx
and eax, 0xf
add ecx, 0x10
add ecx, dword [ebp + 0x18]
mov esi, edi
mov dword [ebp - 0xbc], eax
mov eax, 0x10
sub eax, edi
mov dword [ebp - 0xc0], ecx
mov edi, dword [ebp - 0xb0]
mov dword [ebp - 0xb4], eax
lea eax, [ebx - 1]
shr eax, 4
inc eax
mov dword [ebp - 0xa0], eax
push edi
lea eax, [ebp - 0x18]
push eax
push ecx
lea eax, [ebp - 0x94]
push eax
push dword [ebp - 0xa4]
push dword [ebp - 0xac]
call fcn.0046eb80
push edi
lea eax, [ebp - 0x94]
push eax
push 0x10
push eax
push dword [ebp - 0xa4]
push dword [ebp - 0xac]
call fcn.0046eb80
mov eax, dword [ebp - 0xb4]
add esp, 0x30
mov ecx, dword [ebp - 0xbc]
add eax, esi
cmp eax, ebx
mov eax, 0x10
cmovle ecx, eax
test ecx, ecx
je 0x51f4ee
push ecx
lea eax, [ebp - 0x18]
push eax
push esi
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
mov ecx, dword [ebp - 0xc0]
add esi, 0x10
sub dword [ebp - 0xa0], 1
jne 0x51f487
mov esi, edi
lea eax, [ebp - 0x98]
push esi
push eax
mov eax, dword [ebp - 0x9c]
add eax, dword [ebp + 0x18]
push eax
lea eax, [ebp - 0x84]
push eax
push dword [ebp - 0xa4]
push dword [ebp - 0xa8]
call fcn.0046ebb0
mov edi, dword [ebp - 0xb8]
lea ecx, [ebx - 1]
mov eax, 0x14
add esp, 0x18
sub eax, edi
mov dword [ebp - 0xb8], eax
mov eax, 0xcccccccd
mul ecx
mov eax, edx
shr eax, 4
inc eax
mov dword [ebp - 0xa0], eax
push esi
lea eax, [ebp - 0x18]
push eax
push dword [ebp - 0xc4]
lea eax, [ebp - 0x98]
push eax
push dword [ebp - 0xa4]
push dword [ebp - 0xa8]
call fcn.0046ebb0
push esi
lea eax, [ebp - 0x98]
push eax
push 0x14
push eax
push dword [ebp - 0xa4]
push dword [ebp - 0xa8]
call fcn.0046ebb0
mov eax, dword [ebp - 0xb8]
add esp, 0x30
add eax, edi
cmp eax, ebx
jle 0x51f5c2
mov eax, 0xcccccccd
mov esi, ebx
mul ebx
shr edx, 4
lea eax, [edx + edx*4]
shl eax, 2
sub esi, eax
xor eax, eax
test esi, esi
jle 0x51f5df
jmp 0x51f5c9
mov esi, 0x14
xor eax, eax
mov edx, edi
nop dword [eax + eax]
mov cl, byte [ebp + eax - 0x18]
lea edx, [edx + 1]
xor byte [edx - 1], cl
inc eax
cmp eax, esi
jl 0x51f5d0
mov esi, dword [ebp - 0xb0]
add edi, 0x14
sub dword [ebp - 0xa0], 1
jne 0x51f558
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005af5a8
mov esp, ebp
pop ebp
ret 0x20
push esi
lea eax, [ebp - 0x98]
push eax
mov eax, dword [ebp - 0x9c]
add eax, dword [ebp + 0x18]
push eax
lea eax, [ebp - 0x84]
push eax
push dword [ebp - 0xa4]
push dword [ebp - 0xa8]
call fcn.0046ebb0
add esp, 0x18
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.005af5a8
mov esp, ebp
pop ebp
ret 0x20