Function at 0x40f230
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
cmp dword [ebp + 0x14], 0
push ebx
push esi
push edi
mov ebx, eax
mov esi, ecx
je 0x40f45c
mov edi, dword [ebp + 0x10]
movzx eax, byte [edi + 1]
movzx ecx, byte [edi]
movzx edx, byte [edi + 2]
shl eax, 8
or ecx, eax
movzx eax, byte [edi + 3]
shl edx, 0x10
or ecx, edx
movzx edx, byte [edi + 5]
shl eax, 0x18
or ecx, eax
movzx eax, byte [edi + 4]
shl edx, 8
or eax, edx
movzx edx, byte [edi + 6]
shl edx, 0x10
or eax, edx
movzx edx, byte [edi + 7]
shl edx, 0x18
or eax, edx
mov edx, dword [ebp + 8]
add edx, 0xfffffff8
mov dword [ebp + 0x14], eax
mov dword [ebp + 0x10], edi
js 0x40f35b
lea eax, [edx + 8]
shr eax, 3
mov dword [ebp + 8], eax
neg eax
lea eax, [edx + eax*8]
mov dword [ebp - 8], eax
lea ebx, [ebx]
movzx edx, byte [esi + 1]
movzx eax, byte [esi]
movzx edi, byte [esi + 4]
shl edx, 8
or eax, edx
movzx edx, byte [esi + 2]
shl edx, 0x10
or eax, edx
movzx edx, byte [esi + 3]
shl edx, 0x18
or eax, edx
movzx edx, byte [esi + 5]
shl edx, 8
or edi, edx
movzx edx, byte [esi + 6]
shl edx, 0x10
or edi, edx
movzx edx, byte [esi + 7]
xor eax, ecx
shl edx, 0x18
mov dword [ebp - 0x18], eax
or edi, edx
xor edi, dword [ebp + 0x14]
lea eax, [ebp - 0x18]
push eax
mov eax, dword [ebp + 0xc]
add esi, 8
mov dword [ebp - 0x14], edi
call fcn.0040f6c0
mov eax, dword [ebp - 0x18]
mov byte [ebx], al
mov edx, eax
shr edx, 8
mov byte [ebx + 1], dl
mov edx, eax
shr edx, 0x10
mov byte [ebx + 2], dl
mov ecx, eax
shr eax, 0x18
mov byte [ebx + 3], al
mov eax, dword [ebp - 0x14]
mov byte [ebx + 4], al
mov edx, eax
shr edx, 8
mov byte [ebx + 5], dl
mov edx, eax
shr edx, 0x10
mov dword [ebp + 0x14], eax
shr eax, 0x18
mov byte [ebx + 6], dl
mov byte [ebx + 7], al
add esp, 4
add ebx, 8
dec dword [ebp + 8]
jne 0x40f2b0
mov edi, dword [ebp + 0x10]
mov edx, dword [ebp - 8]
mov eax, dword [ebp + 0x14]
cmp edx, 0xfffffff8
je 0x40f424
lea esi, [esi + edx + 8]
add edx, 7
xor eax, eax
mov dword [ebp + 8], 0
cmp edx, 7
ja case.default.0x40f379
jmp dword [edx*4 + 0x40f680]
movzx eax, byte [esi - 1]
dec esi
shl eax, 0x18
movzx edx, byte [esi - 1]
dec esi
shl edx, 0x10
or eax, edx
movzx edx, byte [esi - 1]
dec esi
shl edx, 8
or eax, edx
movzx edx, byte [esi - 1]
dec esi
or eax, edx
mov dword [ebp + 8], eax
movzx eax, byte [esi - 1]
dec esi
shl eax, 0x18
movzx edx, byte [esi - 1]
dec esi
shl edx, 0x10
or eax, edx
movzx edx, byte [esi - 1]
dec esi
shl edx, 8
or eax, edx
movzx edx, byte [esi - 1]
or eax, edx
xor eax, ecx
mov dword [ebp - 0x18], eax
mov eax, dword [ebp + 8]
xor eax, dword [ebp + 0x14]
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x18]
push eax
mov eax, dword [ebp + 0xc]
call fcn.0040f6c0
mov eax, dword [ebp - 0x18]
mov byte [ebx], al
mov edx, eax
shr edx, 8
mov byte [ebx + 1], dl
mov edx, eax
shr edx, 0x10
mov byte [ebx + 2], dl
mov ecx, eax
shr eax, 0x18
mov byte [ebx + 3], al
mov eax, dword [ebp - 0x14]
mov edx, eax
mov byte [ebx + 4], al
shr edx, 8
mov byte [ebx + 5], dl
mov edx, eax
mov dword [ebp + 0x14], eax
shr edx, 0x10
add esp, 4
shr eax, 0x18
mov byte [ebx + 6], dl
mov byte [ebx + 7], al
mov eax, dword [ebp + 0x14]
mov byte [edi], cl
mov edx, ecx
shr edx, 8
mov byte [edi + 1], dl
mov edx, ecx
shr edx, 0x10
mov byte [edi + 2], dl
shr ecx, 0x18
mov byte [edi + 3], cl
mov byte [edi + 4], al
mov ecx, eax
mov edx, eax
shr ecx, 8
mov byte [edi + 5], cl
shr edx, 0x10
mov byte [edi + 6], dl
shr eax, 0x18
mov byte [edi + 7], al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 0x10]
movzx edx, byte [eax + 1]
movzx ecx, byte [eax]
movzx edi, byte [eax + 5]
shl edx, 8
or ecx, edx
movzx edx, byte [eax + 2]
shl edx, 0x10
or ecx, edx
movzx edx, byte [eax + 3]
shl edx, 0x18
or ecx, edx
movzx edx, byte [eax + 4]
shl edi, 8
or edx, edi
movzx edi, byte [eax + 6]
shl edi, 0x10
or edx, edi
movzx edi, byte [eax + 7]
shl edi, 0x18
or edx, edi
mov edi, dword [ebp + 8]
add edi, 0xfffffff8
mov dword [ebp + 0x14], ecx
mov dword [ebp - 4], edx
mov dword [ebp + 0x10], eax
mov dword [ebp - 8], edi
js 0x40f57d
lea eax, [edi + 8]
shr eax, 3
mov dword [ebp - 0x10], eax
neg eax
lea eax, [edi + eax*8]
mov dword [ebp - 8], eax
movzx ecx, byte [esi + 1]
movzx eax, byte [esi]
movzx edx, byte [esi + 2]
shl ecx, 8
or eax, ecx
movzx ecx, byte [esi + 3]
shl edx, 0x10
or eax, edx
movzx edx, byte [esi + 5]
shl ecx, 0x18
or eax, ecx
movzx ecx, byte [esi + 6]
mov dword [ebp - 0x18], eax
mov dword [ebp - 0xc], eax
movzx eax, byte [esi + 4]
shl edx, 8
or eax, edx
movzx edx, byte [esi + 7]
shl ecx, 0x10
or eax, ecx
shl edx, 0x18
or eax, edx
mov dword [ebp - 0x14], eax
mov dword [ebp + 8], eax
mov eax, dword [ebp + 0xc]
lea edi, [ebp - 0x18]
add esi, 8
call fcn.0040f910
mov eax, dword [ebp + 0x14]
xor eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 4]
xor ecx, dword [ebp - 0x14]
mov byte [ebx], al
mov edx, eax
shr edx, 8
mov byte [ebx + 1], dl
mov edx, eax
shr edx, 0x10
mov byte [ebx + 2], dl
shr eax, 0x18
mov byte [ebx + 3], al
mov byte [ebx + 4], cl
mov eax, ecx
mov edx, ecx
shr eax, 8
mov byte [ebx + 5], al
mov eax, dword [ebp - 0xc]
shr edx, 0x10
shr ecx, 0x18
mov byte [ebx + 6], dl
mov byte [ebx + 7], cl
mov ecx, dword [ebp + 8]
add ebx, 8
dec dword [ebp - 0x10]
mov dword [ebp + 0x14], eax
mov dword [ebp - 4], ecx
jne 0x40f4c5
mov eax, dword [ebp + 0x10]
mov edi, dword [ebp - 8]
mov ecx, dword [ebp + 0x14]
mov edx, dword [ebp - 4]
cmp edi, 0xfffffff8
je 0x40f646
movzx edx, byte [esi + 1]
movzx eax, byte [esi]
movzx ecx, byte [esi + 2]
shl edx, 8
or eax, edx
movzx edx, byte [esi + 3]
shl ecx, 0x10
or eax, ecx
movzx ecx, byte [esi + 5]
shl edx, 0x18
or eax, edx
movzx edx, byte [esi + 7]
mov dword [ebp - 0x18], eax
mov dword [ebp - 0xc], eax
movzx eax, byte [esi + 4]
shl ecx, 8
or eax, ecx
movzx ecx, byte [esi + 6]
shl edx, 8
or edx, ecx
shl edx, 0x10
or eax, edx
mov dword [ebp - 0x14], eax
mov dword [ebp + 8], eax
mov eax, dword [ebp + 0xc]
lea edi, [ebp - 0x18]
call fcn.0040f910
mov edx, dword [ebp - 8]
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp - 4]
xor eax, dword [ebp - 0x18]
xor ecx, dword [ebp - 0x14]
lea ebx, [ebx + edx + 8]
add edx, 7
cmp edx, 7
ja case.default.0x40f5f5
jmp dword [edx*4 + 0x40f6a0]
dec ebx
mov edx, ecx
shr edx, 0x18
mov byte [ebx], dl
dec ebx
mov edx, ecx
shr edx, 0x10
mov byte [ebx], dl
dec ebx
mov edx, ecx
shr edx, 8
mov byte [ebx], dl
dec ebx
mov byte [ebx], cl
dec ebx
mov ecx, eax
shr ecx, 0x18
mov byte [ebx], cl
dec ebx
mov edx, eax
shr edx, 0x10
mov byte [ebx], dl
dec ebx
mov ecx, eax
shr ecx, 8
mov byte [ebx], cl
mov byte [ebx - 1], al
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp + 8]
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp + 0x14], edx
mov ecx, edx
mov edx, dword [ebp - 4]
mov byte [eax], cl
mov ebx, ecx
shr ebx, 8
mov byte [eax + 1], bl
mov ebx, ecx
shr ecx, 0x18
shr ebx, 0x10
mov byte [eax + 2], bl
mov byte [eax + 3], cl
mov ecx, edx
shr ecx, 8
mov byte [eax + 4], dl
mov byte [eax + 5], cl
mov ecx, edx
pop edi
shr ecx, 0x10
shr edx, 0x18
pop esi
mov byte [eax + 6], cl
mov byte [eax + 7], dl
pop ebx
mov esp, ebp
pop ebp
ret