Function at 0x406ea0
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
mov eax, dword [ebp + 0xc]
push esi
push edi
mov edi, dword [0x456300]
xor esi, esi
mov dword [ebp - 0xc], edi
mov dword [ebp - 8], esi
test edi, edi
jne 0x406ee5
test eax, eax
je 0x406ed0
cmp dword [ebp + 0x10], esi
je 0x406ed0
cmp dword [ebp + 0x14], esi
je 0x406ed0
cmp dword [ebp + 0x18], esi
jne 0x406ee5
push str.All_connection_parameters_must_be_supplied_because_no_database_connection_exists_n
call fcn.00408fb0
add esp, 4
xor al, al
pop edi
pop esi
mov esp, ebp
pop ebp
ret
push ebx
test eax, eax
je 0x406ef7
push eax
call fcn.00409b00
add esp, 4
mov bl, al
jmp 0x406ef9
xor bl, bl
mov eax, dword [ebp + 8]
dec eax
je 0x406f0d
dec eax
je 0x406f09
test bl, bl
sete bh
jmp 0x406f0f
mov bh, 1
jmp 0x406f0f
xor bh, bh
mov byte [ebp - 1], bh
test bl, bl
je 0x406f21
mov dword [ebp + 0x10], esi
mov dword [ebp + 0x14], esi
mov dword [ebp + 0x18], esi
jmp 0x406f26
cmp dword [ebp + 0x10], esi
jne 0x406f36
test bh, bh
je 0x406f36
push edi
call sub.LIBPQ.dll_Ordinal_8
add esp, 4
mov dword [ebp + 0x10], eax
cmp dword [ebp + 0x14], esi
jne 0x406f4b
test bh, bh
je 0x406f4b
push edi
call sub.LIBPQ.dll_Ordinal_10
add esp, 4
mov dword [ebp + 0x14], eax
cmp dword [ebp + 0x18], esi
jne 0x406f60
test bh, bh
je 0x406f60
push edi
call sub.LIBPQ.dll_Ordinal_11
add esp, 4
mov dword [ebp + 0x18], eax
test bl, bl
jne 0x407009
mov ebx, dword [ebp + 0x10]
test ebx, ebx
je 0x407009
push edi
call sub.LIBPQ.dll_Ordinal_8
add esp, 4
test eax, eax
je 0x407009
push edi
call sub.LIBPQ.dll_Ordinal_8
mov ecx, eax
add esp, 4
mov eax, ebx
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x406fb1
test dl, dl
je 0x406fad
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x406fb1
add eax, 2
add ecx, 2
test dl, dl
jne 0x406f91
xor eax, eax
jmp 0x406fb6
sbb eax, eax
or eax, 1
test eax, eax
jne 0x407009
mov ebx, dword [ebp + 0x14]
push edi
call sub.LIBPQ.dll_Ordinal_10
add esp, 4
test ebx, ebx
je 0x407050
test eax, eax
je 0x407009
push edi
call sub.LIBPQ.dll_Ordinal_10
mov ecx, eax
add esp, 4
mov eax, ebx
nop
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x407000
test dl, dl
je 0x406ffc
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x407000
add eax, 2
add ecx, 2
test dl, dl
jne 0x406fe0
xor eax, eax
jmp 0x407005
sbb eax, eax
or eax, 1
test eax, eax
je 0x407054
xor bl, bl
cmp dword [ebp + 0xc], esi
jne 0x4070a9
cmp byte [ebp - 1], 0
je 0x4070a9
lea eax, [ebp - 0x18]
push eax
call sub.LIBPQ.dll_Ordinal_69
lea eax, [ebp - 0x18]
push 0x42b4c8
push eax
call sub.LIBPQ.dll_Ordinal_91
push edi
call sub.LIBPQ.dll_Ordinal_7
push eax
lea eax, [ebp - 0x18]
push eax
call fcn.00401720
mov eax, dword [ebp - 0x18]
add esp, 0x18
mov dword [ebp + 0xc], eax
jmp 0x4070ac
test eax, eax
jne 0x407009
mov ebx, dword [ebp + 0x18]
test ebx, ebx
je 0x407009
push edi
call sub.LIBPQ.dll_Ordinal_11
add esp, 4
test eax, eax
je 0x407009
push edi
call sub.LIBPQ.dll_Ordinal_11
mov ecx, eax
add esp, 4
mov eax, ebx
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x407095
test dl, dl
je 0x407091
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x407095
add eax, 2
add ecx, 2
test dl, dl
jne 0x407075
xor eax, eax
jmp 0x40709a
sbb eax, eax
or eax, 1
test eax, eax
jne 0x407009
mov bl, 1
jmp 0x40700b
mov dword [ebp - 0x18], esi
cmp dword [0x456388], 2
jne 0x4070c4
push dword [ebp + 0x10]
call fcn.00408b10
add esp, 4
mov esi, eax
jmp 0x4070ed
test edi, edi
je 0x4070f0
test bl, bl
je 0x4070f0
push edi
call sub.LIBPQ.dll_Ordinal_9
add esp, 4
test eax, eax
je 0x4070eb
cmp byte [eax], 0
je 0x4070eb
push eax
call fcn.00424d80
add esp, 4
mov esi, eax
jmp 0x4070ed
xor esi, esi
mov dword [ebp - 8], esi
push 0x20
call fcn.00424dd0
push 0x20
mov edi, eax
call fcn.00424dd0
mov ebx, eax
mov dword [edi], str.host
mov eax, dword [ebp + 0x14]
add esp, 8
mov dword [ebx], eax
mov eax, dword [ebp + 0x18]
mov dword [edi + 4], str.port
mov dword [ebx + 4], eax
mov eax, dword [ebp + 0x10]
mov dword [edi + 8], str.user
mov dword [ebx + 8], eax
mov eax, dword [ebp + 0xc]
mov dword [edi + 0xc], str.dbname
mov dword [ebx + 0xc], eax
mov dword [edi + 0x10], str.password
mov dword [ebx + 0x10], esi
mov dword [edi + 0x14], str.fallback_application_name
mov eax, dword [0x456398]
mov dword [ebx + 0x14], eax
mov dword [edi + 0x18], str.client_encoding
cmp byte [0x456384], 0
jne 0x407179
push str.PGCLIENTENCODING
call dword [sym.imp.MSVCR120.dll_getenv]
add esp, 4
test eax, eax
jne 0x407179
mov eax, str.auto
jmp 0x40717b
xor eax, eax
push 1
mov dword [ebx + 0x18], eax
push ebx
mov dword [edi + 0x1c], 0
push edi
mov dword [ebx + 0x1c], 0
call sub.LIBPQ.dll_Ordinal_156
push edi
mov esi, eax
call fcn.00424e70
push ebx
call fcn.00424e70
mov edi, dword [ebp - 8]
add esp, 0x14
test edi, edi
je 0x4071b6
push edi
call fcn.00424e70
add esp, 4
push esi
call sub.LIBPQ.dll_Ordinal_14
add esp, 4
test eax, eax
je 0x4072be
test edi, edi
jne 0x40723d
push esi
call sub.LIBPQ.dll_Ordinal_140
add esp, 4
test eax, eax
je 0x40723d
cmp dword [0x456388], 1
je 0x40723d
push esi
call sub.LIBPQ.dll_Ordinal_4
mov eax, dword [ebp + 0x10]
add esp, 4
test eax, eax
jne 0x407208
push eax
push 0x64
push str.Password:
call fcn.00428800
add esp, 0xc
mov esi, eax
jmp 0x4070ed
push eax
push str.Password_for_user__s:
call sub.libintl_8.dll_libintl_gettext
add esp, 4
push eax
call fcn.00425060
push 0
mov esi, eax
push 0x64
push esi
call fcn.00428800
push esi
mov dword [ebp - 8], eax
call dword [sym.imp.MSVCR120.dll_free]
mov esi, dword [ebp - 8]
add esp, 0x18
jmp 0x4070f0
cmp byte [0x456390], 0
push esi
je 0x40726d
call sub.LIBPQ.dll_Ordinal_15
push eax
push 0x42b548
call fcn.00408fb0
mov edi, dword [ebp - 0xc]
add esp, 0xc
test edi, edi
je 0x40729a
push str.Previous_connection_kept_n
call fcn.00408fb0
jmp 0x407297
call sub.LIBPQ.dll_Ordinal_15
push eax
push str.connect:__s
call fcn.00408fb0
mov edi, dword [ebp - 0xc]
add esp, 0xc
test edi, edi
je 0x40729a
push edi
call sub.LIBPQ.dll_Ordinal_4
mov dword [0x456300], 0
add esp, 4
push esi
call sub.LIBPQ.dll_Ordinal_4
add esp, 4
cmp dword [ebp - 0x18], 0
je 0x4072b5
lea eax, [ebp - 0x18]
push eax
call sub.LIBPQ.dll_Ordinal_67
add esp, 4
pop ebx
pop edi
xor al, al
pop esi
mov esp, ebp
pop ebp
ret
cmp dword [ebp - 0x18], 0
je 0x4072d0
lea eax, [ebp - 0x18]
push eax
call sub.LIBPQ.dll_Ordinal_67
add esp, 4
push 0
push 0x409040
push esi
call sub.LIBPQ.dll_Ordinal_20
mov dword [0x456300], esi
call fcn.00403f30
push 0
call fcn.00403de0
mov edi, dword [ebp - 0xc]
add esp, 0x10
cmp byte [0x4563be], 0
jne 0x40743c
test edi, edi
je 0x4073df
push dword [0x456300]
call sub.LIBPQ.dll_Ordinal_10
push edi
mov esi, eax
call sub.LIBPQ.dll_Ordinal_10
add esp, 8
test esi, esi
je 0x40735d
test eax, eax
je 0x4073df
lea esp, [esp]
mov cl, byte [eax]
cmp cl, byte [esi]
jne 0x407350
test cl, cl
je 0x40734c
mov cl, byte [eax + 1]
cmp cl, byte [esi + 1]
jne 0x407350
add eax, 2
add esi, 2
test cl, cl
jne 0x407330
xor eax, eax
jmp 0x407355
sbb eax, eax
or eax, 1
test eax, eax
jne 0x4073df
push dword [0x456300]
call sub.LIBPQ.dll_Ordinal_11
push edi
mov esi, eax
call sub.LIBPQ.dll_Ordinal_11
add esp, 8
test esi, esi
je 0x4073a9
test eax, eax
je 0x4073df
jmp 0x407380
mov cl, byte [eax]
cmp cl, byte [esi]
jne 0x4073a0
test cl, cl
je 0x40739c
mov cl, byte [eax + 1]
cmp cl, byte [esi + 1]
jne 0x4073a0
add eax, 2
add esi, 2
test cl, cl
jne 0x407380
xor eax, eax
jmp 0x4073a5
sbb eax, eax
or eax, 1
test eax, eax
jne 0x4073df
push dword [0x456300]
call sub.LIBPQ.dll_Ordinal_8
add esp, 4
push eax
push dword [0x456300]
call sub.LIBPQ.dll_Ordinal_7
add esp, 4
push eax
push str.You_are_now_connected_to_database___s__as_user___s_._n
call sub.libintl_8.dll_libintl_gettext
add esp, 4
push eax
call fcn.004264b0
add esp, 0xc
jmp 0x40743c
push dword [0x456300]
call sub.LIBPQ.dll_Ordinal_10
mov esi, eax
add esp, 4
test esi, esi
jne 0x407452
mov esi, str._tmp
push dword [0x456300]
call sub.LIBPQ.dll_Ordinal_11
add esp, 4
push eax
push esi
push dword [0x456300]
call sub.LIBPQ.dll_Ordinal_8
add esp, 4
push eax
push dword [0x456300]
call sub.LIBPQ.dll_Ordinal_7
add esp, 4
push eax
push str.You_are_now_connected_to_database___s__as_user___s__via_socket_in___s__at_port___s_._n
call sub.libintl_8.dll_libintl_gettext
add esp, 4
push eax
call fcn.004264b0
add esp, 0x14
test edi, edi
je 0x407449
push edi
call sub.LIBPQ.dll_Ordinal_4
add esp, 4
pop ebx
pop edi
mov al, 1
pop esi
mov esp, ebp
pop ebp
ret
mov al, byte [esi]
cmp al, 0x2f
je 0x4073f8
cmp al, 0x5c
je 0x4073f8
movzx eax, al
push eax
call dword [sym.imp.MSVCR120.dll_isalpha]
add esp, 4
test eax, eax
je 0x407486
cmp byte [esi + 1], 0x3a
jne 0x407486
mov al, byte [esi + 2]
cmp al, 0x2f
je 0x4073f8
cmp al, 0x5c
je 0x4073f8
push dword [0x456300]
call sub.LIBPQ.dll_Ordinal_11
add esp, 4
push eax
push esi
push dword [0x456300]
call sub.LIBPQ.dll_Ordinal_8
add esp, 4
push eax
push dword [0x456300]
call sub.LIBPQ.dll_Ordinal_7
add esp, 4
push eax
push str.You_are_now_connected_to_database___s__as_user___s__on_host___s__at_port___s_._n
jmp 0x40742b