tools/dump_process_memory/analyze_dumps.py
def _FindPageFromHash(mappings, page_hash):
  """Returns a page with a given hash from a list of mappings.

  Args:
    mappings: ([MappingStats]) List of mappings.
    page_hash: (str) Page hash to look for,

  Returns:
    array.array(uint32_t) with the page content
  """
  for mapping in mappings:
    for i in range(mapping.pages):
      if mapping.hashes[i] == page_hash:
        with open(mapping.filename, 'r') as f:
          f.seek(i * PAGE_SIZE)
          page = _ReadPage(f)
          sha1 = hashlib.sha1()
          sha1.update(page)
          assert page_hash == sha1.digest()
          return page
Returns a page with a given hash from a list of mappings.

  Args:
    mappings: ([MappingStats]) List of mappings.
    page_hash: (str) Page hash to look for,

  Returns:
    array.array(uint32_t) with the page content
  
Returns a page with a given hash from a list of mappings.
Returns a page with a given hash from a list of mappings .
def _FindPageFromHash(mappings, page_hash):
  for mapping in mappings:
    for i in range(mapping.pages):
      if mapping.hashes[i] == page_hash:
        with open(mapping.filename, 'r') as f:
          f.seek(i * PAGE_SIZE)
          page = _ReadPage(f)
          sha1 = hashlib.sha1()
          sha1.update(page)
          assert page_hash == sha1.digest()
          return page
def _FindPageFromHash ( mappings , page_hash ) : for mapping in mappings : for i in range ( mapping . pages ) : if mapping . hashes [ i ] == page_hash : with open ( mapping . filename , 'r' ) as f : f . seek ( i * PAGE_SIZE ) page = _ReadPage ( f ) sha1 = hashlib . sha1 ( ) sha1 . update ( page ) assert page_hash == sha1 . digest ( ) return page
Returns a page with a given hash from a list of mappings.
Returns a page with a given hash from a list of mappings .
"""Returns a page with a given hash from a list of mappings.

  Args:
    mappings: ([MappingStats]) List of mappings.
    page_hash: (str) Page hash to look for,

  Returns:
    array.array(uint32_t) with the page content
  """
array.array(uint32_t) with the page content
array . array ( uint32_t ) with the page content
mappings
([MappingStats]) List of mappings.
( [ MappingStats ] ) List of mappings .
page_hash
(str) Page hash to look for.
( str ) Page hash to look for .