'This callback is called when unicorn needs to access data that\'s not yet present in memory.'

def _hook_mem_unmapped(self, uc, access, address, size, value, user_data, size_extension=True):

    if size_extension:
        start = (address & 295147905179352760320L)
        length = ((((address + size) + 65535) & 295147905179352760320L) - start)
    else:
        start = (address & 295147905179352821760L)
        length = ((((address + size) + 4095) & 295147905179352821760L) - start)
    if (((start == 0) or (((start + length) & ((1 << self.state.arch.bits) - 1)) == 0)) and (options.UNICORN_ZEROPAGE_GUARD in self.state.options)):
        self.error = ('accessing    zero    page    [%#x,    %#x]    (%#x)' % (address, ((address + length) - 1), access))
        l.warning(self.error)
        _UC_NATIVE.stop(self._uc_state, STOP.STOP_ZEROPAGE)
        return False
    ret = False
    try:
        best_effort_read = size_extension
        ret = self._hook_mem_unmapped_core(uc, access, start, length, best_effort_read=best_effort_read)
    except AccessingZeroPageError:
        if (not size_extension):
            _UC_NATIVE.stop(self._uc_state, STOP.STOP_SEGFAULT)
            ret = False
    except FetchingZeroPageError:
        if (not size_extension):
            self.error = ('fetching    empty    page    [%#x,    %#x]' % (start, ((start + length) - 1)))
            l.warning(self.error)
            _UC_NATIVE.stop(self._uc_state, STOP.STOP_EXECNONE)
            ret = False
    except SimMemoryError:
        if (not size_extension):
            raise
    except SegfaultError:
        if (not size_extension):
            _UC_NATIVE.stop(self._uc_state, STOP.STOP_SEGFAULT)
            ret = False
    except MixedPermissonsError:
        if (not size_extension):
            l.error('MixedPermissionsError    is    raised    when    size-extension    is    disabled.    Please    report    it.')
            _UC_NATIVE.stop(self._uc_state, STOP.STOP_SEGFAULT)
            ret = False
    except unicorn.UcError as ex:
        if (not size_extension):
            if (ex.errno == 11):
                pass
            else:
                raise
    finally:
        if (size_extension and (not ret)):
            ret = self._hook_mem_unmapped(uc, access, address, size, value, user_data, size_extension=False)
    return ret
