Class: Bubing::BinaryInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/bubing/binary_info.rb

Constant Summary collapse

X86_32_RE =
/ELF 32-bit/
X86_64_RE =
/ELF 64-bit/
EXECUTABLE_RE =
/LSB executable/
SHARED_OBJECT_RE =
/LSB shared object/
X86_32_INTERPRETER =
'ld-linux.so'.freeze
X86_64_INTERPRETER =
'ld-linux-x86-64.so'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(binary) ⇒ BinaryInfo

Returns a new instance of BinaryInfo.



20
21
22
23
24
25
# File 'lib/bubing/binary_info.rb', line 20

def initialize(binary)
  @binary = binary
  @file_output = `file #{@binary}`
  @interpreter = detect_interpreter
  @type = detect_type
end

Instance Attribute Details

#interpreterObject (readonly)

Returns the value of attribute interpreter.



18
19
20
# File 'lib/bubing/binary_info.rb', line 18

def interpreter
  @interpreter
end

#typeObject (readonly)

Returns the value of attribute type.



18
19
20
# File 'lib/bubing/binary_info.rb', line 18

def type
  @type
end