Module: Ronin::Support::Binary::CTypes::Mixin
- Defined in:
- lib/ronin/support/binary/ctypes/mixin.rb
Overview
Adds a type system that can be used by Memory objects.
Instance Attribute Summary collapse
-
#arch ⇒ :x86, ...
readonly
The desired architecture of the binary format.
-
#endian ⇒ :little, ...
readonly
The endianness of the binary format.
-
#os ⇒ :linux, ...
readonly
The desired Operating System (OS) of the binary format.
-
#type_resolver ⇒ Resolver
readonly
The type resolver.
-
#type_system ⇒ Native, ...
readonly
The type system module or object to lookup type names in.
Instance Method Summary collapse
-
#initialize_type_system(type_system: nil, endian: nil, arch: nil, os: nil) ⇒ Object
protected
Initializes the type system.
Instance Attribute Details
#arch ⇒ :x86, ... (readonly)
The desired architecture of the binary format.
44 45 46 |
# File 'lib/ronin/support/binary/ctypes/mixin.rb', line 44 def arch @arch end |
#endian ⇒ :little, ... (readonly)
The endianness of the binary format.
36 37 38 |
# File 'lib/ronin/support/binary/ctypes/mixin.rb', line 36 def endian @endian end |
#os ⇒ :linux, ... (readonly)
The desired Operating System (OS) of the binary format.
53 54 55 |
# File 'lib/ronin/support/binary/ctypes/mixin.rb', line 53 def os @os end |
#type_resolver ⇒ Resolver (readonly)
The type resolver.
80 81 82 |
# File 'lib/ronin/support/binary/ctypes/mixin.rb', line 80 def type_resolver @type_resolver end |
#type_system ⇒ Native, ... (readonly)
The type system module or object to lookup type names in.
73 74 75 |
# File 'lib/ronin/support/binary/ctypes/mixin.rb', line 73 def type_system @type_system end |
Instance Method Details
#initialize_type_system(type_system: nil, endian: nil, arch: nil, os: nil) ⇒ Object (protected)
Initializes the type system.
Optional type system to use instead.
The desired architecture to use.
The Operating System (OS) to use.
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/ronin/support/binary/ctypes/mixin.rb', line 119 def initialize_type_system(type_system: nil, endian: nil, arch: nil, os: nil) @endian = endian @arch = arch @os = os @type_system = type_system || CTypes.platform( endian: endian, arch: arch, os: os ) @type_resolver = CTypes::TypeResolver.new(@type_system) end |