node/lib/metasm/samples/dasm-plugins/match_libsigs.rb
def match(str)
	chunksz = 1 << 20

	chunkoff = 0
	count = 0
	while chunkoff < str.length
		chunk = str[chunkoff, chunksz+@siglenmax]
		count += match_chunk(chunk) { |o, sym| yield chunkoff+o, sym if o < chunksz }
		chunkoff += chunksz
	end
	count
end
# matches the signatures against a big raw string
# yields offset, symname for each match
# returns nr of matches found
matches the signatures against a big raw string
yields offset, symname for each match
returns nr of matches found
matches the signatures against a big raw string yields offset symname for each match returns nr of matches found
def match(str)
	chunksz = 1 << 20
	chunkoff = 0
	count = 0
	while chunkoff < str.length
		chunk = str[chunkoff, chunksz+@siglenmax]
		count += match_chunk(chunk) { |o, sym| yield chunkoff+o, sym if o < chunksz }
		chunkoff += chunksz
	end
	count
end
def match ( str ) chunksz = 1 << 20 chunkoff = 0 count = 0 while chunkoff < str . length chunk = str [ chunkoff , chunksz + @siglenmax ] count += match_chunk ( chunk ) { | o , sym | yield chunkoff + o , sym if o < chunksz } chunkoff += chunksz end count end
matches the signatures against a big raw string
yields offset, symname for each match
returns nr of matches found
matches the signatures against a big raw string yields offset symname for each match returns nr of matches found
str