Function at 0x40b520
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x201c
call fcn.0042a330
mov eax, dword [0x455c20]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov dword [ebp - 0x2014], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x201c], eax
mov eax, dword [ebp + 0x14]
push 0
push 0x456480
mov dword [ebp - 0x2018], eax
call sub.MSVCR120.dll__setjmp3
add esp, 8
test eax, eax
je 0x40b5ad
mov edi, dword [ebp - 0x2014]
push edi
call sub.LIBPQ.dll_Ordinal_98
add esp, 4
cmp eax, 3
jge 0x40b58f
xor eax, eax
push eax
push edi
call sub.LIBPQ.dll_Ordinal_104
add esp, 8
xor bl, bl
jmp 0x40b8c0
push str.canceled_by_user
call sub.libintl_8.dll_libintl_gettext
add esp, 4
push eax
push edi
call sub.LIBPQ.dll_Ordinal_104
add esp, 8
xor bl, bl
jmp 0x40b8c0
mov esi, dword [ebp - 0x201c]
push esi
mov dword [ebp - 0x200c], esi
call dword [sym.imp.MSVCR120.dll__fileno]
push eax
call dword [sym.imp.MSVCR120.dll__isatty]
add esp, 8
test eax, eax
je 0x40b5fb
cmp byte [0x4563be], 0
mov al, 1
mov byte [ebp - 0x2006], al
jne 0x40b603
push str.Enter_data_to_be_copied_followed_by_a_newline._nEnd_with_a_backslash_and_a_period_on_a_line_by_itself.
call sub.libintl_8.dll_libintl_gettext
push eax
call dword [sym.imp.MSVCR120.dll_puts]
mov al, byte [ebp - 0x2006]
add esp, 8
jmp 0x40b603
xor al, al
mov byte [ebp - 0x2006], al
cmp byte [ebp + 0x10], 0
mov bl, 1
mov edi, dword [ebp - 0x2014]
mov byte [ebp - 0x2005], bl
mov dword [ebp - 0x2010], edi
je 0x40b6f4
test al, al
je 0x40b65c
push 7
call fcn.0041c1c0
mov edi, dword [sym.imp.MSVCR120.dll___iob_func]
mov esi, eax
call edi
add eax, 0x20
push eax
push esi
call dword [sym.imp.MSVCR120.dll_fputs]
call edi
add eax, 0x20
push eax
call dword [sym.imp.MSVCR120.dll_fflush]
mov edi, dword [ebp - 0x2010]
add esp, 0x10
mov esi, dword [ebp - 0x200c]
push esi
mov esi, dword [sym.imp.MSVCR120.dll_fread]
lea eax, [ebp - 0x2004]
push 0x2000
push 1
mov byte [0x455c49], 1
push eax
call esi
add esp, 0x10
mov byte [0x455c49], 0
test eax, eax
jle 0x40b6d1
mov ebx, dword [ebp - 0x200c]
mov edi, edi
push eax
lea eax, [ebp - 0x2004]
push eax
push edi
call sub.LIBPQ.dll_Ordinal_103
add esp, 0xc
test eax, eax
jle 0x40b6f0
push ebx
push 0x2000
lea eax, [ebp - 0x2004]
mov byte [0x455c49], 1
push 1
push eax
call esi
add esp, 0x10
mov byte [0x455c49], 0
test eax, eax
jg 0x40b690
mov bl, byte [ebp - 0x2005]
mov esi, dword [ebp - 0x200c]
push esi
call dword [sym.imp.MSVCR120.dll_ferror]
add esp, 4
test eax, eax
je 0x40b889
xor bl, bl
jmp 0x40b88d
xor bl, bl
jmp 0x40b6d1
xor bh, bh
test al, al
je 0x40b72d
push 7
call fcn.0041c1c0
mov esi, eax
call dword [sym.imp.MSVCR120.dll___iob_func]
add eax, 0x20
push eax
push esi
call dword [sym.imp.MSVCR120.dll_fputs]
call dword [sym.imp.MSVCR120.dll___iob_func]
add eax, 0x20
push eax
call dword [sym.imp.MSVCR120.dll_fflush]
mov esi, dword [ebp - 0x200c]
add esp, 0x10
mov bl, 1
mov byte [ebp - 0x2010], 0
jmp 0x40b740
push esi
lea eax, [ebp - 0x2004]
mov byte [0x455c49], 1
push 0x2000
push eax
call dword [sym.imp.MSVCR120.dll_fgets]
add esp, 0xc
mov byte [0x455c49], 0
test eax, eax
je 0x40b83e
lea esi, [ebp - 0x2004]
lea ecx, [esi + 1]
mov al, byte [esi]
inc esi
test al, al
jne 0x40b775
sub esi, ecx
test esi, esi
jle 0x40b7a1
mov eax, dword [ebp - 0x2010]
mov ecx, 1
cmp byte [ebp + esi - 0x2005], 0xa
movzx eax, al
cmove eax, ecx
mov dword [ebp - 0x2010], eax
test bl, bl
je 0x40b80f
mov ecx, 0x42efe8
lea eax, [ebp - 0x2004]
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x40b7d0
test dl, dl
je 0x40b7cc
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x40b7d0
add eax, 2
add ecx, 2
test dl, dl
jne 0x40b7b0
xor eax, eax
jmp 0x40b7d5
sbb eax, eax
or eax, 1
test eax, eax
je 0x40b838
mov eax, str.._r_n
lea ecx, [ebp - 0x2004]
mov dl, byte [ecx]
cmp dl, byte [eax]
jne 0x40b804
test dl, dl
je 0x40b800
mov dl, byte [ecx + 1]
cmp dl, byte [eax + 1]
jne 0x40b804
add ecx, 2
add eax, 2
test dl, dl
jne 0x40b7e4
xor eax, eax
jmp 0x40b809
sbb eax, eax
or eax, 1
test eax, eax
je 0x40b838
xor bl, bl
push esi
lea eax, [ebp - 0x2004]
push eax
push edi
call sub.LIBPQ.dll_Ordinal_103
mov esi, dword [ebp - 0x200c]
add esp, 0xc
test eax, eax
jle 0x40b87d
cmp byte [ebp - 0x2010], 0
jne 0x40b840
jmp 0x40b740
mov esi, dword [ebp - 0x200c]
mov bh, 1
mov bl, byte [ebp - 0x2005]
cmp esi, dword [0x45638c]
jne 0x40b86a
add dword [0x4563a0], 1
adc dword [0x4563a4], 0
add dword [0x4563a8], 1
adc dword [0x4563ac], 0
mov al, byte [ebp - 0x2006]
test bh, bh
je 0x40b6f6
jmp 0x40b6d7
xor bl, bl
mov bh, 1
mov byte [ebp - 0x2005], bl
jmp 0x40b846
test bl, bl
jne 0x40b8aa
push edi
call sub.LIBPQ.dll_Ordinal_98
add esp, 4
cmp eax, 3
jl 0x40b8aa
push str.aborted_because_of_read_failure
call sub.libintl_8.dll_libintl_gettext
add esp, 4
jmp 0x40b8ac
xor eax, eax
push eax
push edi
call sub.LIBPQ.dll_Ordinal_104
xor ecx, ecx
movzx ebx, bl
add esp, 8
test eax, eax
cmovle ebx, ecx
push edi
call sub.LIBPQ.dll_Ordinal_24
mov esi, dword [ebp - 0x2018]
push eax
mov dword [esi], eax
call sub.LIBPQ.dll_Ordinal_33
add esp, 8
cmp eax, 4
jne 0x40b923
xor bl, bl
mov edi, edi
push dword [esi]
call sub.LIBPQ.dll_Ordinal_48
push edi
call sub.LIBPQ.dll_Ordinal_98
add esp, 8
cmp eax, 3
jge 0x40b8f9
xor eax, eax
jmp 0x40b906
push str.trying_to_exit_copy_mode
call sub.libintl_8.dll_libintl_gettext
add esp, 4
push eax
push edi
call sub.LIBPQ.dll_Ordinal_104
push edi
call sub.LIBPQ.dll_Ordinal_24
push eax
mov dword [esi], eax
call sub.LIBPQ.dll_Ordinal_33
add esp, 0x10
cmp eax, 4
je 0x40b8e0
push dword [esi]
call sub.LIBPQ.dll_Ordinal_33
add esp, 4
cmp eax, 1
je 0x40b959
push edi
call sub.LIBPQ.dll_Ordinal_15
push eax
push 0x42b548
call fcn.00408fb0
add esp, 0xc
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00429e54
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
mov al, bl
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00429e54
mov esp, ebp
pop ebp
ret