diff --git a/lib/rex/compat.rb b/lib/rex/compat.rb index b5a9914116..8d0a4cf515 100644 --- a/lib/rex/compat.rb +++ b/lib/rex/compat.rb @@ -95,7 +95,7 @@ def self.win32_readline_daemon helpr = File.join(File.dirname(__FILE__), 'win32_stdio.rb') win32_winexec( [rubyw, helpr, port.to_s].join(" ") ) - + # Accept the forked child clnt = serv.accept @@ -103,11 +103,7 @@ def self.win32_readline_daemon serv.close # Replace stdin with the socket - $stdin.close - $stdin = clnt - - # Integrate with patched readline extension - $READLINE_STDIN = clnt + $stdin.reopen(clnt) end end diff --git a/lib/rex/win32_stdio.rb b/lib/rex/win32_stdio.rb index a14aa67fda..f6b7542ef3 100644 --- a/lib/rex/win32_stdio.rb +++ b/lib/rex/win32_stdio.rb @@ -16,16 +16,15 @@ begin Rex::Compat.win32_stdin_unblock() - $stderr.puts "Starting stdio daemon..." + # $stderr.puts "Starting stdio daemon..." while (true) c = $stdin.sysread(1) - $stderr.printf("%.2x \n", c[0]) sock.write(c) sock.flush end rescue ::Exception - $stderr.puts "Exception: #{$!.to_s}" + $stderr.puts "stdio: #{$!.to_s}" end Rex::Compat.win32_stdin_block()