Class: MachO::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 =
"L=2Q=2"
SIZEOF =
24

Instance Attribute Summary collapse

Attributes inherited from LoadCommand

#cmd, #cmdsize, #offset

Instance Method Summary collapse

Methods inherited from LoadCommand

new_from_bin, #to_s, #type

Methods inherited from MachOStructure

bytesize, new_from_bin

Constructor Details

#initialize(raw_data, offset, 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.



977
978
979
980
981
# File 'lib/macho/load_commands.rb', line 977

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

Instance Attribute Details

#entryoffFixnum (readonly)

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

Returns:

  • (Fixnum)

    the file (__TEXT) offset of main()



968
969
970
# File 'lib/macho/load_commands.rb', line 968

def entryoff
  @entryoff
end

#stacksizeFixnum (readonly)

Returns if not 0, the initial stack size.

Returns:

  • (Fixnum)

    if not 0, the initial stack size.



971
972
973
# File 'lib/macho/load_commands.rb', line 971

def stacksize
  @stacksize
end