Function at 0x5ba8b0
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
push ebx
push esi
mov esi, dword [ebp + 8]
movzx ebx, word [esi + 0xc]
movzx eax, word [esi + 0x10]
push edi
movzx edi, word [esi + 0xe]
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x20], edi
mov dword [ebp - 4], eax
cmp ebx, 0x18
jb 0x5ba8ef
cmp ebx, edi
jg 0x5ba8ef
cmp edi, eax
jg 0x5ba8ef
cmp eax, 0x2000
jg 0x5ba8ef
lea ecx, [eax + 7]
and ecx, 0xfffffff8
cmp eax, ecx
je 0x5ba938
push 0
push 0x73c7fc
push 0x186
push str.src_backend_storagepage_bufpage.c
push 0x14
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x5ba938
mov edx, dword [ebp - 4]
push edx
push edi
push ebx
push str.corrupted_page_pointers:_lower___u__upper___u__special___u
call sym.postgres.exe_errmsg
add esp, 0x10
push eax
push 0x1000a28
call sym.postgres.exe_errcode
add esp, 4
push eax
call sym.postgres.exe_errfinish
add esp, 8
movzx eax, word [esi + 0xc]
cmp eax, 0x18
ja 0x5ba948
xor ebx, ebx
mov dword [ebp - 0xc], ebx
jmp 0x5ba953
lea eax, [eax - 0x18]
shr eax, 2
mov dword [ebp - 0xc], eax
mov ebx, eax
xor esi, esi
xor edx, edx
cmp ebx, 1
jl 0x5ba99c
mov eax, dword [ebp + 8]
add eax, 0x18
mov dword [ebp - 0x1c], eax
mov edi, ebx
jmp 0x5ba970
mov ecx, dword [eax]
test ecx, 0x18000
je 0x5ba985
test ecx, 0xfffe0000
je 0x5ba98c
inc esi
jmp 0x5ba98c
mov dword [eax], 0
inc edx
add eax, 4
dec edi
jne 0x5ba970
mov dword [ebp - 0x18], edx
mov dword [ebp - 0x10], esi
test esi, esi
jne 0x5ba9ac
mov cx, word [ebp - 4]
mov eax, dword [ebp + 8]
mov word [eax + 0xe], cx
jmp 0x5bab28
mov eax, dword [sym.postgres.exe_CurrentMemoryContext]
mov edx, esi
shl edx, 4
push edx
push eax
call sym.postgres.exe_MemoryContextAlloc
xor edi, edi
add esp, 8
mov dword [ebp - 0x14], eax
mov dword [ebp - 8], edi
test ebx, ebx
jle 0x5baa5e
mov ebx, dword [ebp - 0x1c]
lea esi, [eax + 4]
test dword [ebx], 0xfffe0000
je 0x5baa4e
mov dword [esi - 4], edi
mov eax, dword [ebx]
and eax, 0x7fff
mov dword [esi], eax
cmp eax, dword [ebp - 0x20]
jl 0x5ba9f4
cmp eax, dword [ebp - 4]
jl 0x5baa3a
push 0
push 0x73c7fc
push 0x1b1
push str.src_backend_storagepage_bufpage.c
push 0x14
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x5baa3a
mov ecx, dword [esi]
push ecx
push str.corrupted_item_pointer:__u
call sym.postgres.exe_errmsg
add esp, 8
push eax
push 0x1000a28
call sym.postgres.exe_errcode
add esp, 4
push eax
call sym.postgres.exe_errfinish
add esp, 8
mov eax, dword [ebx]
shr eax, 0x11
add eax, 7
and eax, 0xfffffff8
add dword [ebp - 8], eax
mov dword [esi + 4], eax
add esi, 0x10
inc edi
add ebx, 4
cmp edi, dword [ebp - 0xc]
jl 0x5ba9d6
mov esi, dword [ebp - 0x10]
mov ebx, dword [ebp - 4]
mov edi, ebx
sub edi, dword [ebp - 0x24]
cmp dword [ebp - 8], edi
jbe 0x5baab3
push 0
push 0x73c7fc
push 0x1bc
push str.src_backend_storagepage_bufpage.c
push 0x14
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x5baab3
mov edx, dword [ebp - 8]
push edi
push edx
push str.corrupted_item_lengths:_total__u__available_space__u
call sym.postgres.exe_errmsg
add esp, 0xc
push eax
push 0x1000a28
call sym.postgres.exe_errcode
add esp, 4
push eax
call sym.postgres.exe_errfinish
add esp, 8
mov eax, dword [ebp - 0x14]
push 0x5ba890
push 0x10
push esi
push eax
call sym.postgres.exe_pg_qsort
add esp, 0x10
test esi, esi
jle 0x5bab0f
mov esi, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x10]
add esi, 8
mov dword [ebp - 0x10], ecx
mov edx, dword [esi - 8]
mov eax, dword [ebp + 8]
mov ecx, dword [esi - 4]
lea edi, [eax + edx*4 + 0x18]
mov eax, dword [esi]
push eax
sub ebx, eax
mov eax, dword [ebp + 8]
add ecx, eax
push ecx
lea edx, [ebx + eax]
push edx
call dword [sym.imp.MSVCR100.dll_memmove]
mov eax, dword [edi]
xor eax, ebx
and eax, 0x7fff
xor dword [edi], eax
add esp, 0xc
add esi, 0x10
dec dword [ebp - 0x10]
jne 0x5baad7
mov edx, dword [ebp - 0x14]
mov ecx, dword [ebp + 8]
push edx
mov word [ecx + 0xe], bx
call sym.postgres.exe_pfree
mov edx, dword [ebp - 0x18]
mov eax, dword [ebp + 8]
add esp, 4
pop edi
pop esi
pop ebx
test edx, edx
jle 0x5bab38
or word [eax + 0xa], 1
mov esp, ebp
pop ebp
ret
mov ecx, 0xfffe
and word [eax + 0xa], cx
mov esp, ebp
pop ebp
ret