Function at 0x51aef8
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x1f4
mov eax, dword [0xee37e4]
xor eax, esp
mov dword [esp + 0x1f0], eax
mov eax, dword [ebp + 8]
push ebx
mov ebx, dword [ebp + 0xc]
push esi
push edi
mov edi, edx
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], ecx
push 0x10
pop ecx
mov eax, dword [edi + 8]
cdq
and edx, 7
mov dword [esp + 0x24], edi
add eax, edx
mov dword [esp + 0x14], ebx
sar eax, 3
cmp eax, ecx
cmovl ecx, eax
xor edx, edx
test eax, eax
mov eax, dword [edi + 0x20]
cmovg edx, ecx
mov dword [esp + 0x20], edx
cmp eax, 2
jne 0x51b00f
push 0x20
pop ebx
cmp dword [esp + 0x14], ebx
lea eax, [esp + 0x1bc]
mov esi, ebx
cmovbe esi, dword [esp + 0x14]
push esi
push dword [esp + 0x1c]
push eax
call fcn.006f6760
add esp, 0xc
cmp esi, ebx
jae 0x51af9b
mov eax, ebx
sub eax, esi
push eax
lea eax, [esp + 0x1c0]
add eax, esi
push 0xd0626c
push eax
call fcn.006f6760
add esp, 0xc
lea ecx, [esp + 0x28]
call fcn.0051e124
push ebx
lea edx, [esp + 0x1c0]
call fcn.0051e148
pop ecx
lea edx, [esp + 0x18c]
lea ecx, [esp + 0x28]
call fcn.0051e1d5
mov esi, dword [esp + 0x20]
lea edx, [esp + 0x18c]
push esi
lea ecx, [esp + 0x84]
call fcn.0057c0d4
pop ecx
lea eax, [edi + 0x24]
push ebx
push eax
lea edx, [esp + 0x1a4]
lea ecx, [esp + 0x88]
call fcn.0057c138
mov ecx, dword [esp + 0x24]
lea eax, [esp + 0x1a4]
push ebx
push eax
mov edx, edi
call fcn.0051ae6e
add esp, 0x10
jmp 0x51b1e3
cmp eax, 3
je 0x51b0ad
cmp eax, 4
je 0x51b0ad
cmp eax, 5
jne 0x51b068
mov ecx, dword [esp + 0x1c]
lea eax, [esp + 0x19c]
push eax
xor esi, esi
mov edx, edi
inc esi
push esi
push ebx
push dword [esp + 0x24]
call fcn.0051a710
add esp, 0x10
lea edx, [esp + 0x19c]
xor ecx, ecx
mov eax, dword [edx + ecx*4]
cmp eax, dword [edi + ecx*4 + 0x24]
jne 0x51b05f
inc ecx
cmp ecx, 8
jne 0x51b04e
jmp 0x51b061
xor esi, esi
mov eax, esi
jmp 0x51b1e3
cmp eax, 6
jne 0x51b0a6
mov ecx, dword [esp + 0x1c]
lea eax, [esp + 0x19c]
push eax
xor esi, esi
mov edx, edi
inc esi
push esi
push ebx
push dword [esp + 0x24]
call fcn.0051ab77
add esp, 0x10
lea edx, [esp + 0x19c]
xor ecx, ecx
mov eax, dword [edx + ecx*4]
cmp eax, dword [edi + ecx*4 + 0x24]
jne 0x51b05f
inc ecx
cmp ecx, 8
jne 0x51b095
jmp 0x51b061
xor eax, eax
jmp 0x51b1e3
push 0x20
pop ebx
cmp dword [esp + 0x14], ebx
lea eax, [esp + 0x19c]
mov esi, ebx
cmovbe esi, dword [esp + 0x14]
push esi
push dword [esp + 0x1c]
push eax
call fcn.006f6760
add esp, 0xc
cmp esi, ebx
jae 0x51b0f0
mov eax, ebx
sub eax, esi
push eax
lea eax, [esp + 0x1a0]
add eax, esi
push 0xd0626c
push eax
call fcn.006f6760
add esp, 0xc
lea ecx, [esp + 0x28]
call fcn.0051e124
push ebx
lea edx, [esp + 0x1a0]
call fcn.0051e148
pop ecx
lea edx, [esp + 0x18c]
lea ecx, [esp + 0x28]
call fcn.0051e1d5
mov esi, dword [esp + 0x20]
push 0x32
pop edi
lea ecx, [esp + 0x28]
call fcn.0051e124
push esi
lea edx, [esp + 0x190]
call fcn.0051e148
pop ecx
lea edx, [esp + 0x18c]
lea ecx, [esp + 0x28]
call fcn.0051e1d5
sub edi, 1
jne 0x51b11e
mov esi, dword [esp + 0x24]
lea edi, [esp + 0x1bc]
add esi, 0x24
xor eax, eax
push 8
pop ecx
rep movsd dword es:[edi], dword [esi]
mov dword [esp + 0x14], eax
mov edx, dword [esp + 0x20]
xor ecx, ecx
test edx, edx
jle 0x51b18f
mov byte [esp + 0x13], 0x13
sub byte [esp + 0x13], al
mov ah, byte [esp + 0x13]
mov al, byte [esp + ecx + 0x18c]
xor al, ah
mov byte [esp + ecx + 0x1dc], al
inc ecx
cmp ecx, edx
jl 0x51b17a
push edx
lea edx, [esp + 0x1e0]
lea ecx, [esp + 0x84]
call fcn.0057c0d4
pop ecx
lea eax, [esp + 0x1bc]
push ebx
push eax
mov edx, eax
lea ecx, [esp + 0x88]
call fcn.0057c138
mov eax, dword [esp + 0x1c]
inc eax
mov dword [esp + 0x1c], eax
pop ecx
pop ecx
cmp eax, 0x14
jl 0x51b163
mov edx, dword [esp + 0x24]
lea eax, [esp + 0x1bc]
mov ecx, dword [esp + 0x1c]
push ebx
push eax
call fcn.0051ae6e
pop ecx
pop ecx
mov ecx, dword [esp + 0x1fc]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.006f3e28
mov esp, ebp
pop ebp
ret