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

Disassembly:
mov eax, dword [esp + 4]
mov ecx, dword [esp + 8]
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x1c]
test edi, edi
not eax
je 0x406779
test cl, 3
je 0x406779
mov edx, eax
xor ebx, ebx
mov bl, byte [ecx]
and edx, 0xff
xor edx, ebx
shr eax, 8
mov edx, dword [edx*4 + 0x409380]
xor eax, edx
inc ecx
dec edi
jne 0x406756
cmp edi, 0x20
mov esi, ecx
jb 0x4069a5
mov ebp, edi
shr ebp, 5
mov edx, dword [esi]
xor ecx, ecx
xor eax, edx
xor edx, edx
mov dl, ah
mov dword [esp + 0x18], eax
mov cl, byte [esp + 0x1a]
add esi, 4
mov ebx, dword [edx*4 + 0x409b80]
mov edx, eax
mov ecx, dword [ecx*4 + 0x409780]
and eax, 0xff
shr edx, 0x18
xor ecx, ebx
add esi, 4
mov ebx, dword [edx*4 + 0x409380]
mov edx, dword [esi - 4]
xor ecx, ebx
mov ebx, dword [eax*4 + 0x409f80]
xor ecx, ebx
xor eax, eax
xor ecx, edx
xor edx, edx
mov dl, ch
mov dword [esp + 0x18], ecx
mov al, byte [esp + 0x1a]
add esi, 4
mov ebx, dword [edx*4 + 0x409b80]
mov edx, ecx
mov eax, dword [eax*4 + 0x409780]
and ecx, 0xff
shr edx, 0x18
xor eax, ebx
add esi, 4
mov ebx, dword [edx*4 + 0x409380]
mov edx, dword [esi - 8]
xor eax, ebx
mov ebx, dword [ecx*4 + 0x409f80]
xor eax, ebx
xor ecx, ecx
xor eax, edx
xor edx, edx
mov dl, ah
mov dword [esp + 0x18], eax
mov cl, byte [esp + 0x1a]
add esi, 4
mov ebx, dword [edx*4 + 0x409b80]
mov edx, eax
mov ecx, dword [ecx*4 + 0x409780]
and eax, 0xff
shr edx, 0x18
xor ecx, ebx
mov ebx, dword [edx*4 + 0x409380]
mov edx, dword [esi - 8]
xor ecx, ebx
mov ebx, dword [eax*4 + 0x409f80]
xor ecx, ebx
xor eax, eax
xor ecx, edx
xor edx, edx
mov dl, ch
mov dword [esp + 0x18], ecx
mov al, byte [esp + 0x1a]
mov ebx, dword [edx*4 + 0x409b80]
mov edx, ecx
mov eax, dword [eax*4 + 0x409780]
and ecx, 0xff
shr edx, 0x18
xor eax, ebx
mov ebx, dword [edx*4 + 0x409380]
mov edx, dword [esi - 4]
xor eax, ebx
mov ebx, dword [ecx*4 + 0x409f80]
xor eax, ebx
xor ecx, ecx
xor eax, edx
xor edx, edx
mov dword [esp + 0x18], eax
mov dl, ah
mov cl, byte [esp + 0x1a]
mov ecx, dword [ecx*4 + 0x409780]
mov ebx, dword [edx*4 + 0x409b80]
mov edx, eax
shr edx, 0x18
xor ecx, ebx
and eax, 0xff
mov ebx, dword [edx*4 + 0x409380]
mov edx, dword [esi]
xor ecx, ebx
mov ebx, dword [eax*4 + 0x409f80]
xor ecx, ebx
xor eax, eax
xor ecx, edx
xor edx, edx
mov dl, ch
mov dword [esp + 0x18], ecx
mov al, byte [esp + 0x1a]
add esi, 4
mov ebx, dword [edx*4 + 0x409b80]
mov edx, ecx
mov eax, dword [eax*4 + 0x409780]
and ecx, 0xff
shr edx, 0x18
xor eax, ebx
add esi, 4
mov ebx, dword [edx*4 + 0x409380]
mov edx, dword [esi - 4]
xor eax, ebx
mov ebx, dword [ecx*4 + 0x409f80]
xor eax, ebx
xor ecx, ecx
xor eax, edx
xor edx, edx
mov dl, ah
mov dword [esp + 0x18], eax
mov cl, byte [esp + 0x1a]
add esi, 4
mov ebx, dword [edx*4 + 0x409b80]
mov edx, eax
mov ecx, dword [ecx*4 + 0x409780]
and eax, 0xff
shr edx, 0x18
xor ecx, ebx
sub edi, 0x20
mov ebx, dword [edx*4 + 0x409380]
mov edx, dword [esi - 4]
xor ecx, ebx
mov ebx, dword [eax*4 + 0x409f80]
xor ecx, ebx
xor eax, eax
xor ecx, edx
xor edx, edx
mov dl, ch
mov dword [esp + 0x18], ecx
mov al, byte [esp + 0x1a]
mov ebx, dword [edx*4 + 0x409b80]
mov edx, ecx
mov eax, dword [eax*4 + 0x409780]
and ecx, 0xff
shr edx, 0x18
xor eax, ebx
mov ebx, dword [edx*4 + 0x409380]
xor eax, ebx
mov ebx, dword [ecx*4 + 0x409f80]
xor eax, ebx
dec ebp
jne 0x406789
cmp edi, 4
jb 0x4069f8
mov ebp, edi
shr ebp, 2
mov edx, dword [esi]
xor ecx, ecx
xor eax, edx
xor edx, edx
mov dl, ah
mov dword [esp + 0x18], eax
mov cl, byte [esp + 0x1a]
add esi, 4
mov ebx, dword [edx*4 + 0x409b80]
mov edx, eax
mov ecx, dword [ecx*4 + 0x409780]
and eax, 0xff
shr edx, 0x18
xor ecx, ebx
sub edi, 4
mov ebx, dword [edx*4 + 0x409380]
xor ecx, ebx
mov ebx, dword [eax*4 + 0x409f80]
xor ecx, ebx
dec ebp
mov eax, ecx
jne 0x4069af
test edi, edi
je 0x406a1a
mov ecx, eax
xor edx, edx
mov dl, byte [esi]
and ecx, 0xff
xor ecx, edx
shr eax, 8
mov ecx, dword [ecx*4 + 0x409380]
xor eax, ecx
inc esi
dec edi
jne 0x4069fc
pop edi
pop esi
pop ebp
pop ebx
not eax
ret