Skip to content

Commit

Permalink
uses function starts as the entires when building the symtab
Browse files Browse the repository at this point in the history
Uses the same initial starting points when building whole program CFG
and symbol table. This improves performance and prevents discrepancies
between the set of instructions discovered during the disassembly and
the set of instructions that are discovered when we build various
graph representations. In certain cases, e.g., in the interworked
binaries, such discrepancies could result in an abnormal termiantion
of a program.
  • Loading branch information
ivg committed Apr 19, 2022
1 parent 5c4bced commit ab0a477
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/bap_disasm/bap_disasm_rec.ml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ let has_conditional_jump blk =
let global_cfg disasm =
Driver.explore disasm
~init:Cfg.empty
~entries:(Set.to_sequence@@Driver.subroutines disasm)
~block:(fun mem insns ->
Driver.execution_order insns >>=
KB.List.filter_map ~f:(fun label ->
Expand Down
1 change: 1 addition & 0 deletions lib/bap_disasm/bap_disasm_symtab.ml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ let create_intra disasm calls =
let create_inter disasm calls init =
Disasm.explore disasm
~init
~entries:(Set.to_sequence@@Disasm.subroutines disasm)
~block:(fun mem _ -> KB.return mem)
~node:(fun _ s -> KB.return s)
~edge:(fun src dst s ->
Expand Down

0 comments on commit ab0a477

Please sign in to comment.