Class: Elf::ElfFile

Inherits:
Object
  • Object
show all
Defined in:
lib/mithril/elf.rb,
lib/mithril/policy/inject_policy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeElfFile

Returns a new instance of ElfFile.



209
210
211
212
213
214
215
216
217
# File 'lib/mithril/elf.rb', line 209

def initialize
  @dynamic = Dynamic.new
  @relocations = []
  @progbits = []
  @nobits = []
  @pinned_sections = {}
  @notes = []
  @symbols = SymbolTable.new
end

Instance Attribute Details

#bitsObject

Returns the value of attribute bits.



207
208
209
# File 'lib/mithril/elf.rb', line 207

def bits
  @bits
end

#dynamicObject

Returns the value of attribute dynamic.



204
205
206
# File 'lib/mithril/elf.rb', line 204

def dynamic
  @dynamic
end

#endianObject

Returns the value of attribute endian.



207
208
209
# File 'lib/mithril/elf.rb', line 207

def endian
  @endian
end

#entryObject

Returns the value of attribute entry.



203
204
205
# File 'lib/mithril/elf.rb', line 203

def entry
  @entry
end

#extra_phdrsObject

Returns the value of attribute extra_phdrs.



207
208
209
# File 'lib/mithril/elf.rb', line 207

def extra_phdrs
  @extra_phdrs
end

#filetypeObject

Returns the value of attribute filetype.



203
204
205
# File 'lib/mithril/elf.rb', line 203

def filetype
  @filetype
end

#flagsObject

Returns the value of attribute flags.



203
204
205
# File 'lib/mithril/elf.rb', line 203

def flags
  @flags
end

#gnu_tlsObject

Returns the value of attribute gnu_tls.



205
206
207
# File 'lib/mithril/elf.rb', line 205

def gnu_tls
  @gnu_tls
end

#interpObject

Returns the value of attribute interp.



207
208
209
# File 'lib/mithril/elf.rb', line 207

def interp
  @interp
end

#machineObject

Returns the value of attribute machine.



203
204
205
# File 'lib/mithril/elf.rb', line 203

def machine
  @machine
end

#nobitsObject

Returns the value of attribute nobits.



204
205
206
# File 'lib/mithril/elf.rb', line 204

def nobits
  @nobits
end

#notesObject

Returns the value of attribute notes.



207
208
209
# File 'lib/mithril/elf.rb', line 207

def notes
  @notes
end

#pinned_sectionsObject

Some binaries rely on specific address layouts (esp. ld.so)



208
209
210
# File 'lib/mithril/elf.rb', line 208

def pinned_sections
  @pinned_sections
end

#progbitsObject

Returns the value of attribute progbits.



204
205
206
# File 'lib/mithril/elf.rb', line 204

def progbits
  @progbits
end

#relocationsObject

Returns the value of attribute relocations.



204
205
206
# File 'lib/mithril/elf.rb', line 204

def relocations
  @relocations
end

#symbolsObject

, :relocated_symbols



206
207
208
# File 'lib/mithril/elf.rb', line 206

def symbols
  @symbols
end

#versionObject

Returns the value of attribute version.



203
204
205
# File 'lib/mithril/elf.rb', line 203

def version
  @version
end

Instance Method Details

#build_policy(&builder) ⇒ Object



3
4
5
6
7
8
# File 'lib/mithril/policy/inject_policy.rb', line 3

def build_policy(&builder)
  #TODO: Allow special 'default_generator' synthax instead of instance_exec
  Elf::Policy::inject_symbols(self)
  p = Elf::Policy.build(&builder)
  p.inject(self)
end