Function at 0x69bc10
Capabilities:
Get common file path
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x810
mov eax, dword [0x82aea4]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, dword [ebp + 0xc]
lea eax, [ebp - 0x804]
push eax
push 0x400
mov dword [ebp - 0x808], esi
mov dword [ebp - 0x80c], edi
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
test eax, eax
jne 0x69bc9c
push 0x7722c8
push 0x7e
push str.srcportexec.c
call sym.postgres.exe_elog_start
call dword [sym.imp.MSVCR100.dll__errno]
mov ecx, dword [eax]
push ecx
call dword [sym.imp.MSVCR100.dll_strerror]
add esp, 0x10
push eax
push str.could_not_identify_current_directory:__s
call sub.libintl.dll_libintl_gettext
add esp, 4
push eax
push 0xf
call sym.postgres.exe_elog_finish
add esp, 0xc
pop edi
or eax, 0xffffffff
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret
push esi
call sym.postgres.exe_first_dir_separator
add esp, 4
test eax, eax
je 0x69bd48
mov al, byte [esi]
cmp al, 0x2f
je 0x69bce9
cmp al, 0x5c
je 0x69bce9
movzx edx, al
push edx
call dword [sym.imp.MSVCR100.dll_isalpha]
add esp, 4
test eax, eax
je 0x69bcd9
cmp byte [esi + 1], 0x3a
jne 0x69bcd9
mov al, byte [esi + 2]
cmp al, 0x2f
je 0x69bce9
cmp al, 0x5c
je 0x69bce9
push esi
lea eax, [ebp - 0x804]
push eax
push edi
call sym.postgres.exe_join_path_components
jmp 0x69bcfd
push 0x400
push esi
push edi
call dword [sym.imp.MSVCR100.dll_strncpy]
mov byte [edi + 0x3ff], 0
add esp, 0xc
push edi
call sym.postgres.exe_canonicalize_path
add esp, 4
mov ecx, edi
call fcn.0069b780
test eax, eax
jne 0x69bd26
pop edi
xor eax, eax
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret
push 0x7722c8
push 0x90
push str.srcportexec.c
call sym.postgres.exe_elog_start
add esp, 0xc
push edi
push str.invalid_binary___s_
jmp 0x69bc76
push esi
lea ecx, [ebp - 0x804]
push ecx
push edi
call sym.postgres.exe_join_path_components
add esp, 0xc
mov ecx, edi
call fcn.0069b780
test eax, eax
je 0x69bd14
push ebx
push str.PATH
call dword [sym.imp.MSVCR100.dll_getenv]
add esp, 4
mov dword [ebp - 0x810], eax
test eax, eax
je 0x69bee4
cmp byte [eax], 0
je 0x69bee4
xor edi, edi
xor ebx, ebx
mov edi, edi
test edi, edi
mov edi, eax
je 0x69bd99
lea edi, [ebx + 1]
push edi
call sym.postgres.exe_first_path_var_separator
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x69bdbc
mov eax, edi
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x69bdb0
sub eax, edx
lea ebx, [eax + edi]
mov esi, ebx
sub esi, edi
inc esi
cmp esi, 0x400
jl 0x69bdd0
mov esi, 0x400
jmp 0x69bdd4
test esi, esi
je 0x69bdee
push esi
lea eax, [ebp - 0x404]
push edi
push eax
call dword [sym.imp.MSVCR100.dll_strncpy]
add esp, 0xc
mov byte [ebp + esi - 0x405], 0
mov al, byte [ebp - 0x404]
cmp al, 0x2f
je 0x69be51
cmp al, 0x5c
je 0x69be51
movzx ecx, al
push ecx
call dword [sym.imp.MSVCR100.dll_isalpha]
add esp, 4
test eax, eax
je 0x69be24
cmp byte [ebp - 0x403], 0x3a
jne 0x69be24
mov al, byte [ebp - 0x402]
cmp al, 0x2f
je 0x69be51
cmp al, 0x5c
je 0x69be51
mov esi, dword [ebp - 0x80c]
lea edx, [ebp - 0x404]
push edx
lea eax, [ebp - 0x804]
push eax
push esi
call sym.postgres.exe_join_path_components
mov ecx, dword [ebp - 0x808]
push ecx
push esi
push esi
call sym.postgres.exe_join_path_components
add esp, 0x18
jmp 0x69be74
mov edx, dword [ebp - 0x808]
mov ecx, dword [ebp - 0x80c]
push edx
lea eax, [ebp - 0x404]
push eax
push ecx
call sym.postgres.exe_join_path_components
mov esi, dword [ebp - 0x80c]
add esp, 0xc
push esi
call sym.postgres.exe_canonicalize_path
add esp, 4
mov ecx, esi
call fcn.0069b780
cmp eax, 0xfffffffe
je 0x69be9e
test eax, eax
jne 0x69bece
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret
push 0x7722c8
push 0xc2
push str.srcportexec.c
call sym.postgres.exe_elog_start
add esp, 0xc
push esi
push str.could_not_read_binary___s_
call sub.libintl.dll_libintl_gettext
add esp, 4
push eax
push 0xf
call sym.postgres.exe_elog_finish
add esp, 0xc
cmp byte [ebx], 0
je 0x69bede
mov eax, dword [ebp - 0x810]
jmp 0x69bd90
mov esi, dword [ebp - 0x808]
push 0x7722c8
push 0xc8
push str.srcportexec.c
call sym.postgres.exe_elog_start
add esp, 0xc
push esi
push str.could_not_find_a___s__to_execute
call sub.libintl.dll_libintl_gettext
add esp, 4
push eax
push 0xf
call sym.postgres.exe_elog_finish
mov ecx, dword [ebp - 4]
add esp, 0xc
pop ebx
pop edi
xor ecx, ebp
or eax, 0xffffffff
pop esi
call fcn.006a8ca2
mov esp, ebp
pop ebp
ret