class Rex::MachParsey::MachBase::Segment

Attributes

_bits[RW]
_endian[RW]

Public Class Methods

new(rawdata, bits, endian) click to toggle source
# File lib/rex/machparsey/machbase.rb, line 260
def initialize(rawdata, bits, endian)
  self._bits = bits

  if bits == BITS_64
    if endian == ENDIAN_MSB
      segment_command = SEGMENT_COMMAND_64_MSB.make_struct
    else
      segment_command = SEGMENT_COMMAND_64_LSB.make_struct
    end
  else
    if endian == ENDIAN_MSB
      segment_command = SEGMENT_COMMAND_MSB.make_struct
    else
      segment_command = SEGMENT_COMMAND_LSB.make_struct
    end
  end
  if !segment_command.from_s(rawdata)
    raise MachParseError, "Couldn't parse segment command"
  end

  self.struct = segment_command
end

Public Instance Methods

FileOff() click to toggle source
# File lib/rex/machparsey/machbase.rb, line 295
def FileOff
  v['fileoff']
end
FileSize() click to toggle source
# File lib/rex/machparsey/machbase.rb, line 299
def FileSize
  v['filesize']
end
Segname() click to toggle source
# File lib/rex/machparsey/machbase.rb, line 283
def Segname
  v['segname']
end
Vmaddr() click to toggle source
# File lib/rex/machparsey/machbase.rb, line 287
def Vmaddr
  v['vmaddr']
end
Vmsize() click to toggle source
# File lib/rex/machparsey/machbase.rb, line 291
def Vmsize
  v['vmsize']
end