Module: Util

Defined in:
lib/elfcat/util.rb

Class Method Summary collapse

Class Method Details

.concatenate(_h, _start, _length = 1) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/elfcat/util.rb', line 22

def self.concatenate _h, _start, _length = 1
  start = _start
  length = _length
  result = 0

  loop do
    result |= (_h[start] << ((length - 1) * 8))

    length -= 1
    break if length == 0
    start += 1
  end

  return {address: _start, length: _length, data: result}
end