Sha256: 2f70f9872f367fe9f21f414c983815379de8df92f92c21cbdd33fba166e895bf

Contents?: true

Size: 377 Bytes

Versions: 2

Compression:

Stored size: 377 Bytes

Contents

module Elf::Policy::Hacks
  def self.initializer_functions(filename)
    lib = `objdump -D #{filename} | grep -B 3  'callq.*libc_start_main' `
    init_addr = /\$0x([0-9a-f]*),\%r8/.match(lib)[1].to_i(16)
    fini_addr = /\$0x([0-9a-f]*),\%rcx/.match(lib)[1].to_i(16)
    main_addr = /\$0x([0-9a-f]*),\%rdi/.match(lib)[1].to_i(16)
    [init_addr,fini_addr,main_addr]
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
elf-mithril-0.0.5 lib/mithril/policy/default/hacks.rb
elf-mithril-0.0.4 lib/mithril/policy/default/hacks.rb