Class: MachO::MachOStructure

Inherits:
Object
  • Object
show all
Defined in:
lib/macho/structure.rb

Overview

A general purpose pseudo-structure.

Direct Known Subclasses

LoadCommand, Section, Section64

Class Method Summary collapse

Class Method Details

.bytesizeFixnum

Returns the size, in bytes, of the represented structure.

Returns:

  • (Fixnum)

    the size, in bytes, of the represented structure.



9
10
11
# File 'lib/macho/structure.rb', line 9

def self.bytesize
  @sizeof
end

.new_from_bin(bin) ⇒ MachO::MachOStructure

Returns a new MachOStructure initialized with ‘bin`.

Returns:



14
15
16
# File 'lib/macho/structure.rb', line 14

def self.new_from_bin(bin)
  self.new(*bin.unpack(@format))
end