Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dyn sym refactor #71

Merged
merged 58 commits into from
Jul 27, 2020
Merged

Dyn sym refactor #71

merged 58 commits into from
Jul 27, 2020

Conversation

mellowCS
Copy link
Contributor

No description provided.

mellowCS and others added 30 commits December 9, 2019 11:07
added portable executable support.
changed the install.sh to install more cross compilers
… files

were given the name 'g++'.
This might have broken the test test_cwe248.py.
…te and used generate_tid_map functionality.

added api support to cwe caller.
improved overall code quality of the caller. (removing duplicate code)
Removed the tid map generator call from the external function builder and added it as a parameter
… function

Added functionality to detect binary file format (ELF/PE) in CConv

Soon:
 - adding distinction between parameters of elf and pe binaries in Cconv
Adapted the functionality for register retrieval in the Cconv module.
Reduced code redundancy.
Removed reference to example project in address_translation_test.mli
…te changes in the Makefile

Changed mips64 to mips64el in SConstruct
Made the compilation of test files compatible with travis
Added a new script containing test files to be compiled for unit test
Added a check for resolving external symbols
Added unittest for symbol_utils
Changed Cconv references to Symbol_utils for parse_dyn_syms
@mellowCS mellowCS requested a review from Enkelmann July 20, 2020 09:14

let check_if_symbols_resolved (project : Project.t) (program : program term) (tid_map : word Tid.Map.t) : bool =
let extern = build_and_return_extern_symbols project program tid_map in
let extern = List.filter extern ~f:(fun e ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you give the variable e a more meaningful name? When it comes to readability of code, one-letter names are almost never a good idea.

Comment on lines 238 to 240
match Stdlib.List.mem e.name extern_symbol_blacklist with
| false -> true
| true -> false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ocaml has a not operator for boolean values, you don't need to match them to invert them.

Comment on lines 246 to 253
let not_resolved = List.filter extern ~f:(fun e ->
match Stdlib.List.mem e.tid calls with
| true -> false
| false -> true
) in
match List.length extern = List.length not_resolved with
| true -> false
| false -> true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see the two comments above.

Comment on lines 72 to 74
val get_calls : Bap.Std.program Bap.Std.term -> (Bap.Std.tid * Bap.Std.tid) list

val check_if_symbols_resolved : Bap.Std.Project.t -> Bap.Std.program Bap.Std.term -> Bap.Std.word Bap.Std.Tid.Map.t -> bool
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pleas add doc comments for the two functions.

Also added doc strings to two new functions
@mellowCS mellowCS requested a review from Enkelmann July 27, 2020 06:52
@Enkelmann Enkelmann merged commit 5f9d78f into master Jul 27, 2020
@Enkelmann Enkelmann deleted the dyn_sym_refactor branch July 27, 2020 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants