parameters: (self, key_a, key_b)
return_statement: return diffs
docstring: step through each block in snapshot-b and contrast with each block in snapshot-a.
docstring_summary: step through each block in snapshot-b and contrast with each block in snapshot-a.
docstring_tokens: step through each block in snapshot - b and contrast with each block in snapshot - a .
function: def diff (self, key_a, key_b):
          """
          step through each block in snapshot-b and contrast with each block in snapshot-a.
          """
  
          a = self.snapshots[key_a]
          b = self.snapshots[key_b]
  
          diffs = []
  
          for address_b, block_b in b.iteritems():
              if address_b not in a.keys():
                  diffs.append("new block in %s @%08x:%d" % (key_b, address_b, len(block_b.data)))
              else:
                  block_a = a[address_b]
                  tuple_a = (key_a, block_a.mbi.BaseAddress, len(block_a.data))
                  tuple_b = (key_b, block_b.mbi.BaseAddress, len(block_b.data))
  
                  if block_a.data == block_b.data:
                      diffs.append("%s.%08x:%d == %s.%08x:%d" % (tuple_a + tuple_b))
                  else:
                      diff_count = (self.byte_diff_count(block_a.data, block_b.data), )
                      diffs.append("%s.%08x:%d != %s.%08x:%d [%d]" % (tuple_a + tuple_b + diff_count))
  
          return diffs
function_tokens: def diff ( self , key_a , key_b ) : a = self . snapshots [ key_a ] b = self . snapshots [ key_b ] diffs = [ ] for address_b , block_b in b . iteritems ( ) : if address_b not in a . keys ( ) : diffs . append ( "new block in %s @%08x:%d" % ( key_b , address_b , len ( block_b . data ) ) ) else : block_a = a [ address_b ] tuple_a = ( key_a , block_a . mbi . BaseAddress , len ( block_a . data ) ) tuple_b = ( key_b , block_b . mbi . BaseAddress , len ( block_b . data ) ) if block_a . data == block_b . data : diffs . append ( "%s.%08x:%d == %s.%08x:%d" % ( tuple_a + tuple_b ) ) else : diff_count = ( self . byte_diff_count ( block_a . data , block_b . data ) , ) diffs . append ( "%s.%08x:%d != %s.%08x:%d [%d]" % ( tuple_a + tuple_b + diff_count ) ) return diffs