Class: MachO::LoadCommands::EntryPointCommand

Inherits:
LoadCommand show all
Defined in:
lib/macho/load_commands.rb

Overview

A load command specifying the offset of main(). Corresponds to LC_MAIN.

Constant Summary collapse

FORMAT =

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

"L=2Q=2"
SIZEOF =

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

24

Instance Attribute Summary collapse

Attributes inherited from LoadCommand

#cmd, #cmdsize, #view

Instance Method Summary collapse

Methods inherited from LoadCommand

create, new_from_bin, #offset, #serializable?, #serialize, #to_s, #type

Methods inherited from MachOStructure

bytesize, new_from_bin

Constructor Details

#initialize(view, cmd, cmdsize, entryoff, stacksize) ⇒ EntryPointCommand

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 instance of EntryPointCommand.



1590
1591
1592
1593
1594
# File 'lib/macho/load_commands.rb', line 1590

def initialize(view, cmd, cmdsize, entryoff, stacksize)
  super(view, cmd, cmdsize)
  @entryoff = entryoff
  @stacksize = stacksize
end

Instance Attribute Details

#entryoffInteger (readonly)

Returns the file (__TEXT) offset of main().

Returns:

  • (Integer)

    the file (__TEXT) offset of main()



1576
1577
1578
# File 'lib/macho/load_commands.rb', line 1576

def entryoff
  @entryoff
end

#stacksizeInteger (readonly)

Returns if not 0, the initial stack size.

Returns:

  • (Integer)

    if not 0, the initial stack size.



1579
1580
1581
# File 'lib/macho/load_commands.rb', line 1579

def stacksize
  @stacksize
end

Instance Method Details

#to_hHash

Returns a hash representation of this MachO::LoadCommands::EntryPointCommand.

Returns:



1597
1598
1599
1600
1601
1602
# File 'lib/macho/load_commands.rb', line 1597

def to_h
  {
    "entryoff" => entryoff,
    "stacksize" => stacksize,
  }.merge super
end