Class: File
Ronin - A Ruby platform for exploit development and security research.
Copyright © 2006-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Public Visibility
Public Class Method Summary
| hexdump(path, output = STDOUT) |
Hexdumps the contents of the File. |
|---|---|
| unhexdump(path, options = {}) |
Converts the hexdump at the specified path back into the original. |
| write(path, data) |
Writes the specified data to the specified path. Returns: nil |
Public Class Method Details
hexdump
Hexdumps the contents of the File.
34 35 36 37 38 |
# File 'lib/ronin/ui/hexdump/extensions/file.rb', line 34 def self.hexdump(path,output=STDOUT) self.open(path) do |file| Ronin::UI::Hexdump.dump(file,output) end end |
unhexdump
Converts the hexdump at the specified path back into the original raw-data.
31 32 33 |
# File 'lib/ronin/formatting/extensions/binary/file.rb', line 31 def File.unhexdump(path,={}) File.read(path).unhexdump() end |
write
Writes the specified data to the specified path.
34 35 36 |
# File 'lib/ronin/extensions/file.rb', line 34 def File.write(path,data) File.open(path,'w') { |file| file.write(data) } end |