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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, dword [eax + 0x14]
push edi
push 4
push esi
mov dword [ebp - 0x24], esi
call sym.postgres.exe_pq_getmsgint
mov edi, eax
add esp, 8
mov dword [ebp - 0x20], edi
cmp edi, 0x5555555
jbe 0x64b84d
push 0x74d648
push 0x348
push str.src_backendutils_adt_tsquery.c
call sym.postgres.exe_elog_start
push str.invalid_size_of_tsquery
push 0x14
call sym.postgres.exe_elog_finish
add esp, 0x14
mov edx, dword [sym.postgres.exe_CurrentMemoryContext]
lea ecx, [edi*4]
push ecx
push edx
call sym.postgres.exe_MemoryContextAlloc
mov dword [ebp - 0x10], eax
lea eax, [edi + edi*2]
lea eax, [eax*4 + 8]
push eax
mov dword [ebp - 0x28], eax
mov eax, dword [sym.postgres.exe_CurrentMemoryContext]
push eax
call sym.postgres.exe_MemoryContextAllocZero
xor ecx, ecx
add esp, 0x10
lea ebx, [eax + 8]
mov dword [ebp - 0x14], eax
mov dword [eax + 4], edi
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], ecx
cmp edi, ecx
jbe 0x64ba97
lea esp, [esp]
push 1
push esi
call sym.postgres.exe_pq_getmsgint
add esp, 8
mov byte [ebx], al
cmp al, 1
jne 0x64b9dc
push 1
push esi
call sym.postgres.exe_pq_getmsgint
push 1
push esi
mov byte [ebp + 0xb], al
call sym.postgres.exe_pq_getmsgint
push esi
mov byte [ebp - 1], al
call sym.postgres.exe_pq_getmsgstring
mov esi, eax
add esp, 0x14
mov dword [ebp - 0x1c], esi
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x64b8e0
sub eax, edx
cmp byte [ebp + 0xb], 0xf
mov edi, eax
jbe 0x64b914
push 0x74d648
push 0x368
push str.src_backendutils_adt_tsquery.c
call sym.postgres.exe_elog_start
push str.invalid_tsquery:_invalid_weight_bitmap
push 0x14
call sym.postgres.exe_elog_finish
add esp, 0x14
cmp edi, 0x7ff
jbe 0x64b93f
push 0x74d648
push 0x36b
push str.src_backendutils_adt_tsquery.c
call sym.postgres.exe_elog_start
push str.invalid_tsquery:_operand_too_long
push 0x14
call sym.postgres.exe_elog_finish
add esp, 0x14
cmp dword [ebp - 0xc], 0xfffff
jle 0x64b96b
push 0x74d648
push 0x36e
push str.src_backendutils_adt_tsquery.c
call sym.postgres.exe_elog_start
push str.invalid_tsquery:_total_operand_length_exceeded
push 0x14
call sym.postgres.exe_elog_finish
add esp, 0x14
or ecx, 0xffffffff
mov edx, edi
test edi, edi
je 0x64b997
movzx ebx, byte [esi]
mov eax, ecx
shr eax, 0x18
xor eax, ebx
and eax, 0xff
shl ecx, 8
xor ecx, dword [eax*4 + sym.postgres.exe_pg_crc32_table]
inc esi
dec edx
jne 0x64b974
mov ebx, dword [ebp - 0x18]
mov esi, dword [ebp - 0x1c]
cmp byte [ebp - 1], 0
mov dl, byte [ebp + 0xb]
setne al
not ecx
mov byte [ebx + 2], al
mov eax, dword [ebp - 0xc]
mov dword [ebx + 4], ecx
mov byte [ebx + 1], dl
mov ecx, edi
mov edx, eax
and ecx, 0xfff
shl edx, 0xc
or ecx, edx
mov edx, dword [ebp - 8]
mov dword [ebx + 8], ecx
mov ecx, dword [ebp - 0x10]
lea eax, [eax + edi + 1]
mov edi, dword [ebp - 0x20]
mov dword [ecx + edx*4], esi
mov esi, dword [ebp - 0x24]
mov dword [ebp - 0xc], eax
jmp 0x64ba7f
cmp al, 2
jne 0x64ba58
push 1
push esi
call sym.postgres.exe_pq_getmsgint
add esp, 8
mov byte [ebp + 0xb], al
cmp al, 1
je 0x64ba25
cmp al, 3
je 0x64ba25
cmp al, 2
je 0x64ba25
push 0x74d648
push 0x38a
push str.src_backendutils_adt_tsquery.c
call sym.postgres.exe_elog_start
movsx ecx, byte [ebp + 0xb]
push ecx
push str.invalid_tsquery:_unrecognized_operator_type__d
push 0x14
call sym.postgres.exe_elog_finish
mov al, byte [ebp + 0xb]
add esp, 0x18
lea edx, [edi - 1]
cmp dword [ebp - 8], edx
jne 0x64ba53
push 0x74d648
push 0x38d
push str.src_backendutils_adt_tsquery.c
call sym.postgres.exe_elog_start
push str.invalid_pointer_to_right_operand
push 0x14
call sym.postgres.exe_elog_finish
mov al, byte [ebp + 0xb]
add esp, 0x14
mov byte [ebx + 1], al
jmp 0x64ba7f
push 0x74d648
push 0x392
push str.src_backendutils_adt_tsquery.c
call sym.postgres.exe_elog_start
movsx eax, byte [ebx]
push eax
push str.unrecognized_tsquery_node_type:__d
push 0x14
call sym.postgres.exe_elog_finish
add esp, 0x18
mov eax, dword [ebp - 8]
inc eax
add ebx, 0xc
mov dword [ebp - 0x18], ebx
mov dword [ebp - 8], eax
cmp eax, edi
jb 0x64b8a0
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x28]
add ecx, dword [ebp - 0xc]
push ecx
push eax
mov dword [ebp - 0x28], ecx
call sym.postgres.exe_repalloc
mov ecx, dword [eax + 4]
push edi
lea edx, [ebp + 8]
lea esi, [eax + 8]
push edx
lea ecx, [ecx + ecx*2]
push esi
mov dword [ebp - 0x14], eax
lea ebx, [eax + ecx*4 + 8]
mov dword [ebp + 8], 0
call fcn.0064aea0
add esp, 0x14
cmp dword [ebp + 8], edi
je 0x64baf4
push str.findoprnd
push 0x1c7
push str.src_backendutils_adt_tsquery.c
call sym.postgres.exe_elog_start
push str.malformed_tsquery:_extra_nodes
push 0x14
call sym.postgres.exe_elog_finish
add esp, 0x14
xor eax, eax
mov dword [ebp - 8], eax
test edi, edi
je 0x64bb3b
lea ecx, [ecx]
cmp byte [esi], 1
jne 0x64bb30
mov ecx, dword [esi + 8]
mov edx, dword [ebp - 0x10]
mov eax, dword [edx + eax*4]
and ecx, 0xfff
inc ecx
push ecx
push eax
push ebx
call sub.MSVCR100.dll_memcpy
mov ecx, dword [esi + 8]
mov eax, dword [ebp - 8]
add esp, 0xc
and ecx, 0xfff
lea ebx, [ebx + ecx + 1]
inc eax
add esi, 0xc
mov dword [ebp - 8], eax
cmp eax, edi
jb 0x64bb00
mov edx, dword [ebp - 0x10]
push edx
call sym.postgres.exe_pfree
mov eax, dword [ebp - 0x28]
add esp, 4
pop edi
lea ecx, [eax*4]
mov eax, dword [ebp - 0x14]
pop esi
mov dword [eax], ecx
pop ebx
mov esp, ebp
pop ebp
ret