joxeankoret

Untitled

Jan 2nd, 2018
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. CHANGES RELEVANT TO R2
  2. ----------------------
  3.  
  4. New 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.  
  13. In 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.  
  24. New field:
  25.  
  26. In the table "functions" I have added a new field called:
  27.  
  28. assembly_addrs text
  29.  
  30. In 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.
Advertisement
Add Comment
Please, Sign In to add comment