· 8 years ago · Jan 02, 2018, 06:26 PM
1CHANGES RELEVANT TO R2
2----------------------
3
4New table:
5
6 sql = """create table if not exists callgraph (
7 id integer primary key,
8 func_id integer not null references functions(id) on delete cascade,
9 address text not null,
10 type text not null)"""
11 cur.execute(sql)
12
13In this table I insert all the callers and callees:
14
15 # Save the callers and callees of the function
16 callers, callees = props[len(props)-4:len(props)-2]
17 sql = "insert into callgraph (func_id, address, type) values (?, ?, ?)"
18 for caller in callers:
19 cur.execute(sql, (func_id, caller, 'caller'))
20
21 for callee in callees:
22 cur.execute(sql, (func_id, callee, 'callee'))
23
24New field:
25
26In the table "functions" I have added a new field called:
27
28 assembly_addrs text
29
30In this field I insert a JSON list of all the addresses (sorted starting always from the entry point of the function). This list is used to match one-to-one assembly instructions from the origin database to the diffing database.