Class: MachO::MachHeader64

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

Overview

64-bit Mach-O file header structure

Constant Summary

Constants inherited from CStruct

CStruct::PackMap, CStruct::SizeMap, CStruct::UnpackMap

Instance Attribute Summary

Attributes inherited from CStruct

#values

Instance Method Summary collapse

Methods inherited from CStruct

#==, #[], #[]=, bytesize, #bytesize, #each, #each_pair, inherited, #initialize, length, #member_index, #member_options, #member_sizes, #members, new_from_bin, #pack_pattern, #serialize, size, #size, sizeof, #sizeof, #unpack_pattern, #unserialize

Constructor Details

This class inherits a constructor from CStruct

Instance Method Details

#flag?(flag) ⇒ Boolean

Returns true if ‘flag` is present in the header’s flag section.

Examples:

puts "this mach-o has position-independent execution" if header.flag?(MH_PIE)

Parameters:

  • flag (Fixnum)

    a mach header flag constant

Returns:

  • (Boolean)

    true if ‘flag` is present in the header’s flag section



285
286
287
# File 'lib/macho/headers.rb', line 285

def flag?(flag)
  flags & flag == flag
end