Chrome transition type qualifiers "0xa0000000" and "0x32000000"

0

I am extracting Chrome history from the sqlite database. From the visits table, I am extracting transition types. However, when I try to extract the transition qualifiers from it, I get some values like "0xa0000000" or "0x32000000" which are not present in the documentation. So I am unable to interpret them. This is my code:

con = sqlite3.connect('path')
c = con.cursor()
# Change this to your preferred query
#c.execute("select urls.id, urls.url, urls.title, urls.visit_count, urls.typed_count, datetime(("
 #         "urls.last_visit_time/1000000)-11644473600, 'unixepoch', 'localtime') FROM urls")

c.execute("select distinct urls.id, urls.url, urls.title, urls.visit_count, urls.typed_count, datetime(("
          "urls.last_visit_time/1000000)-11644473600, 'unixepoch', 'localtime'), visits.visit_time, "
          "visits.from_visit, visits.transition FROM urls, visits WHERE urls.id = visits.url")
results = c.fetchall()

def chrome_transition_types(val_transaction):
    hex_val_transaction = int(hex(val_transaction), 16)
    # Chrome calls 0xFF the 'CORE_MASK' because the last two hex digits make up the 'core' transition value.
    # Since the transition values we are looking at are bigger than just two hex characters, I'll pad the CORE_MASK out with zeros to make it match (0x000000FF).
    # Since bitwise ANDing a value with 1 simply returns the value, and 0xF = 1111 (binary), all this mask does is say we care about the last two hex digits and can drop the preceding characters.
    hex_val_transaction = hex(hex_val_transaction & 0x000000FF)
    return hex_val_transaction

def chrome_transition_qualifiers(value_transaction):
    hex_value_transaction = int(hex(value_transaction), 16)
    # The 'QUALIFIER_MASK' is 0xFFFFFF00.
    hex_value_transaction = hex(hex_value_transaction & 0xFFFFFF00)
    return hex_value_transaction

# Iterate over each row in the results and assign it to a variable.
for result in results:
    visit_id = result[0]
    visit_url = result[1]
    visit_title = result[2]
    visit_count = result[3]
    typed_count = result[4]
    last_visit_time = result[5]
    visit_time = result[6]
    from_visit = result[7]
    visit_transitions_original = result[8]
    visit_transitions = chrome_transition_types(visit_transitions_original)
    visit_transitions_qualifier = chrome_transition_qualifiers(visit_transitions_original)

    fp = open('store.csv', 'w')
    myFile = csv.writer(fp)
    myFile.writerows(results)
fp.close()

I am unable to understand that is there a problem in my code or I am missing something else?

Any help is appreciated.

Thanks.

google-chrome
browser-history
asked on Stack Overflow Sep 24, 2019 by Jishan • edited Sep 26, 2019 by Jishan

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0