class Metasm::UniversalBinary
Constants
- MAGIC
Attributes
archive[RW]
encoded[RW]
endianness[RW]
header[RW]
Public Class Methods
autoexe_load(*a)
click to toggle source
Calls superclass method
Metasm::ExeFormat.autoexe_load
# File metasm/exe_format/macho.rb, line 1005 def self.autoexe_load(*a) ub = super(*a) ub.decode # TODO have a global callback or whatever to prompt the user # which file he wants to load in the dasm puts "UniversalBinary: using 1st archive member" if $VERBOSE AutoExe.load(ub.archive[0].encoded) end
new()
click to toggle source
Calls superclass method
Metasm::ExeFormat.new
# File metasm/exe_format/macho.rb, line 988 def initialize @endianness = :big super() end
Public Instance Methods
<<(exe)
click to toggle source
# File metasm/exe_format/macho.rb, line 1003 def <<(exe) @archive << exe end
[](i)
click to toggle source
# File metasm/exe_format/macho.rb, line 1002 def [](i) AutoExe.decode(@archive[i].encoded) if @archive[i] end
decode()
click to toggle source
# File metasm/exe_format/macho.rb, line 993 def decode @header = Header.decode(self) @archive = [] @header.nfat_arch.times { @archive << FatArch.decode(self) } @archive.each { |a| a.encoded = @encoded[a.offset, a.size] || EncodedData.new } end
decode_word(edata = @encoded)
click to toggle source
# File metasm/exe_format/macho.rb, line 984 def decode_word(edata = @encoded) edata.decode_imm(:u32, @endianness) end
encode_word(val)
click to toggle source
# File metasm/exe_format/macho.rb, line 983 def encode_word(val) Expression[val].encode(:u32, @endianness) end
sizeof_word()
click to toggle source
# File metasm/exe_format/macho.rb, line 985 def sizeof_word ; 4 ; end