Function at 0x406870
Capabilities:
Encode data using xor
Hash data with crc32

Disassembly:
push esi
mov esi, edx
test esi, esi
not eax
je 0x406602
lea esp, [esp]
test cl, 3
je 0x406602
movzx edx, byte [ecx]
xor edx, eax
and edx, 0xff
shr eax, 8
xor eax, dword [edx*4 + 0x41ccc0]
add ecx, 1
sub esi, 1
jne 0x4065e0
cmp esi, 0x20
push ebx
push edi
jb 0x4067ec
mov edi, esi
shr edi, 5
xor eax, dword [ecx]
add ecx, 4
mov edx, eax
shr edx, 0x10
movzx ebx, ah
and edx, 0xff
mov edx, dword [edx*4 + 0x41d0c0]
xor edx, dword [ebx*4 + 0x41d4c0]
mov ebx, eax
and eax, 0xff
shr ebx, 0x18
xor edx, dword [ebx*4 + 0x41ccc0]
add ecx, 4
xor edx, dword [eax*4 + 0x41d8c0]
add ecx, 4
xor edx, dword [ecx - 8]
add ecx, 4
mov eax, edx
shr eax, 0x10
and eax, 0xff
mov eax, dword [eax*4 + 0x41d0c0]
movzx ebx, dh
xor eax, dword [ebx*4 + 0x41d4c0]
mov ebx, edx
and edx, 0xff
shr ebx, 0x18
xor eax, dword [ebx*4 + 0x41ccc0]
add ecx, 4
xor eax, dword [edx*4 + 0x41d8c0]
add ecx, 4
xor eax, dword [ecx - 0x10]
mov edx, eax
shr edx, 0x10
movzx ebx, ah
and edx, 0xff
mov edx, dword [edx*4 + 0x41d0c0]
xor edx, dword [ebx*4 + 0x41d4c0]
mov ebx, eax
and eax, 0xff
shr ebx, 0x18
xor edx, dword [ebx*4 + 0x41ccc0]
xor edx, dword [eax*4 + 0x41d8c0]
xor edx, dword [ecx - 0xc]
mov eax, edx
shr eax, 0x10
and eax, 0xff
mov eax, dword [eax*4 + 0x41d0c0]
movzx ebx, dh
xor eax, dword [ebx*4 + 0x41d4c0]
mov ebx, edx
and edx, 0xff
shr ebx, 0x18
xor eax, dword [ebx*4 + 0x41ccc0]
xor eax, dword [edx*4 + 0x41d8c0]
xor eax, dword [ecx - 8]
mov edx, eax
shr edx, 0x10
movzx ebx, ah
and edx, 0xff
mov edx, dword [edx*4 + 0x41d0c0]
xor edx, dword [ebx*4 + 0x41d4c0]
mov ebx, eax
and eax, 0xff
shr ebx, 0x18
xor edx, dword [ebx*4 + 0x41ccc0]
xor edx, dword [eax*4 + 0x41d8c0]
xor edx, dword [ecx - 4]
mov eax, edx
shr eax, 0x10
and eax, 0xff
mov eax, dword [eax*4 + 0x41d0c0]
movzx ebx, dh
xor eax, dword [ebx*4 + 0x41d4c0]
mov ebx, edx
shr ebx, 0x18
xor eax, dword [ebx*4 + 0x41ccc0]
and edx, 0xff
xor eax, dword [edx*4 + 0x41d8c0]
xor eax, dword [ecx]
add ecx, 4
mov edx, eax
shr edx, 0x10
movzx ebx, ah
and edx, 0xff
mov edx, dword [edx*4 + 0x41d0c0]
xor edx, dword [ebx*4 + 0x41d4c0]
mov ebx, eax
and eax, 0xff
shr ebx, 0x18
xor edx, dword [ebx*4 + 0x41ccc0]
add ecx, 4
xor edx, dword [eax*4 + 0x41d8c0]
sub esi, 0x20
xor edx, dword [ecx - 4]
mov eax, edx
shr eax, 0x10
and eax, 0xff
mov eax, dword [eax*4 + 0x41d0c0]
movzx ebx, dh
xor eax, dword [ebx*4 + 0x41d4c0]
mov ebx, edx
shr ebx, 0x18
xor eax, dword [ebx*4 + 0x41ccc0]
and edx, 0xff
xor eax, dword [edx*4 + 0x41d8c0]
sub edi, 1
jne 0x406612
cmp esi, 4
jb 0x406839
mov edx, esi
shr edx, 2
xor eax, dword [ecx]
add ecx, 4
mov edi, eax
shr edi, 0x10
and edi, 0xff
mov edi, dword [edi*4 + 0x41d0c0]
movzx ebx, ah
xor edi, dword [ebx*4 + 0x41d4c0]
mov ebx, eax
shr ebx, 0x18
xor edi, dword [ebx*4 + 0x41ccc0]
and eax, 0xff
xor edi, dword [eax*4 + 0x41d8c0]
sub esi, 4
sub edx, 1
mov eax, edi
jne 0x4067f6
test esi, esi
pop edi
pop ebx
je 0x40685d
nop
movzx edx, byte [ecx]
xor edx, eax
and edx, 0xff
shr eax, 8
xor eax, dword [edx*4 + 0x41ccc0]
add ecx, 1
sub esi, 1
jne 0x406840
not eax
pop esi
ret
mov ecx, dword [esp + 8]
test ecx, ecx
jne 0x40687b
xor eax, eax
ret
mov edx, dword [esp + 0xc]
mov eax, dword [esp + 4]
jmp 0x4065d0