Function at 0x66bf20
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x438
mov eax, dword [0x82aea4]
xor eax, ebp
mov dword [ebp - 4], eax
cmp byte [ebp + 8], 0
push str.pg_internal.init
je 0x66bf59
push str.global__s
lea eax, [ebp - 0x404]
push 0x400
push eax
call sym.postgres.exe_pg_snprintf
add esp, 0x10
jmp 0x66bf79
mov ecx, dword [sym.postgres.exe_DatabasePath]
push ecx
push 0x6b04b0
lea edx, [ebp - 0x404]
push 0x400
push edx
call sym.postgres.exe_pg_snprintf
add esp, 0x14
push ebx
push edi
lea eax, [ebp - 0x404]
push 0x6bf9bc
push eax
call sym.postgres.exe_AllocateFile
mov edi, eax
xor ebx, ebx
add esp, 8
mov dword [ebp - 0x438], edi
cmp edi, ebx
jne 0x66bfaf
pop edi
xor al, al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret
mov ecx, dword [sym.postgres.exe_CurrentMemoryContext]
push esi
push 0x190
push ecx
mov dword [ebp - 0x430], 0x64
call sym.postgres.exe_MemoryContextAlloc
push edi
push 4
lea edx, [ebp - 0x434]
mov esi, eax
push 1
mov dword [ebp - 0x418], ebx
mov dword [ebp - 0x428], ebx
mov dword [ebp - 0x420], ebx
mov ebx, dword [sym.imp.MSVCR100.dll_fread]
push edx
mov dword [ebp - 0x41c], esi
call ebx
add esp, 0x18
cmp eax, 4
jne 0x66c70e
cmp dword [ebp - 0x434], 0x573266
jne 0x66c70e
push edi
push eax
lea eax, [ebp - 0x408]
push 1
push eax
call ebx
add esp, 0x10
cmp eax, 4
jne 0x66c619
mov edi, edi
cmp dword [ebp - 0x408], 0xa0
jne 0x66c70e
mov eax, dword [ebp - 0x430]
cmp dword [ebp - 0x418], eax
jl 0x66c06d
add eax, eax
lea ecx, [eax*4]
push ecx
push esi
mov dword [ebp - 0x430], eax
call sym.postgres.exe_repalloc
add esp, 8
mov dword [ebp - 0x41c], eax
mov edx, dword [ebp - 0x408]
mov eax, dword [sym.postgres.exe_CurrentMemoryContext]
push edx
push eax
call sym.postgres.exe_MemoryContextAlloc
mov ecx, dword [ebp - 0x41c]
mov esi, eax
mov eax, dword [ebp - 0x418]
mov dword [ecx + eax*4], esi
mov edx, dword [ebp - 0x408]
push edi
push edx
inc eax
push 1
push esi
mov dword [ebp - 0x418], eax
call ebx
add esp, 0x18
cmp eax, dword [ebp - 0x408]
jne 0x66c708
push edi
push 4
lea eax, [ebp - 0x408]
push 1
push eax
call ebx
add esp, 0x10
cmp eax, 4
jne 0x66c708
mov ecx, dword [ebp - 0x408]
mov edx, dword [sym.postgres.exe_CurrentMemoryContext]
push ecx
push edx
call sym.postgres.exe_MemoryContextAlloc
mov ecx, dword [ebp - 0x408]
push edi
push ecx
push 1
push eax
mov dword [ebp - 0x424], eax
call ebx
add esp, 0x18
cmp eax, dword [ebp - 0x408]
jne 0x66c708
mov eax, dword [ebp - 0x424]
mov dword [esi + 0x24], eax
movzx edx, byte [eax + 0x78]
movsx eax, word [eax + 0x74]
push edx
push eax
call sym.postgres.exe_CreateTemplateTupleDesc
mov dword [esi + 0x28], eax
mov dword [eax + 0x18], 1
mov eax, dword [ebp - 0x424]
mov ecx, dword [esi + 0x28]
mov edx, dword [eax + 0x44]
mov dword [ecx + 0xc], edx
mov ecx, dword [esi + 0x28]
xor edx, edx
add esp, 8
mov dword [ecx + 0x10], 0xffffffff
mov byte [ebp - 0x409], 0
mov dword [ebp - 0x410], 0
cmp dx, word [eax + 0x74]
jge 0x66c1da
lea ecx, [ecx]
push edi
push 4
lea eax, [ebp - 0x408]
push 1
push eax
call ebx
add esp, 0x10
cmp eax, 4
jne 0x66c708
cmp dword [ebp - 0x408], 0x6c
jne 0x66c708
mov ecx, dword [esi + 0x28]
mov edx, dword [ecx + 4]
mov eax, dword [ebp - 0x410]
mov ecx, dword [edx + eax*4]
push edi
push 0x6c
push 1
push ecx
call ebx
add esp, 0x10
cmp eax, dword [ebp - 0x408]
jne 0x66c708
mov edx, dword [esi + 0x28]
mov ecx, dword [edx + 4]
mov eax, dword [ebp - 0x410]
mov edx, dword [ecx + eax*4]
mov cl, byte [edx + 0x5f]
or byte [ebp - 0x409], cl
mov edx, dword [ebp - 0x424]
movsx ecx, word [edx + 0x74]
inc eax
mov dword [ebp - 0x410], eax
cmp eax, ecx
jl 0x66c160
push edi
push 4
lea edx, [ebp - 0x408]
push 1
push edx
call ebx
add esp, 0x10
cmp eax, 4
jne 0x66c708
mov ecx, dword [ebp - 0x408]
xor eax, eax
cmp ecx, eax
jbe 0x66c241
mov eax, dword [sym.postgres.exe_CurrentMemoryContext]
push ecx
push eax
call sym.postgres.exe_MemoryContextAlloc
mov dword [esi + 0x50], eax
mov ecx, dword [ebp - 0x408]
push edi
push ecx
push 1
push eax
call ebx
mov ecx, dword [ebp - 0x408]
add esp, 0x18
cmp eax, ecx
jne 0x66c708
mov edx, dword [esi + 0x50]
mov eax, dword [edx]
shr eax, 2
cmp ecx, eax
jne 0x66c708
xor eax, eax
jmp 0x66c244
mov dword [esi + 0x50], eax
cmp byte [ebp - 0x409], 0
je 0x66c26a
mov ecx, dword [sym.postgres.exe_CurrentMemoryContext]
push 0x10
push ecx
call sym.postgres.exe_MemoryContextAllocZero
mov byte [eax + 0xc], 1
mov edx, dword [esi + 0x28]
add esp, 8
mov dword [edx + 8], eax
xor eax, eax
mov ecx, dword [esi + 0x24]
cmp byte [ecx + 0x73], 0x69
jne 0x66c56e
cmp byte [esi + 0x18], 0
je 0x66c283
inc dword [ebp - 0x428]
push edi
push 4
lea edx, [ebp - 0x408]
push 1
push edx
call ebx
add esp, 0x10
cmp eax, 4
jne 0x66c708
mov eax, dword [ebp - 0x408]
mov ecx, dword [sym.postgres.exe_CurrentMemoryContext]
push eax
push ecx
call sym.postgres.exe_MemoryContextAlloc
mov dword [esi + 0x58], eax
mov edx, dword [ebp - 0x408]
push edi
push edx
push 1
push eax
call ebx
add esp, 0x18
cmp eax, dword [ebp - 0x408]
jne 0x66c708
mov eax, dword [esi + 0x58]
lea ecx, [eax + 0x18]
mov dword [eax + 0x10], ecx
mov edx, dword [esi + 0x58]
mov eax, dword [edx + 0x10]
movzx ecx, byte [eax + 0x16]
push edi
push 4
lea edx, [ebp - 0x408]
add ecx, eax
push 1
push edx
mov dword [esi + 0x54], ecx
call ebx
add esp, 0x10
cmp eax, 4
jne 0x66c708
mov eax, dword [ebp - 0x408]
mov ecx, dword [sym.postgres.exe_CurrentMemoryContext]
push eax
push ecx
call sym.postgres.exe_MemoryContextAlloc
mov edx, dword [ebp - 0x408]
push edi
push edx
push 1
push eax
mov dword [ebp - 0x42c], eax
call ebx
add esp, 0x18
cmp eax, dword [ebp - 0x408]
jne 0x66c708
mov eax, dword [ebp - 0x42c]
mov ecx, dword [esi + 0x24]
push 0x2000
push 0x400
push 0
mov dword [esi + 0x5c], eax
mov edx, dword [sym.postgres.exe_CacheMemoryContext]
push ecx
push edx
call sym.postgres.exe_AllocSetContextCreate
push edi
push 4
mov dword [ebp - 0x410], eax
mov dword [esi + 0x60], eax
lea eax, [ebp - 0x408]
push 1
push eax
call ebx
add esp, 0x24
cmp eax, 4
jne 0x66c708
mov ecx, dword [ebp - 0x408]
mov edx, dword [ebp - 0x410]
push ecx
push edx
call sym.postgres.exe_MemoryContextAlloc
mov ecx, dword [ebp - 0x408]
push edi
push ecx
push 1
push eax
mov dword [ebp - 0x414], eax
call ebx
add esp, 0x18
cmp eax, dword [ebp - 0x408]
jne 0x66c708
mov edx, dword [ebp - 0x414]
push edi
push 4
lea eax, [ebp - 0x408]
push 1
push eax
mov dword [esi + 0x68], edx
call ebx
add esp, 0x10
cmp eax, 4
jne 0x66c708
mov ecx, dword [ebp - 0x408]
mov edx, dword [ebp - 0x410]
push ecx
push edx
call sym.postgres.exe_MemoryContextAlloc
mov ecx, dword [ebp - 0x408]
push edi
push ecx
push 1
push eax
mov dword [ebp - 0x414], eax
call ebx
add esp, 0x18
cmp eax, dword [ebp - 0x408]
jne 0x66c708
mov edx, dword [ebp - 0x414]
push edi
push 4
lea eax, [ebp - 0x408]
push 1
push eax
mov dword [esi + 0x6c], edx
call ebx
add esp, 0x10
cmp eax, 4
jne 0x66c708
mov ecx, dword [ebp - 0x408]
mov edx, dword [ebp - 0x410]
push ecx
push edx
call sym.postgres.exe_MemoryContextAlloc
mov ecx, dword [ebp - 0x408]
push edi
push ecx
push 1
push eax
mov dword [ebp - 0x414], eax
call ebx
add esp, 0x18
cmp eax, dword [ebp - 0x408]
jne 0x66c708
mov edx, dword [ebp - 0x414]
push edi
push 4
lea eax, [ebp - 0x408]
push 1
push eax
mov dword [esi + 0x70], edx
call ebx
add esp, 0x10
cmp eax, 4
jne 0x66c708
mov ecx, dword [ebp - 0x408]
mov edx, dword [ebp - 0x410]
push ecx
push edx
call sym.postgres.exe_MemoryContextAlloc
mov ecx, dword [ebp - 0x408]
push edi
push ecx
push 1
push eax
mov dword [ebp - 0x414], eax
call ebx
add esp, 0x18
cmp eax, dword [ebp - 0x408]
jne 0x66c708
mov edx, dword [ebp - 0x414]
push edi
push 4
lea eax, [ebp - 0x408]
push 1
push eax
mov dword [esi + 0x94], edx
call ebx
add esp, 0x10
cmp eax, 4
jne 0x66c708
mov ecx, dword [ebp - 0x408]
mov edx, dword [ebp - 0x410]
push ecx
push edx
call sym.postgres.exe_MemoryContextAlloc
mov ecx, dword [ebp - 0x408]
push edi
push ecx
push 1
push eax
mov dword [ebp - 0x414], eax
call ebx
add esp, 0x18
cmp eax, dword [ebp - 0x408]
jne 0x66c708
mov eax, dword [ebp - 0x410]
mov edx, dword [ebp - 0x414]
push 0x1a4
push eax
mov dword [esi + 0x78], edx
call sym.postgres.exe_MemoryContextAllocZero
mov ecx, dword [ebp - 0x42c]
mov edx, dword [ebp - 0x424]
mov dword [esi + 0x64], eax
movsx eax, word [ecx + 0x42]
movsx ecx, word [edx + 0x74]
imul eax, ecx
lea edx, [eax*8]
sub edx, eax
mov eax, dword [ebp - 0x410]
add edx, edx
add edx, edx
push edx
push eax
call sym.postgres.exe_MemoryContextAllocZero
add esp, 0x10
mov dword [esi + 0x74], eax
xor eax, eax
jmp 0x66c57a
cmp byte [esi + 0x18], 0
je 0x66c57a
inc dword [ebp - 0x420]
xor ecx, ecx
cmp byte [esi + 0x18], cl
lea edx, [esi + 0x9c]
setne cl
mov dword [esi + 0x44], eax
mov dword [esi + 0x48], eax
mov dword [esi + 0x4c], eax
mov dword [esi + 0x7c], eax
mov dword [esi + 0x80], eax
mov dword [esi + 0x84], eax
mov dword [esi + 0x88], eax
mov dword [esi + 0x8c], eax
mov dword [esi + 0xc], eax
mov dword [esi + 0x10], ecx
mov byte [esi + 0x1a], 0
mov dword [esi + 0x30], eax
mov dword [esi + 0x34], eax
mov dword [esi + 0x38], eax
mov dword [esi + 0x1c], eax
mov dword [esi + 0x20], eax
mov dword [esi + 0x90], eax
test dl, 3
jne 0x66c5ec
lea ecx, [edx + 4]
cmp edx, ecx
jae 0x66c5ee
sub ecx, edx
dec ecx
shr ecx, 2
inc ecx
xor eax, eax
mov edi, edx
rep stosd dword es:[edi], eax
mov edi, dword [ebp - 0x438]
jmp 0x66c5ee
mov dword [edx], eax
push esi
call sym.postgres.exe_RelationInitLockInfo
call fcn.0066a530
push edi
push 4
lea edx, [ebp - 0x408]
push 1
push edx
call ebx
mov esi, dword [ebp - 0x41c]
add esp, 0x14
cmp eax, 4
je 0x66c030
test eax, eax
jne 0x66c70e
cmp byte [ebp + 8], al
je 0x66c641
cmp dword [ebp - 0x420], 3
jne 0x66c70e
cmp dword [ebp - 0x428], 5
je 0x66c65b
jmp 0x66c70e
cmp dword [ebp - 0x420], 4
jne 0x66c70e
cmp dword [ebp - 0x428], 7
jne 0x66c70e
xor ebx, ebx
cmp dword [ebp - 0x418], ebx
jle 0x66c6bf
jmp 0x66c670
mov ecx, dword [esi + ebx*4]
mov edx, dword [0x85e228]
lea eax, [ebp - 0x409]
push eax
push 1
add ecx, 0x2c
push ecx
push edx
call sym.postgres.exe_hash_search
mov ecx, dword [esi + ebx*4]
add esp, 0x10
cmp byte [ebp + 8], 0
mov dword [eax + 4], ecx
jne 0x66c6b6
mov edx, dword [0x85e234]
mov eax, dword [esi + ebx*4]
mov ecx, dword [eax + 0x2c]
push edx
push ecx
call sym.postgres.exe_lcons_oid
add esp, 8
mov dword [0x85e234], eax
inc ebx
cmp ebx, dword [ebp - 0x418]
jl 0x66c670
push esi
call sym.postgres.exe_pfree
push edi
call sym.postgres.exe_FreeFile
add esp, 8
cmp byte [ebp + 8], 0
je 0x66c6ee
pop esi
pop edi
mov byte [sym.postgres.exe_criticalSharedRelcachesBuilt], 1
mov al, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret
pop esi
pop edi
mov byte [sym.postgres.exe_criticalRelcachesBuilt], 1
mov al, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp - 0x41c]
push esi
call sym.postgres.exe_pfree
push edi
call sym.postgres.exe_FreeFile
mov ecx, dword [ebp - 4]
add esp, 8
pop esi
pop edi
xor ecx, ebp
xor al, al
pop ebx
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret