Class: MachO::LoadCommands::EncryptionInfoCommand

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

Overview

A load command representing the offset to and size of an encrypted segment. Corresponds to LC_ENCRYPTION_INFO.

Direct Known Subclasses

EncryptionInfoCommand64

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=5".freeze
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.

20

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, cryptoff, cryptsize, cryptid) ⇒ EncryptionInfoCommand

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 EncryptionInfoCommand.



1242
1243
1244
1245
1246
1247
# File 'lib/macho/load_commands.rb', line 1242

def initialize(view, cmd, cmdsize, cryptoff, cryptsize, cryptid)
  super(view, cmd, cmdsize)
  @cryptoff = cryptoff
  @cryptsize = cryptsize
  @cryptid = cryptid
end

Instance Attribute Details

#cryptidInteger (readonly)

Returns the encryption system, or 0 if not encrypted yet.

Returns:

  • (Integer)

    the encryption system, or 0 if not encrypted yet



1231
1232
1233
# File 'lib/macho/load_commands.rb', line 1231

def cryptid
  @cryptid
end

#cryptoffInteger (readonly)

Returns the offset to the encrypted segment.

Returns:

  • (Integer)

    the offset to the encrypted segment



1225
1226
1227
# File 'lib/macho/load_commands.rb', line 1225

def cryptoff
  @cryptoff
end

#cryptsizeInteger (readonly)

Returns the size of the encrypted segment.

Returns:

  • (Integer)

    the size of the encrypted segment



1228
1229
1230
# File 'lib/macho/load_commands.rb', line 1228

def cryptsize
  @cryptsize
end

Instance Method Details

#to_hHash

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

Returns:



1250
1251
1252
1253
1254
1255
1256
# File 'lib/macho/load_commands.rb', line 1250

def to_h
  {
    "cryptoff" => cryptoff,
    "cryptsize" => cryptsize,
    "cryptid" => cryptid,
  }.merge super
end