Function at 0x67e6b0
Capabilities:
Query environment variable
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x91c
mov eax, dword [0x82aea4]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
push esi
push edi
mov dword [ebp - 0x908], eax
call dword [sym.imp.MSVCR100.dll__getpid]
mov edi, eax
push str.PG_GRANDPARENT_PID
mov dword [ebp - 0x914], edi
call dword [sym.imp.MSVCR100.dll_getenv]
xor esi, esi
add esp, 4
cmp eax, esi
je 0x67e702
push eax
call dword [sym.imp.MSVCR100.dll_atoi]
add esp, 4
mov dword [ebp - 0x91c], eax
jmp 0x67e708
mov dword [ebp - 0x91c], esi
push 0x180
push 0x502
push ebx
mov dword [ebp - 0x90c], esi
call sym.postgres.exe_pgwin32_open
mov esi, eax
add esp, 0xc
test esi, esi
jns 0x67eacf
jmp 0x67e730
mov esi, dword [sym.imp.MSVCR100.dll__errno]
call esi
cmp dword [eax], 0x11
je 0x67e744
call esi
cmp dword [eax], 0xd
jne 0x67e74d
cmp dword [ebp - 0x90c], 0x64
jle 0x67e789
push 0
push str.CreateLockFile
push 0x2e7
push str.src_backendutilsinitmiscinit.c
push 0x15
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x67e789
push ebx
push str.could_not_create_lock_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, 8
push 0x180
push 0
push ebx
call sym.postgres.exe_pgwin32_open
mov edi, eax
add esp, 0xc
test edi, edi
jns 0x67e7e6
call esi
cmp dword [eax], 2
je 0x67eaa6
push 0
push str.CreateLockFile
push 0x2f5
push str.src_backendutilsinitmiscinit.c
push 0x15
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x67e7e6
push ebx
push str.could_not_open_lock_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, 8
push 0x8ff
lea ecx, [ebp - 0x904]
push ecx
push edi
call dword [sym.imp.MSVCR100.dll__read]
mov esi, eax
add esp, 0xc
test esi, esi
jns 0x67e83e
push 0
push str.CreateLockFile
push 0x2fb
push str.src_backendutilsinitmiscinit.c
push 0x15
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x67e83e
push ebx
push str.could_not_read_lock_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, 8
push edi
call dword [sym.imp.MSVCR100.dll__close]
lea edx, [ebp - 0x904]
push edx
mov byte [ebp + esi - 0x904], 0
call dword [sym.imp.MSVCR100.dll_atoi]
mov edi, eax
cdq
mov esi, eax
xor esi, edx
sub esi, edx
add esp, 8
test esi, esi
jg 0x67e895
push str.CreateLockFile
push 0x305
push str.src_backendutilsinitmiscinit.c
call sym.postgres.exe_elog_start
lea eax, [ebp - 0x904]
push eax
push ebx
push str.bogus_data_in_lock_file___s_:___s_
push 0x15
call sym.postgres.exe_elog_finish
add esp, 0x1c
cmp esi, dword [ebp - 0x914]
je 0x67e977
test esi, esi
je 0x67e977
cmp esi, dword [ebp - 0x91c]
je 0x67e977
push 0
push esi
call sym.postgres.exe_pgkill
add esp, 8
test eax, eax
je 0x67e8e2
call dword [sym.imp.MSVCR100.dll__errno]
cmp dword [eax], 3
je 0x67e977
call dword [sym.imp.MSVCR100.dll__errno]
cmp dword [eax], 1
je 0x67e977
push 0
push str.CreateLockFile
push 0x336
push str.src_backendutilsinitmiscinit.c
push 0x15
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x67e977
cmp byte [ebp + 0xc], 0
je 0x67e929
test edi, edi
jns 0x67e91a
mov ecx, dword [ebp - 0x908]
push ecx
push esi
push str.Is_another_postgres__PID__d__running_in_data_directory___s__
jmp 0x67e949
mov edx, dword [ebp - 0x908]
push edx
push esi
push str.Is_another_postmaster__PID__d__running_in_data_directory___s__
jmp 0x67e949
test edi, edi
jns 0x67e93c
mov eax, dword [ebp - 0x908]
push eax
push esi
push str.Is_another_postgres__PID__d__using_socket_file___s__
jmp 0x67e949
mov ecx, dword [ebp - 0x908]
push ecx
push esi
push str.Is_another_postmaster__PID__d__using_socket_file___s__
call sym.postgres.exe_errhint
add esp, 0xc
push eax
push ebx
push str.lock_file___s__already_exists
call sym.postgres.exe_errmsg
add esp, 8
push eax
push 0x1000016
call sym.postgres.exe_errcode
add esp, 4
push eax
call sym.postgres.exe_errfinish
add esp, 0xc
cmp byte [ebp + 0xc], 0
je 0x67ea4f
lea eax, [ebp - 0x904]
mov esi, 1
lea esp, [esp]
push 0xa
push eax
call dword [sym.imp.MSVCR100.dll_strchr]
add esp, 8
test eax, eax
je 0x67ea4f
inc esi
inc eax
cmp esi, 7
jl 0x67e990
test eax, eax
je 0x67ea4f
lea edx, [ebp - 0x910]
push edx
lea ecx, [ebp - 0x918]
push ecx
push str._lu__lu
push eax
call dword [sym.imp.MSVCR100.dll_sscanf]
add esp, 0x10
cmp eax, 2
jne 0x67ea4f
mov edx, dword [ebp - 0x910]
mov eax, dword [ebp - 0x918]
push edx
push eax
call sym.postgres.exe_PGSharedMemoryIsInUse
add esp, 8
test al, al
je 0x67ea4f
push 0
push str.CreateLockFile
push 0x360
push str.src_backendutilsinitmiscinit.c
push 0x15
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x67ea4f
push ebx
push str.If_youre_sure_there_are_no_old_server_processes_still_running__remove_the_shared_memory_block_or_just_delete_the_file___s_.
call sym.postgres.exe_errhint
mov ecx, dword [ebp - 0x910]
mov edx, dword [ebp - 0x918]
add esp, 8
push eax
push ecx
push edx
push str.pre_existing_shared_memory_block__key__lu__ID__lu__is_still_in_use
call sym.postgres.exe_errmsg
add esp, 0xc
push eax
push 0x1000016
call sym.postgres.exe_errcode
add esp, 4
push eax
call sym.postgres.exe_errfinish
add esp, 0xc
push ebx
call sym.postgres.exe_pgunlink
add esp, 4
test eax, eax
jns 0x67eaa6
push 0
push str.CreateLockFile
push 0x370
push str.src_backendutilsinitmiscinit.c
push 0x15
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x67eaa6
push str.The_file_seems_accidentally_left_over__but_it_could_not_be_removed._Please_remove_the_file_by_hand_and_try_again.
call sym.postgres.exe_errhint
add esp, 4
push eax
push ebx
push str.could_not_remove_old_lock_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
inc dword [ebp - 0x90c]
push 0x180
push 0x502
push ebx
call sym.postgres.exe_pgwin32_open
mov esi, eax
add esp, 0xc
test esi, esi
js 0x67e730
mov edi, dword [ebp - 0x914]
cmp byte [ebp + 8], 0
jne 0x67ead7
neg edi
mov ecx, dword [0x8691a0]
mov edx, dword [sym.postgres.exe_MyStartTime]
push 0x6aaa59
push ecx
mov ecx, dword [sym.postgres.exe_DataDir]
push edx
push ecx
mov eax, edi
push eax
push str._d_n_s_n_ld_n_d_n_s_n
lea edx, [ebp - 0x904]
push 0x900
push edx
call sym.postgres.exe_pg_snprintf
add esp, 0x20
cmp byte [ebp + 0xc], 0
je 0x67eb32
cmp byte [ebp + 8], 0
jne 0x67eb32
push 0x900
lea eax, [ebp - 0x904]
push 0x6b27a0
push eax
call sym.postgres.exe_strlcat
add esp, 0xc
call dword [sym.imp.MSVCR100.dll__errno]
mov dword [eax], 0
lea eax, [ebp - 0x904]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x67eb47
sub eax, edx
mov edi, eax
push edi
lea ecx, [ebp - 0x904]
push ecx
push esi
call dword [sym.imp.MSVCR100.dll__write]
add esp, 0xc
cmp eax, edi
je 0x67ebcd
call dword [sym.imp.MSVCR100.dll__errno]
mov edi, dword [eax]
push esi
call dword [sym.imp.MSVCR100.dll__close]
push ebx
call sym.postgres.exe_pgunlink
add esp, 8
test edi, edi
jne 0x67eb89
mov edi, 0x1c
call dword [sym.imp.MSVCR100.dll__errno]
push 0
push str.CreateLockFile
push 0x397
push str.src_backendutilsinitmiscinit.c
push 0x15
mov dword [eax], edi
call sym.postgres.exe_errstart
add esp, 0x14
test al, al
je 0x67ebcd
push ebx
push str.could_not_write_lock_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, 8
push esi
call sym.postgres.exe_pg_fsync
add esp, 4
test eax, eax
je 0x67ec33
call dword [sym.imp.MSVCR100.dll__errno]
mov edi, dword [eax]
push esi
call dword [sym.imp.MSVCR100.dll__close]
push ebx
call sym.postgres.exe_pgunlink
call dword [sym.imp.MSVCR100.dll__errno]
push 0
push str.CreateLockFile
push 0x3a2
push str.src_backendutilsinitmiscinit.c
push 0x15
mov dword [eax], edi
call sym.postgres.exe_errstart
add esp, 0x1c
test al, al
je 0x67ec33
push ebx
push str.could_not_write_lock_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, 8
push esi
call dword [sym.imp.MSVCR100.dll__close]
add esp, 4
test eax, eax
je 0x67ec91
mov edi, dword [sym.imp.MSVCR100.dll__errno]
call edi
mov esi, dword [eax]
push ebx
call sym.postgres.exe_pgunlink
call edi
push 0
push str.CreateLockFile
push 0x3ac
push str.src_backendutilsinitmiscinit.c
push 0x15
mov dword [eax], esi
call sym.postgres.exe_errstart
add esp, 0x18
test al, al
je 0x67ec91
push ebx
push str.could_not_write_lock_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, 8
push ebx
call dword [sym.imp.MSVCR100.dll__strdup]
push eax
push 0x67e690
call sym.postgres.exe_on_proc_exit
mov ecx, dword [ebp - 4]
add esp, 0xc
pop edi
xor ecx, ebp
pop esi
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret