/
githubmirror
/
metasploit-framework
Обзор
Документация
Войти
/
githubmirror
/
metasploit-framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
lib/rex/script.rb
37 строк
602 B
sjanusz
Fix file reads on Windows for binary files
21 мар 2022, 15:47
Не верифицирован
21 мар 2022, 15:47
bbf9e31
Код
Авторство
О чём код?
# -*- coding: binary -*- module Rex ### # # This class provides an easy interface for loading and executing ruby # scripts. # ### module Script class Completed < ::RuntimeError end # # Reads the contents of the supplied file and exeutes them. # def self.execute_file(file, in_binding = nil) str = '' buf = ::File.read(file, ::File.size(file), mode: 'rb') execute(buf, in_binding) end # # Executes arbitrary ruby from the supplied string. # def self.execute(str, in_binding = nil) begin eval(str, in_binding) rescue Completed end end end end