Function at 0x51fd30
Capabilities:
Encode data using xor

Disassembly:
mov edx, dword [esp + 4]
sub esp, 0xc
push ebp
mov ebp, dword [esp + 0x18]
test edx, edx
je 0x51ff62
mov eax, dword [esp + 0x24]
push ebx
push esi
push edi
cmp eax, 5
jne 0x51fe2e
mov ecx, dword [esp + 0x2c]
mov ebx, ebp
mov edi, dword [esp + 0x28]
mov dword [esp + 0x10], ecx
cmp edx, 2
jne 0x51fdd0
test ecx, ecx
je 0x51ff5f
mov eax, ecx
lea ecx, [edi*4]
mov dword [esp + 0x20], eax
nop dword [eax]
mov esi, 2
cmp edi, esi
jbe 0x51fdbf
nop dword [eax]
mov eax, dword [ebx + esi*4 - 4]
mov ecx, dword [ebx + esi*4]
and eax, 0xff800000
add eax, ecx
add ecx, dword [ebx + esi*4 - 4]
xor ecx, eax
and ecx, 0x7fffff
xor ecx, eax
mov dword [ebx + esi*4], ecx
inc esi
cmp esi, edi
jb 0x51fd90
mov eax, dword [esp + 0x20]
lea ecx, [edi*4]
add ebx, ecx
sub eax, 1
mov dword [esp + 0x20], eax
jne 0x51fd80
mov ecx, dword [esp + 0x2c]
jmp 0x51fde0
test edx, edx
jle 0x51ff5f
test ecx, ecx
je 0x51ff5f
lea ebx, [edi*4]
mov eax, 1
cmp edi, eax
jbe 0x51fe1b
mov ecx, dword [ebp + eax*4 - 4]
mov edx, dword [ebp + eax*4]
and ecx, 0xff800000
add ecx, edx
add edx, dword [ebp + eax*4 - 4]
xor edx, ecx
and edx, 0x7fffff
xor edx, ecx
mov dword [ebp + eax*4], edx
inc eax
cmp eax, edi
jb 0x51fdf0
mov ecx, dword [esp + 0x10]
add ebp, ebx
sub ecx, 1
mov dword [esp + 0x10], ecx
jne 0x51fde7
pop edi
pop esi
pop ebx
pop ebp
add esp, 0xc
ret
cmp eax, 6
jne 0x51ff5f
mov ecx, dword [esp + 0x2c]
mov eax, ebp
mov dword [esp + 0x20], eax
mov dword [esp + 0x18], ecx
cmp edx, 2
jne 0x51fedd
test ecx, ecx
je 0x51ff5f
mov ebp, dword [esp + 0x28]
mov dword [esp + 0x14], ecx
nop
mov edx, 2
mov dword [esp + 0x10], edx
cmp ebp, edx
jbe 0x51febd
nop dword [eax]
mov ecx, dword [eax + edx*8]
mov edi, ecx
mov ebx, dword [eax + edx*8 - 4]
mov esi, dword [eax + edx*8 + 4]
add edi, dword [eax + edx*8 - 8]
mov edx, esi
adc edx, ebx
xor eax, eax
and ebx, 0xfff00000
add eax, ecx
mov ecx, dword [esp + 0x20]
adc ebx, esi
xor eax, eax
xor ebx, edx
xor eax, edi
and ebx, 0xfff00000
xor ebx, edx
mov edx, dword [esp + 0x10]
mov dword [ecx + edx*8], eax
mov eax, ecx
mov dword [eax + edx*8 + 4], ebx
inc edx
mov dword [esp + 0x10], edx
cmp edx, ebp
jb 0x51fe70
mov ecx, dword [esp + 0x14]
lea edx, [ebp*8]
add eax, edx
sub ecx, 1
mov dword [esp + 0x20], eax
mov dword [esp + 0x14], ecx
jne 0x51fe60
mov ebp, dword [esp + 0x24]
mov ecx, dword [esp + 0x2c]
jmp 0x51fee5
test edx, edx
jle 0x51ff5f
test ecx, ecx
je 0x51ff5f
mov eax, dword [esp + 0x28]
nop dword [eax]
mov edx, 1
mov dword [esp + 0x20], edx
cmp eax, edx
jbe 0x51ff4d
nop dword [eax]
mov ecx, dword [ebp + edx*8]
mov edi, ecx
add edi, dword [ebp + edx*8 - 8]
mov ebx, dword [ebp + edx*8 - 4]
mov esi, dword [ebp + edx*8 + 4]
mov edx, esi
adc edx, ebx
xor eax, eax
and ebx, 0xfff00000
add eax, ecx
adc ebx, esi
xor eax, eax
xor ebx, edx
xor eax, edi
and ebx, 0xfff00000
xor ebx, edx
mov edx, dword [esp + 0x20]
mov dword [ebp + edx*8], eax
mov eax, dword [esp + 0x28]
mov dword [ebp + edx*8 + 4], ebx
inc edx
mov dword [esp + 0x20], edx
cmp edx, eax
jb 0x51ff00
mov ecx, dword [esp + 0x18]
lea edx, [eax*8]
add ebp, edx
sub ecx, 1
mov dword [esp + 0x18], ecx
jne 0x51fef0
pop edi
pop esi
pop ebx
pop ebp
add esp, 0xc
ret