Function at 0x40f2e0
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x38
mov eax, dword [0x5bbd60]
xor eax, esp
mov dword [esp + 0x34], eax
mov eax, dword [ebp + 0xc]
push ebx
push edi
mov ebx, ecx
mov edi, edx
mov dword [esp + 0x18], eax
cmp ebx, edi
je 0x40f375
mov ecx, dword [ebp + 8]
mov eax, esi
mov dword [esp + 0x10], eax
cmp ecx, 0x10
jb 0x40f35d
mov eax, ecx
shr eax, 4
mov dword [esp + 0xc], eax
mov ecx, dword [esp + 0x18]
push ecx
push edi
push ebx
call fcn.0040eba0
mov eax, dword [esp + 0x1c]
mov edx, dword [eax]
xor dword [edi], edx
mov ecx, dword [eax + 4]
xor dword [edi + 4], ecx
mov edx, dword [eax + 8]
xor dword [edi + 8], edx
mov eax, dword [eax + 0xc]
xor dword [edi + 0xc], eax
sub dword [ebp + 8], 0x10
mov dword [esp + 0x1c], ebx
add esp, 0xc
add ebx, 0x10
add edi, 0x10
dec dword [esp + 0xc]
jne 0x40f31c
mov eax, dword [esp + 0x10]
mov ecx, dword [eax]
mov dword [esi], ecx
mov edx, dword [eax + 4]
mov dword [esi + 4], edx
mov ecx, dword [eax + 8]
mov dword [esi + 8], ecx
mov edx, dword [eax + 0xc]
mov dword [esi + 0xc], edx
jmp 0x40f3e4
cmp dword [ebp + 8], 0x10
jb 0x40f3e4
mov eax, dword [ebp + 8]
shr eax, 4
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x18]
push eax
lea ecx, [esp + 0x30]
push ecx
push ebx
call fcn.0040eba0
mov eax, dword [ebx]
mov edx, dword [esi]
xor edx, dword [esp + 0x38]
sub dword [ebp + 8], 0x10
mov dword [edi], edx
mov ecx, dword [esi + 4]
xor ecx, dword [esp + 0x3c]
mov dword [esi], eax
mov eax, dword [ebx + 4]
mov dword [edi + 4], ecx
mov edx, dword [esi + 8]
xor edx, dword [esp + 0x40]
mov dword [esi + 4], eax
mov eax, dword [ebx + 8]
mov dword [edi + 8], edx
mov ecx, dword [esi + 0xc]
xor ecx, dword [esp + 0x44]
mov dword [esi + 8], eax
mov eax, dword [ebx + 0xc]
mov dword [edi + 0xc], ecx
add esp, 0xc
add ebx, 0x10
add edi, 0x10
dec dword [esp + 0xc]
mov dword [esi + 0xc], eax
jne 0x40f385
cmp dword [ebp + 8], 0
je 0x40f559
lea edx, [esp + 0x2c]
mov eax, esi
sub eax, edx
mov dword [esp + 0x1c], eax
mov ecx, edx
mov eax, 1
sub eax, ecx
mov dword [esp + 0x28], eax
mov eax, 2
sub eax, edx
mov dword [esp + 0x20], eax
mov eax, 3
sub eax, ecx
mov dword [esp + 0x24], eax
mov eax, ebx
sub eax, edx
mov dword [esp + 0x14], eax
lea eax, [edi + 2]
sub edi, ecx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], edi
mov edx, dword [esp + 0x18]
push edx
lea eax, [esp + 0x30]
push eax
push ebx
call fcn.0040eba0
add esp, 0xc
xor eax, eax
cmp eax, dword [ebp + 8]
jae 0x40f509
mov edx, dword [esp + 0x14]
mov edi, dword [esp + 0x1c]
lea ecx, [esp + eax + 0x2c]
movzx edx, byte [ecx + edx]
mov byte [esp + 0xb], dl
movzx edx, byte [ecx]
xor dl, byte [ecx + edi]
mov edi, dword [esp + 0xc]
mov byte [ecx + edi], dl
movzx edx, byte [esp + 0xb]
mov edi, dword [esp + 0x1c]
mov byte [ecx + edi], dl
mov edx, dword [esp + 0x28]
add edx, ecx
cmp edx, dword [ebp + 8]
jae 0x40f4fe
movzx edx, byte [ebx + eax + 1]
mov edi, dword [esp + 0x10]
mov byte [esp + 0xb], dl
movzx edx, byte [ecx + 1]
xor dl, byte [esi + eax + 1]
mov byte [edi + eax - 1], dl
movzx edx, byte [esp + 0xb]
mov byte [esi + eax + 1], dl
mov edx, dword [esp + 0x20]
add edx, ecx
cmp edx, dword [ebp + 8]
jae 0x40f501
movzx edx, byte [ebx + eax + 2]
mov byte [esp + 0xb], dl
movzx edx, byte [ecx + 2]
xor dl, byte [esi + eax + 2]
mov byte [edi + eax], dl
movzx edx, byte [esp + 0xb]
mov byte [esi + eax + 2], dl
mov edx, dword [esp + 0x24]
add edx, ecx
cmp edx, dword [ebp + 8]
jae 0x40f506
mov cl, byte [ecx + 3]
xor cl, byte [esi + eax + 3]
mov dl, byte [ebx + eax + 3]
mov byte [edi + eax + 1], cl
mov byte [esi + eax + 3], dl
add eax, 4
cmp eax, 0x10
jb 0x40f447
jmp 0x40f509
inc eax
jmp 0x40f509
add eax, 2
jmp 0x40f509
add eax, 3
mov ecx, dword [ebp + 8]
mov edx, 0x10
cmp ecx, edx
jbe 0x40f541
add dword [esp + 0x14], edx
add dword [esp + 0xc], edx
add dword [esp + 0x10], edx
sub ecx, edx
add ebx, edx
mov dword [ebp + 8], ecx
test ecx, ecx
jne 0x40f432
pop edi
pop ebx
mov ecx, dword [esp + 0x34]
xor ecx, esp
call fcn.00527d0f
mov esp, ebp
pop ebp
ret
cmp eax, edx
jae 0x40f559
mov edi, ebx
sub edi, esi
lea ecx, [esi + eax]
sub edx, eax
mov edi, edi
mov al, byte [edi + ecx]
mov byte [ecx], al
inc ecx
dec edx
jne 0x40f550
mov ecx, dword [esp + 0x3c]
pop edi
pop ebx
xor ecx, esp
call fcn.00527d0f
mov esp, ebp
pop ebp
ret