'Retrieve a single record from the file.
Args:
offset: offset from start of input_dat where header starts
record_size: length of the header according to file (untrusted)
Returns:
A dict containing a single browser history record.'

def _GetRecord(self, offset, record_size):

    record_header = '<4sLQQL'
    get4 = (lambda x: struct.unpack('<L', self.input_dat[x:(x + 4)])[0])
    url_offset = struct.unpack('B', self.input_dat[(offset + 52):(offset + 53)])[0]
    if (url_offset in [255, 254]):
        return None
    data_offset = get4((offset + 68))
    data_size = get4((offset + 72))
    start_pos = (offset + data_offset)
    data = struct.unpack('{0}s'.format(data_size), self.input_dat[start_pos:(start_pos + data_size)])[0]
    fmt = record_header
    unknown_size = (url_offset - struct.calcsize(fmt))
    fmt += '{0}s'.format(unknown_size)
    fmt += '{0}s'.format((record_size - struct.calcsize(fmt)))
    dat = struct.unpack(fmt, self.input_dat[offset:(offset + record_size)])
    (header, blocks, mtime, ctime, ftime, _, url) = dat
    url = url.split(chr(0))[0]
    if mtime:
        mtime = ((mtime / 10) - WIN_UNIX_DIFF_MSECS)
    if ctime:
        ctime = ((ctime / 10) - WIN_UNIX_DIFF_MSECS)
    return {'header': header, 'blocks': blocks, 'urloffset': url_offset, 'data_offset': data_offset, 'data_size': data_size, 'data': data, 'mtime': mtime, 'ctime': ctime, 'ftime': ftime, 'url': url}
