node/lib/metasm/samples/dbg-plugins/heapscan/heapscan.rb
# find all chunks in the memory address space
find all chunks in the memory address space
find all chunks in the memory address space
def scan_heap_xr(base, len)
		dw = dwcache(base, len)
		@chunks.each_key { |p|
			i = (p-base) / @ptsz
			if i >= 0 and i < dw.length
				lst = dw[i, @chunks[p]/@ptsz].find_all { |pp| @chunks[pp] }
				@xrchunksto[p] = lst if not lst.empty?
				lst.each { |pp| (@xrchunksfrom[pp] ||= []) << p }
			end
		}
	end
def scan_heap_xr ( base , len ) dw = dwcache ( base , len ) @chunks . each_key { | p | i = ( p - base ) / @ptsz if i >= 0 and i < dw . length lst = dw [ i , @chunks [ p ] / @ptsz ] . find_all { | pp | @chunks [ pp ] } @xrchunksto [ p ] = lst if not lst . empty? lst . each { | pp | ( @xrchunksfrom [ pp ] ||= [ ] ) << p } end } end
find all chunks in the memory address space
find all chunks in the memory address space
base
len