Class: MachO::MachOStructure Abstract

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

Overview

This class is abstract.

A general purpose pseudo-structure.

Direct Known Subclasses

FatArch, FatHeader, LoadCommand, MachHeader, Section

Constant Summary collapse

FORMAT =

The format of the data structure, in String#unpack format.

""
SIZEOF =

The size of the data structure, in bytes.

0

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.



12
13
14
# File 'lib/macho/structure.rb', line 12

def self.bytesize
	self::SIZEOF
end

.new_from_bin(bin) ⇒ MachO::MachOStructure

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new MachOStructure initialized with bin.

Returns:



18
19
20
# File 'lib/macho/structure.rb', line 18

def self.new_from_bin(bin)
	self.new(*bin.unpack(self::FORMAT))
end