Function at 0x4fe870
Capabilities:
Encode data using xor

Disassembly:
mov eax, dword [esp + 4]
sub esp, 0x18
push ebx
push ebp
push esi
push edi
cmp eax, 5
jne 0x4fe9b9
mov ecx, dword [esp + 0x30]
mov ebp, ecx
mov eax, dword [esp + 0x40]
mov dword [esp + 0x10], ecx
test eax, eax
je 0x4fe89b
cmp eax, 1
jne 0x4fe915
mov esi, dword [esp + 0x38]
mov ebx, dword [esp + 0x34]
test esi, esi
je 0x4fe91d
lea edx, [ebx - 1]
mov ecx, esi
lea eax, [ebx*4]
mov dword [esp + 0x14], edx
mov dword [esp + 0x2c], ecx
mov ebx, eax
nop dword [eax]
mov eax, edx
cmp eax, 1
jl 0x4fe902
nop word [eax + eax]
mov edi, dword [ebp + eax*4]
mov esi, edi
mov ecx, dword [ebp + eax*4 - 4]
sub edi, dword [ebp + eax*4 - 4]
and ecx, 0xff800000
sub esi, ecx
xor edi, esi
and edi, 0x7fffff
xor edi, esi
mov dword [ebp + eax*4], edi
dec eax
cmp eax, 1
jge 0x4fe8d0
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x14]
add ebp, ebx
sub ecx, 1
mov dword [esp + 0x2c], ecx
jne 0x4fe8c0
mov ecx, dword [esp + 0x30]
mov eax, dword [esp + 0x40]
mov esi, dword [esp + 0x38]
mov ebx, dword [esp + 0x34]
test eax, eax
je 0x4fe92a
cmp eax, 2
jne 0x4feb4e
test ebx, ebx
je 0x4feb4e
lea edx, [esi - 1]
mov dword [esp + 0x2c], ebx
mov ebp, edx
mov dword [esp + 0x14], edx
imul ebp, ebx
mov eax, ebx
mov dword [esp + 0x1c], ebp
mov edi, ebp
cmp edx, 1
jl 0x4fe9a1
lea eax, [ebx*4]
mov ebp, edx
mov dword [esp + 0x18], eax
mov eax, edi
sub eax, ebx
lea ebx, [ecx + eax*4]
mov esi, dword [ecx + edi*4]
mov ecx, esi
mov eax, dword [ebx]
sub esi, dword [ebx]
and eax, 0xff800000
sub ebx, dword [esp + 0x18]
sub ecx, eax
xor esi, ecx
and esi, 0x7fffff
xor esi, ecx
mov ecx, dword [esp + 0x10]
mov dword [ecx + edi*4], esi
sub edi, dword [esp + 0x34]
sub ebp, 1
jne 0x4fe963
mov ebx, dword [esp + 0x34]
mov eax, dword [esp + 0x2c]
mov edx, dword [esp + 0x14]
mov ebp, dword [esp + 0x1c]
add ecx, 4
sub eax, 1
mov dword [esp + 0x10], ecx
mov dword [esp + 0x2c], eax
jne 0x4fe948
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret
cmp eax, 6
jne 0x4feb4e
mov edx, dword [esp + 0x30]
mov ecx, edx
mov eax, dword [esp + 0x40]
mov dword [esp + 0x18], edx
mov dword [esp + 0x10], ecx
test eax, eax
je 0x4fe9e1
cmp eax, 1
jne 0x4fea80
mov ebp, dword [esp + 0x38]
test ebp, ebp
je 0x4fea84
mov eax, dword [esp + 0x34]
lea ebx, [eax - 1]
shl eax, 3
mov dword [esp + 0x2c], eax
mov eax, ebp
mov edx, dword [esp + 0x2c]
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x14], eax
nop dword [eax]
mov ebp, ebx
cmp ebp, 1
jl 0x4fea69
mov esi, dword [ecx + ebp*8 - 4]
mov eax, esi
mov edi, dword [ecx + ebp*8]
and eax, 0xfffff
mov ebx, dword [ecx + ebp*8 + 4]
mov edx, edi
sub edx, dword [ecx + ebp*8 - 8]
mov ecx, ebx
sbb ecx, eax
and esi, 0xfff00000
sub edi, 0
sbb ebx, esi
xor eax, eax
xor ebx, ecx
xor eax, edx
and ebx, 0xfff00000
xor ebx, ecx
mov ecx, dword [esp + 0x10]
mov dword [ecx + ebp*8], eax
mov dword [ecx + ebp*8 + 4], ebx
dec ebp
cmp ebp, 1
jge 0x4fea17
mov eax, dword [esp + 0x14]
mov edx, dword [esp + 0x2c]
mov ebx, dword [esp + 0x1c]
add ecx, edx
sub eax, 1
mov dword [esp + 0x10], ecx
mov dword [esp + 0x14], eax
jne 0x4fea10
mov edx, dword [esp + 0x30]
mov eax, dword [esp + 0x40]
mov ebp, dword [esp + 0x38]
test eax, eax
je 0x4fea91
cmp eax, 2
jne 0x4feb4e
mov ecx, dword [esp + 0x34]
test ecx, ecx
je 0x4feb4e
lea ebx, [ebp - 1]
mov dword [esp + 0x10], ecx
mov ebp, ebx
mov dword [esp + 0x20], ebx
imul ebp, ecx
mov eax, ecx
mov dword [esp + 0x24], ebp
cmp ebx, 1
jl 0x4feb36
lea eax, [ecx*8]
mov dword [esp + 0x14], ebx
mov dword [esp + 0x1c], eax
mov eax, ebp
sub eax, ecx
lea ecx, [edx + eax*8]
mov dword [esp + 0x2c], ecx
mov edi, dword [ecx + 4]
mov eax, edi
mov ebx, dword [edx + ebp*8 + 4]
and eax, 0xfffff
mov esi, dword [edx + ebp*8]
mov edx, esi
sub edx, dword [ecx]
mov ecx, ebx
sbb ecx, eax
and edi, 0xfff00000
sub esi, 0
sbb ebx, edi
xor eax, eax
xor ebx, ecx
xor eax, edx
mov edx, dword [esp + 0x18]
and ebx, 0xfff00000
xor ebx, ecx
mov ecx, dword [esp + 0x2c]
sub ecx, dword [esp + 0x1c]
mov dword [esp + 0x2c], ecx
mov dword [edx + ebp*8], eax
mov dword [edx + ebp*8 + 4], ebx
sub ebp, dword [esp + 0x34]
sub dword [esp + 0x14], 1
jne 0x4fead6
mov ecx, dword [esp + 0x34]
mov eax, dword [esp + 0x10]
mov ebx, dword [esp + 0x20]
mov ebp, dword [esp + 0x24]
add edx, 8
sub eax, 1
mov dword [esp + 0x18], edx
mov dword [esp + 0x10], eax
jne 0x4feab3
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret