Class: Rex::ElfParsey::ElfBase::GenericStruct

Inherits:
Object
  • Object
show all
Defined in:
lib/rex/elfparsey/elfbase.rb

Overview

Most significant byte first

Direct Known Subclasses

GenericHeader

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_struct) ⇒ GenericStruct

Returns a new instance of GenericStruct.



125
126
127
# File 'lib/rex/elfparsey/elfbase.rb', line 125

def initialize(_struct)
	self.struct = _struct
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args) ⇒ Object



147
148
149
# File 'lib/rex/elfparsey/elfbase.rb', line 147

def method_missing(meth, *args)
	v[meth.to_s] || (raise NoMethodError.new, meth)
end

Instance Attribute Details

#structObject

Returns the value of attribute struct.



124
125
126
# File 'lib/rex/elfparsey/elfbase.rb', line 124

def struct
  @struct
end

Instance Method Details

#[](*args) ⇒ Object

Access a value by array



138
139
140
# File 'lib/rex/elfparsey/elfbase.rb', line 138

def [](*args)
	struct[*args]
end

#keysObject

Obtain an array of all fields



143
144
145
# File 'lib/rex/elfparsey/elfbase.rb', line 143

def keys
	struct.keys
end

#vObject

Access a value



132
133
134
135
# File 'lib/rex/elfparsey/elfbase.rb', line 132

def v
	struct.v
	
end