Class: MachO::SegmentCommand64
- Inherits:
-
LoadCommand
- Object
- MachOStructure
- LoadCommand
- MachO::SegmentCommand64
- Defined in:
- lib/macho/load_commands.rb
Overview
A load command indicating that part of this file is to be mapped into the task’s address space. Corresponds to LC_SEGMENT_64.
Instance Attribute Summary collapse
-
#fileoff ⇒ Fixnum
readonly
The file offset of the segment.
-
#filesize ⇒ Fixnum
readonly
The amount to map from the file.
-
#flags ⇒ Fixnum
readonly
Any flags associated with the segment.
-
#initprot ⇒ Fixnum
readonly
The initial VM protection.
-
#maxprot ⇒ Fixnum
readonly
The maximum VM protection.
-
#nsects ⇒ Fixnum
readonly
The number of sections in the segment.
-
#segname ⇒ String
readonly
The name of the segment, including null padding bytes.
-
#vmaddr ⇒ Fixnum
readonly
The memory address of the segment.
-
#vmsize ⇒ Fixnum
readonly
The memory size of the segment.
Attributes inherited from LoadCommand
Instance Method Summary collapse
-
#initialize(offset, cmd, cmdsize, segname, vmaddr, vmsize, fileoff, filesize, maxprot, initprot, nsects, flags) ⇒ SegmentCommand64
constructor
A new instance of SegmentCommand64.
-
#segment_name ⇒ String
The segment’s name, with any trailing NULL characters removed.
Methods inherited from LoadCommand
Methods inherited from MachOStructure
Constructor Details
#initialize(offset, cmd, cmdsize, segname, vmaddr, vmsize, fileoff, filesize, maxprot, initprot, nsects, flags) ⇒ SegmentCommand64
Returns a new instance of SegmentCommand64.
442 443 444 445 446 447 448 449 450 451 452 453 454 |
# File 'lib/macho/load_commands.rb', line 442 def initialize(offset, cmd, cmdsize, segname, vmaddr, vmsize, fileoff, filesize, maxprot, initprot, nsects, flags) super(offset, cmd, cmdsize) @segname = segname @vmaddr = vmaddr @vmsize = vmsize @fileoff = fileoff @filesize = filesize @maxprot = maxprot @initprot = initprot @nsects = nsects @flags = flags end |
Instance Attribute Details
#fileoff ⇒ Fixnum (readonly)
Returns the file offset of the segment.
421 422 423 |
# File 'lib/macho/load_commands.rb', line 421 def fileoff @fileoff end |
#filesize ⇒ Fixnum (readonly)
Returns the amount to map from the file.
424 425 426 |
# File 'lib/macho/load_commands.rb', line 424 def filesize @filesize end |
#flags ⇒ Fixnum (readonly)
Returns any flags associated with the segment.
436 437 438 |
# File 'lib/macho/load_commands.rb', line 436 def flags @flags end |
#initprot ⇒ Fixnum (readonly)
Returns the initial VM protection.
430 431 432 |
# File 'lib/macho/load_commands.rb', line 430 def initprot @initprot end |
#maxprot ⇒ Fixnum (readonly)
Returns the maximum VM protection.
427 428 429 |
# File 'lib/macho/load_commands.rb', line 427 def maxprot @maxprot end |
#nsects ⇒ Fixnum (readonly)
Returns the number of sections in the segment.
433 434 435 |
# File 'lib/macho/load_commands.rb', line 433 def nsects @nsects end |
#segname ⇒ String (readonly)
Returns the name of the segment, including null padding bytes.
412 413 414 |
# File 'lib/macho/load_commands.rb', line 412 def segname @segname end |
#vmaddr ⇒ Fixnum (readonly)
Returns the memory address of the segment.
415 416 417 |
# File 'lib/macho/load_commands.rb', line 415 def vmaddr @vmaddr end |
#vmsize ⇒ Fixnum (readonly)
Returns the memory size of the segment.
418 419 420 |
# File 'lib/macho/load_commands.rb', line 418 def vmsize @vmsize end |
Instance Method Details
#segment_name ⇒ String
Returns the segment’s name, with any trailing NULL characters removed.
457 458 459 |
# File 'lib/macho/load_commands.rb', line 457 def segment_name @segname.delete("\x00") end |