Function at 0x402640
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 8
mov eax, dword [esp + 0x24]
cmp dword [esp + 0x20], 0xf
mov ebx, dword [esp + 0x1c]
mov ecx, dword [esp + 0x28]
not eax
jbe 0x402766
mov edi, dword [esp + 0x20]
lea edx, [edi - 0x10]
and edx, 0xfffffff0
lea edi, [ebx + edx + 0x10]
mov dword [esp + 4], edi
mov edi, dword [ebx + 8]
xor eax, dword [ebx]
add ebx, 0x10
mov esi, dword [ebx - 0xc]
mov dword [esp], eax
mov edx, edi
mov eax, edi
movzx ebp, al
shr edx, 0x18
mov eax, esi
mov edx, dword [ecx + edx*4 + 0x1000]
xor edx, dword [ecx + ebp*4 + 0x1c00]
mov ebp, esi
shr ebp, 0x18
xor edx, dword [ecx + ebp*4 + 0x2000]
movzx ebp, al
xor edx, dword [ecx + ebp*4 + 0x2c00]
mov ebp, edi
shr ebp, 0x10
mov eax, ebp
movzx ebp, al
mov eax, edi
movzx edi, ah
xor edx, dword [ecx + ebp*4 + 0x1400]
xor edx, dword [ecx + edi*4 + 0x1800]
mov edi, esi
shr edi, 0x10
mov eax, edi
movzx edi, al
mov eax, esi
xor edx, dword [ecx + edi*4 + 0x2400]
mov edi, dword [esp]
movzx esi, ah
xor edx, dword [ecx + esi*4 + 0x2800]
mov esi, edi
mov eax, edi
shr esi, 0x18
xor edx, dword [ecx + esi*4 + 0x3000]
movzx esi, al
xor edx, dword [ecx + esi*4 + 0x3c00]
mov esi, edi
shr esi, 0x10
mov eax, esi
movzx esi, al
mov eax, edi
movzx eax, ah
xor edx, dword [ecx + esi*4 + 0x3400]
xor edx, dword [ecx + eax*4 + 0x3800]
mov eax, edx
mov edx, dword [ebx - 4]
shr edx, 0x18
xor eax, dword [ecx + edx*4]
movzx edx, byte [ebx - 4]
xor eax, dword [ecx + edx*4 + 0xc00]
mov edx, dword [ebx - 4]
shr edx, 0x10
movzx edx, dl
xor eax, dword [ecx + edx*4 + 0x400]
mov edx, dword [ebx - 4]
movzx edx, dh
xor eax, dword [ecx + edx*4 + 0x800]
cmp ebx, dword [esp + 4]
jne 0x402674
and dword [esp + 0x20], 0xf
cmp dword [esp + 0x20], 7
jbe 0x4027e2
mov edi, dword [ebx + 4]
xor eax, dword [ebx]
add ebx, 8
mov ebp, eax
sub dword [esp + 0x20], 8
mov eax, edi
mov esi, edi
shr esi, 0x18
movzx eax, al
mov eax, dword [ecx + eax*4 + 0xc00]
xor eax, dword [ecx + esi*4]
mov esi, edi
shr esi, 0x10
mov edx, esi
movzx esi, dl
mov edx, edi
xor eax, dword [ecx + esi*4 + 0x400]
movzx esi, dh
mov edx, ebp
xor eax, dword [ecx + esi*4 + 0x800]
mov esi, ebp
shr esi, 0x18
xor eax, dword [ecx + esi*4 + 0x1000]
movzx esi, dl
xor eax, dword [ecx + esi*4 + 0x1c00]
mov esi, ebp
shr esi, 0x10
mov edx, esi
movzx esi, dl
mov edx, ebp
movzx edx, dh
xor eax, dword [ecx + esi*4 + 0x1400]
xor eax, dword [ecx + edx*4 + 0x1800]
cmp dword [esp + 0x20], 3
jbe 0x402826
xor eax, dword [ebx]
sub dword [esp + 0x20], 4
add ebx, 4
mov edx, eax
movzx eax, al
mov esi, edx
mov eax, dword [ecx + eax*4 + 0xc00]
shr esi, 0x18
xor eax, dword [ecx + esi*4]
mov esi, edx
movzx edx, dh
shr esi, 0x10
mov edi, eax
mov eax, esi
movzx esi, al
mov eax, dword [ecx + esi*4 + 0x400]
xor eax, edi
xor eax, dword [ecx + edx*4 + 0x800]
mov edx, dword [esp + 0x20]
test edx, edx
je 0x402867
mov edx, eax
xor al, byte [ebx]
movzx eax, al
shr edx, 8
xor edx, dword [ecx + eax*4]
cmp dword [esp + 0x20], 1
mov eax, edx
je 0x402867
xor al, byte [ebx + 1]
shr edx, 8
movzx eax, al
xor edx, dword [ecx + eax*4]
cmp dword [esp + 0x20], 2
mov eax, edx
je 0x402867
xor al, byte [ebx + 2]
shr edx, 8
movzx eax, al
xor edx, dword [ecx + eax*4]
mov eax, edx
add esp, 8
not eax
pop ebx
pop esi
pop edi
pop ebp
ret 0x10