Function at 0x66d690
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x820
mov eax, dword [0x82aea4]
xor eax, ebp
mov dword [ebp - 4], eax
cmp byte [ebp + 8], 0
mov eax, dword [sym.postgres.exe_MyProcPid]
push eax
push str.pg_internal.init
je 0x66d6ea
push str.global__s._d
lea ecx, [ebp - 0x404]
push 0x400
push ecx
call sym.postgres.exe_pg_snprintf
push str.pg_internal.init
push str.global__s
lea edx, [ebp - 0x804]
push 0x400
push edx
call sym.postgres.exe_pg_snprintf
add esp, 0x24
jmp 0x66d72b
mov ecx, dword [sym.postgres.exe_DatabasePath]
push ecx
push str._s__s._d
lea edx, [ebp - 0x404]
push 0x400
push edx
call sym.postgres.exe_pg_snprintf
mov eax, dword [sym.postgres.exe_DatabasePath]
push str.pg_internal.init
push eax
push 0x6b04b0
lea ecx, [ebp - 0x804]
push 0x400
push ecx
call sym.postgres.exe_pg_snprintf
add esp, 0x2c
lea edx, [ebp - 0x404]
push esi
push edx
call sym.postgres.exe_pgunlink
lea eax, [ebp - 0x404]
push 0x6bf728
push eax
call sym.postgres.exe_AllocateFile
mov esi, eax
add esp, 0xc
test esi, esi
jne 0x66d7b4
push eax
push str.write_relcache_init_file
push 0x10f6
push str.src_backendutilscache_relcache.c
push 0x13
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x66db3d
push str.Continuing_anyway__but_theres_something_wrong.
call sym.postgres.exe_errdetail
add esp, 4
push eax
lea ecx, [ebp - 0x404]
push ecx
push str.could_not_create_relation_cache_initialization_file___s_:__m
call sym.postgres.exe_errmsg
add esp, 8
push eax
call sym.postgres.exe_errcode_for_file_access
push eax
call sym.postgres.exe_errfinish
add esp, 0xc
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret
push esi
push 4
lea edx, [ebp - 0x814]
push 1
push edx
mov dword [ebp - 0x814], 0x573266
call dword [sym.imp.MSVCR100.dll_fwrite]
add esp, 0x10
cmp eax, 4
je 0x66d7fb
push str.write_relcache_init_file
push 0x1100
push str.src_backendutilscache_relcache.c
call sym.postgres.exe_elog_start
push str.could_not_write_init_file
push 0x15
call sym.postgres.exe_elog_finish
add esp, 0x14
mov eax, dword [0x85e228]
push eax
lea ecx, [ebp - 0x820]
push ecx
call sym.postgres.exe_hash_seq_init
lea edx, [ebp - 0x820]
push edx
call sym.postgres.exe_hash_seq_search
add esp, 0xc
test eax, eax
je 0x66dab7
push ebx
push edi
mov edi, dword [eax + 4]
mov ebx, dword [edi + 0x24]
mov al, byte [ebp + 8]
cmp byte [ebx + 0x71], al
jne 0x66da9e
push 0xa0
push edi
call fcn.0066c730
push 0x84
push ebx
call fcn.0066c730
xor ecx, ecx
add esp, 0x10
mov dword [ebp - 0x80c], 0
cmp cx, word [ebx + 0x74]
jge 0x66d921
mov edx, dword [edi + 0x28]
mov ecx, dword [ebp - 0x80c]
mov dword [ebp - 0x808], 0x6c
mov eax, dword [edx + 4]
mov edx, dword [eax + ecx*4]
push esi
push 4
lea eax, [ebp - 0x808]
push 1
push eax
mov dword [ebp - 0x810], edx
call dword [sym.imp.MSVCR100.dll_fwrite]
add esp, 0x10
cmp eax, 4
je 0x66d8c3
push str.write_item
push 0x1186
push str.src_backendutilscache_relcache.c
call sym.postgres.exe_elog_start
push str.could_not_write_init_file
push 0x15
call sym.postgres.exe_elog_finish
add esp, 0x14
mov ecx, dword [ebp - 0x808]
mov edx, dword [ebp - 0x810]
push esi
push ecx
push 1
push edx
call dword [sym.imp.MSVCR100.dll_fwrite]
add esp, 0x10
cmp eax, dword [ebp - 0x808]
je 0x66d908
push str.write_item
push 0x1188
push str.src_backendutilscache_relcache.c
call sym.postgres.exe_elog_start
push str.could_not_write_init_file
push 0x15
call sym.postgres.exe_elog_finish
add esp, 0x14
mov eax, dword [ebp - 0x80c]
movsx ecx, word [ebx + 0x74]
inc eax
mov dword [ebp - 0x80c], eax
cmp eax, ecx
jl 0x66d867
mov eax, dword [edi + 0x50]
mov dword [ebp - 0x810], eax
test eax, eax
je 0x66d93b
mov edx, dword [eax]
shr edx, 2
mov dword [ebp - 0x808], edx
jmp 0x66d945
mov dword [ebp - 0x808], 0
push esi
push 4
lea eax, [ebp - 0x808]
push 1
push eax
call dword [sym.imp.MSVCR100.dll_fwrite]
add esp, 0x10
cmp eax, 4
je 0x66d982
push str.write_item
push 0x1186
push str.src_backendutilscache_relcache.c
call sym.postgres.exe_elog_start
push str.could_not_write_init_file
push 0x15
call sym.postgres.exe_elog_finish
add esp, 0x14
mov ecx, dword [ebp - 0x808]
mov edx, dword [ebp - 0x810]
push esi
push ecx
push 1
push edx
call dword [sym.imp.MSVCR100.dll_fwrite]
add esp, 0x10
cmp eax, dword [ebp - 0x808]
je 0x66d9c7
push str.write_item
push 0x1188
push str.src_backendutilscache_relcache.c
call sym.postgres.exe_elog_start
push str.could_not_write_init_file
push 0x15
call sym.postgres.exe_elog_finish
add esp, 0x14
mov eax, dword [edi + 0x24]
cmp byte [eax + 0x73], 0x69
jne 0x66da68
mov eax, dword [edi + 0x58]
mov edx, dword [eax]
mov ecx, dword [edi + 0x5c]
add edx, 0x18
push edx
push eax
mov dword [ebp - 0x80c], ecx
call fcn.0066c730
mov eax, dword [ebp - 0x80c]
push 0x90
push eax
call fcn.0066c730
movsx ecx, word [ebx + 0x74]
mov edx, dword [edi + 0x68]
add ecx, ecx
add ecx, ecx
push ecx
push edx
call fcn.0066c730
movsx eax, word [ebx + 0x74]
mov ecx, dword [edi + 0x6c]
add eax, eax
add eax, eax
push eax
push ecx
call fcn.0066c730
mov edx, dword [ebp - 0x80c]
movsx eax, word [edx + 0x42]
movsx ecx, word [ebx + 0x74]
mov edx, dword [edi + 0x70]
imul eax, ecx
add eax, eax
add eax, eax
push eax
push edx
call fcn.0066c730
movsx eax, word [ebx + 0x74]
mov ecx, dword [edi + 0x94]
add eax, eax
add eax, eax
push eax
push ecx
call fcn.0066c730
movsx edx, word [ebx + 0x74]
mov eax, dword [edi + 0x78]
add edx, edx
push edx
push eax
call fcn.0066c730
add esp, 0x38
cmp byte [ebp + 8], 0
jne 0x66da9e
mov ecx, dword [sym.postgres.exe_CacheMemoryContext]
mov ebx, dword [sym.postgres.exe_CurrentMemoryContext]
mov edx, dword [0x85e234]
mov dword [sym.postgres.exe_CurrentMemoryContext], ecx
mov eax, dword [edi + 0x2c]
push edx
push eax
call sym.postgres.exe_lcons_oid
add esp, 8
mov dword [0x85e234], eax
mov dword [sym.postgres.exe_CurrentMemoryContext], ebx
lea ecx, [ebp - 0x820]
push ecx
call sym.postgres.exe_hash_seq_search
add esp, 4
test eax, eax
jne 0x66d826
pop edi
pop ebx
push esi
call sym.postgres.exe_FreeFile
add esp, 4
test eax, eax
je 0x66dae7
push str.write_relcache_init_file
push 0x1154
push str.src_backendutilscache_relcache.c
call sym.postgres.exe_elog_start
push str.could_not_write_init_file
push 0x15
call sym.postgres.exe_elog_finish
add esp, 0x14
push 0
push 0x10
call sym.postgres.exe_LWLockAcquire
add esp, 8
call sym.postgres.exe_AcceptInvalidationMessages
cmp dword [0x85e230], 0
jne 0x66db24
lea edx, [ebp - 0x804]
push edx
lea eax, [ebp - 0x404]
push eax
call sym.postgres.exe_pgrename
add esp, 8
test eax, eax
jns 0x66db33
lea ecx, [ebp - 0x404]
push ecx
jmp 0x66db2b
lea edx, [ebp - 0x404]
push edx
call sym.postgres.exe_pgunlink
add esp, 4
push 0x10
call sym.postgres.exe_LWLockRelease
add esp, 4
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop esi
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret