def try_read(self, address, size):
        """Try to read memory content at specified address.

        If any location was not written before, it returns a tuple
        (False, None). Otherwise, it returns (True, memory content).

        """
        value = 0x0

        for i in range(0, size):
            addr = address + i

            if addr in self._memory:
                value |= self._read_byte(addr) << (i * 8)
            else:
                return False, None

        return True, value
def try_read ( self , address , size ) : value = 0x0 for i in range ( 0 , size ) : addr = address + i if addr in self . _memory : value |= self . _read_byte ( addr ) << ( i * 8 ) else : return False , None return True , value
Try to read memory content at specified address.

        If any location was not written before, it returns a tuple
        (False, None). Otherwise, it returns (True, memory content).