Function at 0x514760
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
and esp, 0xfffffff0
sub esp, 0x70
mov esi, dword [ebp + 8]
mov ebx, dword [ebp + 0xc]
mov dword [esp], esi
call fcn.00516210
test eax, eax
mov dword [esp + 0x2c], eax
jne 0x51481b
cmp dword [ebp + 0x10], 2
ja 0x514b2a
mov edi, dword [esi + 0x30]
mov dword [esp + 0x40], 0
mov dword [esp + 0x68], 0
lea eax, [edi*8]
cmp dword [esi + 0x2c], eax
lea ecx, [edi*4]
cmovae eax, dword [esi + 0x2c]
xor edx, edx
mov dword [esp + 0x58], edi
div ecx
mov edx, dword [esi + 0x38]
mov dword [esp + 0x44], edx
mov edx, dword [esi + 0x28]
imul ecx, eax
mov dword [esp + 0x50], eax
shl eax, 2
mov dword [esp + 0x54], eax
mov eax, dword [ebp + 0x10]
mov dword [esp + 0x48], edx
mov edx, dword [esi + 0x34]
mov dword [esp + 0x4c], ecx
mov dword [esp + 0x60], eax
mov eax, dword [esi + 0x44]
mov dword [esp + 0x5c], edx
shr eax, 3
and eax, 1
cmp edi, edx
mov dword [esp + 0x64], eax
jae 0x514803
mov dword [esp + 0x5c], edi
lea edi, [esp + 0x40]
mov dword [esp + 4], esi
mov dword [esp], edi
call fcn.005167b0
test eax, eax
mov dword [esp + 0x2c], eax
je 0x514830
mov eax, dword [esp + 0x2c]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], edi
call fcn.00516120
test eax, eax
mov dword [esp + 0x2c], eax
jne 0x51481b
mov dword [esp + 4], edi
mov dword [esp], esi
call fcn.00515e20
mov edi, dword [esi + 4]
mov edx, dword [esi]
test edi, edi
mov dword [esp + 0x28], edi
je 0x51481b
mov eax, ebx
lea esi, [edi - 1]
mov edi, 0x11
neg eax
and eax, 0xf
lea ecx, [eax + 0xf]
cmp ecx, 0x11
cmovb ecx, edi
cmp esi, ecx
jb 0x514a90
test eax, eax
je 0x514acd
movzx ecx, byte [ebx]
xor cl, byte [edx]
cmp eax, 1
mov edi, ecx
je 0x514990
movzx ecx, byte [ebx + 1]
xor cl, byte [edx + 1]
or edi, ecx
cmp eax, 2
je 0x514a80
movzx ecx, byte [ebx + 2]
xor cl, byte [edx + 2]
or edi, ecx
cmp eax, 3
je 0x514aa0
movzx ecx, byte [ebx + 3]
xor cl, byte [edx + 3]
or edi, ecx
cmp eax, 4
je 0x514ab0
movzx ecx, byte [ebx + 4]
xor cl, byte [edx + 4]
or edi, ecx
cmp eax, 5
je 0x514ac0
movzx ecx, byte [ebx + 5]
xor cl, byte [edx + 5]
or edi, ecx
cmp eax, 6
je 0x514adc
movzx ecx, byte [ebx + 6]
xor cl, byte [edx + 6]
or edi, ecx
cmp eax, 7
je 0x514ae9
movzx ecx, byte [ebx + 7]
xor cl, byte [edx + 7]
or edi, ecx
cmp eax, 8
je 0x514af6
movzx ecx, byte [ebx + 8]
xor cl, byte [edx + 8]
or edi, ecx
cmp eax, 9
je 0x514b03
movzx ecx, byte [ebx + 9]
xor cl, byte [edx + 9]
or edi, ecx
cmp eax, 0xa
je 0x514b10
movzx ecx, byte [ebx + 0xa]
xor cl, byte [edx + 0xa]
or edi, ecx
cmp eax, 0xb
je 0x514b1d
movzx ecx, byte [ebx + 0xb]
xor cl, byte [edx + 0xb]
or edi, ecx
cmp eax, 0xc
je 0x514b37
movzx ecx, byte [ebx + 0xc]
xor cl, byte [edx + 0xc]
or edi, ecx
cmp eax, 0xd
je 0x514a72
movzx ecx, byte [ebx + 0xd]
xor cl, byte [edx + 0xd]
or edi, ecx
cmp eax, 0xf
jne 0x514b44
movzx ecx, byte [edx + 0xe]
mov dword [esp + 0x18], 0xf
xor cl, byte [ebx + 0xe]
or edi, ecx
jmp 0x5149a0
mov dword [esp + 0x18], 1
nop
lea esi, [esi]
mov esi, dword [esp + 0x28]
lea ecx, [ebx + eax]
mov dword [esp + 0x1c], edx
pxor xmm1, xmm1
sub esi, eax
add eax, edx
mov dword [esp + 0x24], esi
shr esi, 4
mov dword [esp + 0x20], esi
mov edx, dword [esp + 0x20]
xor esi, esi
movdqu xmm0, xmmword [eax]
add esi, 1
add ecx, 0x10
add eax, 0x10
pxor xmm0, xmmword [ecx - 0x10]
cmp edx, esi
por xmm1, xmm0
ja 0x5149c4
movdqa xmm0, xmm1
mov esi, dword [esp + 0x24]
mov edx, dword [esp + 0x1c]
psrldq xmm0, 8
por xmm1, xmm0
mov ecx, esi
and ecx, 0xfffffff0
movdqa xmm0, xmm1
psrldq xmm0, 4
por xmm1, xmm0
movdqa xmm0, xmm1
psrldq xmm0, 2
por xmm1, xmm0
movdqa xmm0, xmm1
psrldq xmm0, 1
por xmm1, xmm0
movaps xmmword [esp + 0x30], xmm1
movzx eax, byte [esp + 0x30]
or edi, eax
mov eax, dword [esp + 0x18]
add eax, ecx
cmp esi, ecx
je 0x514a50
mov esi, dword [esp + 0x28]
lea esi, [esi]
movzx ecx, byte [edx + eax]
xor cl, byte [ebx + eax]
add eax, 1
or edi, ecx
cmp esi, eax
ja 0x514a40
mov eax, edi
movzx edi, al
mov eax, 0xffffffdd
sub edi, 1
cmovs eax, dword [esp + 0x2c]
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x2c]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 0x18], 0xd
jmp 0x5149a0
mov dword [esp + 0x18], 2
jmp 0x5149a0
xor edi, edi
xor eax, eax
mov esi, dword [esp + 0x28]
jmp 0x514a40
mov dword [esp + 0x18], 3
jmp 0x5149a0
mov dword [esp + 0x18], 4
jmp 0x5149a0
mov dword [esp + 0x18], 5
jmp 0x5149a0
mov dword [esp + 0x18], 0
xor edi, edi
jmp 0x5149a0
mov dword [esp + 0x18], 6
jmp 0x5149a0
mov dword [esp + 0x18], 7
jmp 0x5149a0
mov dword [esp + 0x18], 8
jmp 0x5149a0
mov dword [esp + 0x18], 9
jmp 0x5149a0
mov dword [esp + 0x18], 0xa
jmp 0x5149a0
mov dword [esp + 0x18], 0xb
jmp 0x5149a0
mov dword [esp + 0x2c], 0xffffffe6
jmp 0x51481b
mov dword [esp + 0x18], 0xc
jmp 0x5149a0
mov dword [esp + 0x18], 0xe
jmp 0x5149a0