lib/pedump/sig_parser.rb
def _merge sigs
        sizes = sigs.map(&:re).map(&:size)

        if sizes.uniq.size != 1
          puts "[?] wrong sizes: #{sizes.inspect}"
          return nil
        end

        res = sigs.map(&:re)
        diff = _diff res
        return nil unless diff

        ref = res.first
        ref[0...diff.first] + [OrBlock.new(res.map{ |re| re[diff] })] + ref[(diff.last+1)..-1]
      end
# merge array of signatures into one signature
merge array of signatures into one signature
merge array of signatures into one signature
def _merge sigs
        sizes = sigs.map(&:re).map(&:size)
        if sizes.uniq.size != 1
          puts "[?] wrong sizes: #{sizes.inspect}"
          return nil
        end
        res = sigs.map(&:re)
        diff = _diff res
        return nil unless diff
        ref = res.first
        ref[0...diff.first] + [OrBlock.new(res.map{ |re| re[diff] })] + ref[(diff.last+1)..-1]
      end
def _merge sigs sizes = sigs . map ( & :re ) . map ( & :size ) if sizes . uniq . size != 1 puts "[?] wrong sizes: #{sizes.inspect}" return nil end res = sigs . map ( & :re ) diff = _diff res return nil unless diff ref = res . first ref [ 0 ... diff . first ] + [ OrBlock . new ( res . map { | re | re [ diff ] } ) ] + ref [ ( diff . last + 1 ) .. - 1 ] end
merge array of signatures into one signature
merge array of signatures into one signature
sigs