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

Disassembly:
push ecx
push ebx
push esi
mov esi, edx
test esi, esi
not eax
je 0x5120d1
jmp 0x5120b0
test cl, 3
je 0x5120d1
xor edx, edx
mov dl, byte [ecx]
xor edx, eax
and edx, 0xff
mov ebx, dword [edx*4 + 0x57efd8]
shr eax, 8
xor eax, ebx
inc ecx
dec esi
jne 0x5120b0
cmp esi, 0x20
push ebp
push edi
jb 0x5122f7
mov edi, esi
shr edi, 5
xor eax, dword [ecx]
mov edx, eax
shr edx, 0x10
movzx ebx, ah
mov ebp, dword [ebx*4 + 0x57f7d8]
movzx edx, dl
mov edx, dword [edx*4 + 0x57f3d8]
xor edx, ebp
mov ebx, eax
mov dword [esp + 0x10], eax
shr ebx, 0x18
mov ebp, dword [ebx*4 + 0x57efd8]
mov ebx, dword [ecx + 4]
xor edx, ebp
and eax, 0xff
xor edx, dword [eax*4 + 0x57fbd8]
xor edx, ebx
mov eax, edx
shr eax, 0x10
movzx ebx, dh
mov ebp, dword [ebx*4 + 0x57f7d8]
add ecx, 4
movzx eax, al
mov eax, dword [eax*4 + 0x57f3d8]
xor eax, ebp
mov ebx, edx
mov dword [esp + 0x10], edx
shr ebx, 0x18
mov ebp, dword [ebx*4 + 0x57efd8]
mov ebx, dword [ecx + 4]
xor eax, ebp
and edx, 0xff
xor eax, dword [edx*4 + 0x57fbd8]
xor eax, ebx
add ecx, 4
mov edx, eax
shr edx, 0x10
movzx ebx, ah
mov ebp, dword [ebx*4 + 0x57f7d8]
movzx edx, dl
mov edx, dword [edx*4 + 0x57f3d8]
xor edx, ebp
mov ebx, eax
mov dword [esp + 0x10], eax
shr ebx, 0x18
mov ebp, dword [ebx*4 + 0x57efd8]
mov ebx, dword [ecx + 4]
xor edx, ebp
and eax, 0xff
xor edx, dword [eax*4 + 0x57fbd8]
xor edx, ebx
add ecx, 4
mov eax, edx
shr eax, 0x10
movzx ebx, dh
mov ebp, dword [ebx*4 + 0x57f7d8]
movzx eax, al
mov eax, dword [eax*4 + 0x57f3d8]
mov ebx, edx
xor eax, ebp
mov dword [esp + 0x10], edx
shr ebx, 0x18
mov ebp, dword [ebx*4 + 0x57efd8]
mov ebx, dword [ecx + 4]
and edx, 0xff
xor eax, ebp
mov ebp, dword [edx*4 + 0x57fbd8]
add ecx, 4
xor eax, ebp
xor eax, ebx
mov edx, eax
add ecx, 4
shr edx, 0x10
movzx edx, dl
mov edx, dword [edx*4 + 0x57f3d8]
mov dword [esp + 0x10], eax
movzx ebx, ah
xor edx, dword [ebx*4 + 0x57f7d8]
mov ebx, eax
shr ebx, 0x18
mov ebp, dword [ebx*4 + 0x57efd8]
mov ebx, dword [ecx]
xor edx, ebp
and eax, 0xff
xor edx, dword [eax*4 + 0x57fbd8]
xor edx, ebx
mov eax, edx
shr eax, 0x10
movzx ebx, dh
mov ebp, dword [ebx*4 + 0x57f7d8]
movzx eax, al
mov eax, dword [eax*4 + 0x57f3d8]
xor eax, ebp
mov ebx, edx
shr ebx, 0x18
mov ebp, dword [ebx*4 + 0x57efd8]
mov ebx, dword [ecx + 4]
xor eax, ebp
mov dword [esp + 0x10], edx
and edx, 0xff
xor eax, dword [edx*4 + 0x57fbd8]
xor eax, ebx
add ecx, 4
mov edx, eax
movzx ebx, ah
mov ebp, dword [ebx*4 + 0x57f7d8]
shr edx, 0x10
movzx edx, dl
mov edx, dword [edx*4 + 0x57f3d8]
mov ebx, eax
xor edx, ebp
mov dword [esp + 0x10], eax
shr ebx, 0x18
mov ebp, dword [ebx*4 + 0x57efd8]
mov ebx, dword [ecx + 4]
and eax, 0xff
xor edx, ebp
mov ebp, dword [eax*4 + 0x57fbd8]
add ecx, 4
xor edx, ebp
xor edx, ebx
mov eax, edx
shr eax, 0x10
movzx ebx, dh
mov ebp, dword [ebx*4 + 0x57f7d8]
movzx eax, al
mov eax, dword [eax*4 + 0x57f3d8]
mov ebx, edx
xor eax, ebp
shr ebx, 0x18
mov ebp, dword [ebx*4 + 0x57efd8]
mov dword [esp + 0x10], edx
and edx, 0xff
mov ebx, dword [edx*4 + 0x57fbd8]
xor eax, ebp
add ecx, 4
xor eax, ebx
sub esi, 0x20
dec edi
jne 0x5120e1
cmp esi, 4
jb 0x512344
mov edx, esi
shr edx, 2
xor eax, dword [ecx]
movzx ebx, ah
mov ebp, dword [ebx*4 + 0x57f7d8]
mov dword [esp + 0x10], eax
movzx edi, byte [esp + 0x12]
mov edi, dword [edi*4 + 0x57f3d8]
mov ebx, eax
xor edi, ebp
shr ebx, 0x18
mov ebp, dword [ebx*4 + 0x57efd8]
and eax, 0xff
xor edi, ebp
xor edi, dword [eax*4 + 0x57fbd8]
add ecx, 4
sub esi, 4
dec edx
mov eax, edi
jne 0x512301
test esi, esi
pop edi
pop ebp
je 0x51236c
lea ebx, [ebx]
xor edx, edx
mov dl, byte [ecx]
xor edx, eax
and edx, 0xff
mov ebx, dword [edx*4 + 0x57efd8]
shr eax, 8
xor eax, ebx
inc ecx
dec esi
jne 0x512350
pop esi
not eax
pop ebx
pop ecx
ret
mov ecx, dword [esp + 8]
test ecx, ecx
jne 0x51238b
xor eax, eax
ret
mov edx, dword [esp + 0xc]
mov eax, dword [esp + 4]
jmp 0x5120a0