node/lib/metasm/samples/dbg-plugins/heapscan/heapscan.rb
def scan_heap_segment(first, len)
		off = 0
		heapcpy = pagecache(first, len)
		while off < len
			he = @cp.decode_c_struct('_HEAP_ENTRY', heapcpy, off)
			sz = (he.Size ^ @chunkkey_size)*8
			if (he.Flags ^ @chunkkey_flags) & 1 == 1
				@chunks[first+off+@hsz] = sz - (he.UnusedBytes ^ @chunkkey_unusedbytes)
			end
			off += sz
		end
	end
# 4-byte xor key to decrypt the chunk headers
4-byte xor key to decrypt the chunk headers
4 - byte xor key to decrypt the chunk headers
def scan_heap_segment(first, len)
		off = 0
		heapcpy = pagecache(first, len)
		while off < len
			he = @cp.decode_c_struct('_HEAP_ENTRY', heapcpy, off)
			sz = (he.Size ^ @chunkkey_size)*8
			if (he.Flags ^ @chunkkey_flags) & 1 == 1
				@chunks[first+off+@hsz] = sz - (he.UnusedBytes ^ @chunkkey_unusedbytes)
			end
			off += sz
		end
	end
def scan_heap_segment ( first , len ) off = 0 heapcpy = pagecache ( first , len ) while off < len he = @cp . decode_c_struct ( '_HEAP_ENTRY' , heapcpy , off ) sz = ( he . Size ^ @chunkkey_size ) * 8 if ( he . Flags ^ @chunkkey_flags ) & 1 == 1 @chunks [ first + off + @hsz ] = sz - ( he . UnusedBytes ^ @chunkkey_unusedbytes ) end off += sz end end
4-byte xor key to decrypt the chunk headers
4 - byte xor key to decrypt the chunk headers
first
len