Skip to content

Commit

Permalink
Merge pull request #5 from br0kej/dev
Browse files Browse the repository at this point in the history
Enhancing Call graph generation - Func Metadata and Parallel Deduplication
  • Loading branch information
br0kej authored Dec 6, 2023
2 parents 5ffaabf + fdc35ec commit dcf81a9
Show file tree
Hide file tree
Showing 44 changed files with 546 additions and 367 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bin2ml"
version = "0.2.3"
version = "0.2.4"
edition = "2021"

[dependencies]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"adjacency":[[{"id":1,"weight":0}],[]],"directed":"True","graph":[],"multigraph":false,"nodes":[{"id":0,"funcName":"entry0","functionFeatureSubset":{"name":"entry0","ninstrs":13,"edges":0,"indegree":0,"outdegree":1,"nlocals":0,"nargs":1,"signature":"entry0 (int64_t arg3);"}},{"id":1,"funcName":"unk.0x3fe0","functionFeatureSubset":{"name":"","ninstrs":0,"edges":0,"indegree":0,"outdegree":0,"nlocals":0,"nargs":0,"signature":""}}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"adjacency":[[{"id":1,"weight":0}],[]],"directed":"True","graph":[],"multigraph":false,"nodes":[{"id":0,"funcName":"main","functionFeatureSubset":{"name":"main","ninstrs":38,"edges":11,"indegree":3,"outdegree":6,"nlocals":2,"nargs":0,"signature":"int main (int argc, char **argv, char **envp);"}},{"id":1,"funcName":"sym.imp.printf","functionFeatureSubset":{"name":"sym.imp.printf","ninstrs":2,"edges":0,"indegree":6,"outdegree":0,"nlocals":0,"nargs":0,"signature":"int sym.imp.printf (const char *format);"}}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"adjacency":[[{"id":2,"weight":0},{"id":1,"weight":0}],[],[]],"directed":"True","graph":[],"multigraph":false,"nodes":[{"id":0,"funcName":"sym.__do_global_dtors_aux","functionFeatureSubset":{"name":"sym.__do_global_dtors_aux","ninstrs":14,"edges":5,"indegree":0,"outdegree":2,"nlocals":0,"nargs":0,"signature":"sym.__do_global_dtors_aux ();"}},{"id":1,"funcName":"sym..plt.got","functionFeatureSubset":{"name":"sym..plt.got","ninstrs":2,"edges":0,"indegree":1,"outdegree":0,"nlocals":0,"nargs":0,"signature":"sym..plt.got ();"}},{"id":2,"funcName":"sym.deregister_tm_clones","functionFeatureSubset":{"name":"sym.deregister_tm_clones","ninstrs":9,"edges":4,"indegree":1,"outdegree":0,"nlocals":0,"nargs":0,"signature":"sym.deregister_tm_clones ();"}}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"adjacency":[[{"id":2,"weight":0},{"id":1,"weight":0}],[{"id":3,"weight":0}],[],[]],"directed":"True","graph":[],"multigraph":false,"nodes":[{"id":0,"funcName":"sym.__libc_csu_init","functionFeatureSubset":{"name":"sym.__libc_csu_init","ninstrs":34,"edges":5,"indegree":0,"outdegree":2,"nlocals":0,"nargs":3,"signature":"sym.__libc_csu_init (int64_t arg1, int64_t arg2, int64_t arg3);"}},{"id":1,"funcName":"sym._init","functionFeatureSubset":{"name":"sym._init","ninstrs":8,"edges":3,"indegree":1,"outdegree":1,"nlocals":0,"nargs":0,"signature":"sym._init ();"}},{"id":2,"funcName":"rsp","functionFeatureSubset":{"name":"","ninstrs":0,"edges":0,"indegree":0,"outdegree":0,"nlocals":0,"nargs":0,"signature":""}},{"id":3,"funcName":"unk.0xffffffffffffffff","functionFeatureSubset":{"name":"","ninstrs":0,"edges":0,"indegree":0,"outdegree":0,"nlocals":0,"nargs":0,"signature":""}}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"adjacency":[[{"id":1,"weight":0}],[],[{"id":0,"weight":0}]],"directed":"True","graph":[],"multigraph":false,"nodes":[{"id":0,"funcName":"sym._init","functionFeatureSubset":{"name":"sym._init","ninstrs":8,"edges":3,"indegree":1,"outdegree":1,"nlocals":0,"nargs":0,"signature":"sym._init ();"}},{"id":1,"funcName":"unk.0xffffffffffffffff","functionFeatureSubset":{"name":"","ninstrs":0,"edges":0,"indegree":0,"outdegree":0,"nlocals":0,"nargs":0,"signature":""}},{"id":2,"funcName":"sym.__libc_csu_init","functionFeatureSubset":{"name":"sym.__libc_csu_init","ninstrs":34,"edges":5,"indegree":0,"outdegree":2,"nlocals":0,"nargs":3,"signature":"sym.__libc_csu_init (int64_t arg1, int64_t arg2, int64_t arg3);"}}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"adjacency":[[{"id":1,"weight":0}],[]],"directed":"True","graph":[],"multigraph":false,"nodes":[{"id":0,"funcName":"entry0","functionFeatureSubset":{"name":"entry0","ninstrs":13,"edges":0,"indegree":0,"outdegree":1,"nlocals":0,"nargs":1,"signature":"entry0 (int64_t arg3);"}},{"id":1,"funcName":"unk.0x3fe0","functionFeatureSubset":{"name":"","ninstrs":0,"edges":0,"indegree":0,"outdegree":0,"nlocals":0,"nargs":0,"signature":""}}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"adjacency":[[{"id":1,"weight":0}],[]],"directed":"True","graph":[],"multigraph":false,"nodes":[{"id":0,"funcName":"main","functionFeatureSubset":{"name":"main","ninstrs":38,"edges":11,"indegree":3,"outdegree":6,"nlocals":2,"nargs":0,"signature":"int main (int argc, char **argv, char **envp);"}},{"id":1,"funcName":"sym.imp.printf","functionFeatureSubset":{"name":"sym.imp.printf","ninstrs":2,"edges":0,"indegree":6,"outdegree":0,"nlocals":0,"nargs":0,"signature":"int sym.imp.printf (const char *format);"}}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"adjacency":[[{"id":2,"weight":0},{"id":1,"weight":0}],[],[]],"directed":"True","graph":[],"multigraph":false,"nodes":[{"id":0,"funcName":"sym.__do_global_dtors_aux","functionFeatureSubset":{"name":"sym.__do_global_dtors_aux","ninstrs":14,"edges":5,"indegree":0,"outdegree":2,"nlocals":0,"nargs":0,"signature":"sym.__do_global_dtors_aux ();"}},{"id":1,"funcName":"sym..plt.got","functionFeatureSubset":{"name":"sym..plt.got","ninstrs":2,"edges":0,"indegree":1,"outdegree":0,"nlocals":0,"nargs":0,"signature":"sym..plt.got ();"}},{"id":2,"funcName":"sym.deregister_tm_clones","functionFeatureSubset":{"name":"sym.deregister_tm_clones","ninstrs":9,"edges":4,"indegree":1,"outdegree":0,"nlocals":0,"nargs":0,"signature":"sym.deregister_tm_clones ();"}}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"adjacency":[[{"id":2,"weight":0},{"id":1,"weight":0}],[{"id":3,"weight":0}],[],[]],"directed":"True","graph":[],"multigraph":false,"nodes":[{"id":0,"funcName":"sym.__libc_csu_init","functionFeatureSubset":{"name":"sym.__libc_csu_init","ninstrs":34,"edges":5,"indegree":0,"outdegree":2,"nlocals":0,"nargs":3,"signature":"sym.__libc_csu_init (int64_t arg1, int64_t arg2, int64_t arg3);"}},{"id":1,"funcName":"sym._init","functionFeatureSubset":{"name":"sym._init","ninstrs":8,"edges":3,"indegree":1,"outdegree":1,"nlocals":0,"nargs":0,"signature":"sym._init ();"}},{"id":2,"funcName":"rsp","functionFeatureSubset":{"name":"","ninstrs":0,"edges":0,"indegree":0,"outdegree":0,"nlocals":0,"nargs":0,"signature":""}},{"id":3,"funcName":"unk.0xffffffffffffffff","functionFeatureSubset":{"name":"","ninstrs":0,"edges":0,"indegree":0,"outdegree":0,"nlocals":0,"nargs":0,"signature":""}}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"adjacency":[[{"id":1,"weight":0}],[]],"directed":"True","graph":[],"multigraph":false,"nodes":[{"id":0,"funcName":"sym._init","functionFeatureSubset":{"name":"sym._init","ninstrs":8,"edges":3,"indegree":1,"outdegree":1,"nlocals":0,"nargs":0,"signature":"sym._init ();"}},{"id":1,"funcName":"unk.0xffffffffffffffff","functionFeatureSubset":{"name":"","ninstrs":0,"edges":0,"indegree":0,"outdegree":0,"nlocals":0,"nargs":0,"signature":""}}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"adjacency":[[{"id":1,"weight":0}],[]],"directed":"True","graph":[],"multigraph":false,"nodes":[{"id":0,"funcName":"entry0","functionFeatureSubset":{"name":"entry0","ninstrs":13,"edges":0,"indegree":0,"outdegree":1,"nlocals":0,"nargs":1,"signature":"entry0 (int64_t arg3);"}},{"id":1,"funcName":"unk.0x3fe0","functionFeatureSubset":{"name":"","ninstrs":0,"edges":0,"indegree":0,"outdegree":0,"nlocals":0,"nargs":0,"signature":""}}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"adjacency":[[{"id":1,"weight":0}],[]],"directed":"True","graph":[],"multigraph":false,"nodes":[{"id":0,"funcName":"main","functionFeatureSubset":{"name":"main","ninstrs":38,"edges":11,"indegree":3,"outdegree":6,"nlocals":2,"nargs":0,"signature":"int main (int argc, char **argv, char **envp);"}},{"id":1,"funcName":"sym.imp.printf","functionFeatureSubset":{"name":"sym.imp.printf","ninstrs":2,"edges":0,"indegree":6,"outdegree":0,"nlocals":0,"nargs":0,"signature":"int sym.imp.printf (const char *format);"}}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"adjacency":[[{"id":2,"weight":0},{"id":1,"weight":0}],[],[]],"directed":"True","graph":[],"multigraph":false,"nodes":[{"id":0,"funcName":"sym.__do_global_dtors_aux","functionFeatureSubset":{"name":"sym.__do_global_dtors_aux","ninstrs":14,"edges":5,"indegree":0,"outdegree":2,"nlocals":0,"nargs":0,"signature":"sym.__do_global_dtors_aux ();"}},{"id":1,"funcName":"sym..plt.got","functionFeatureSubset":{"name":"sym..plt.got","ninstrs":2,"edges":0,"indegree":1,"outdegree":0,"nlocals":0,"nargs":0,"signature":"sym..plt.got ();"}},{"id":2,"funcName":"sym.deregister_tm_clones","functionFeatureSubset":{"name":"sym.deregister_tm_clones","ninstrs":9,"edges":4,"indegree":1,"outdegree":0,"nlocals":0,"nargs":0,"signature":"sym.deregister_tm_clones ();"}}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"adjacency":[[{"id":2,"weight":0},{"id":1,"weight":0}],[],[]],"directed":"True","graph":[],"multigraph":false,"nodes":[{"id":0,"funcName":"sym.__libc_csu_init","functionFeatureSubset":{"name":"sym.__libc_csu_init","ninstrs":34,"edges":5,"indegree":0,"outdegree":2,"nlocals":0,"nargs":3,"signature":"sym.__libc_csu_init (int64_t arg1, int64_t arg2, int64_t arg3);"}},{"id":1,"funcName":"sym._init","functionFeatureSubset":{"name":"sym._init","ninstrs":8,"edges":3,"indegree":1,"outdegree":1,"nlocals":0,"nargs":0,"signature":"sym._init ();"}},{"id":2,"funcName":"rsp","functionFeatureSubset":{"name":"","ninstrs":0,"edges":0,"indegree":0,"outdegree":0,"nlocals":0,"nargs":0,"signature":""}}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"adjacency":[[{"id":1,"weight":0}],[],[{"id":0,"weight":0}]],"directed":"True","graph":[],"multigraph":false,"nodes":[{"id":0,"funcName":"sym._init","functionFeatureSubset":{"name":"sym._init","ninstrs":8,"edges":3,"indegree":1,"outdegree":1,"nlocals":0,"nargs":0,"signature":"sym._init ();"}},{"id":1,"funcName":"unk.0xffffffffffffffff","functionFeatureSubset":{"name":"","ninstrs":0,"edges":0,"indegree":0,"outdegree":0,"nlocals":0,"nargs":0,"signature":""}},{"id":2,"funcName":"sym.__libc_csu_init","functionFeatureSubset":{"name":"sym.__libc_csu_init","ninstrs":34,"edges":5,"indegree":0,"outdegree":2,"nlocals":0,"nargs":3,"signature":"sym.__libc_csu_init (int64_t arg1, int64_t arg2, int64_t arg3);"}}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"adjacency":[[{"id":1,"weight":0}],[]],"directed":"True","graph":[],"multigraph":false,"nodes":[{"id":0,"funcName":"entry0"},{"id":1,"funcName":"unk.0x3fe0"}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"adjacency":[[{"id":1,"weight":0}],[]],"directed":"True","graph":[],"multigraph":false,"nodes":[{"id":0,"funcName":"main"},{"id":1,"funcName":"sym.imp.printf"}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"adjacency":[[{"id":2,"weight":0},{"id":1,"weight":0}],[],[]],"directed":"True","graph":[],"multigraph":false,"nodes":[{"id":0,"funcName":"sym.__do_global_dtors_aux"},{"id":1,"funcName":"sym..plt.got"},{"id":2,"funcName":"sym.deregister_tm_clones"}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"adjacency":[[{"id":2,"weight":0},{"id":1,"weight":0}],[],[]],"directed":"True","graph":[],"multigraph":false,"nodes":[{"id":0,"funcName":"sym.__libc_csu_init"},{"id":1,"funcName":"sym._init"},{"id":2,"funcName":"rsp"}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"adjacency":[[{"id":1,"weight":0}],[],[{"id":0,"weight":0}]],"directed":"True","graph":[],"multigraph":false,"nodes":[{"id":0,"funcName":"sym._init"},{"id":1,"funcName":"unk.0xffffffffffffffff"},{"id":2,"funcName":"sym.__libc_csu_init"}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"adjacency":[[{"id":1,"weight":0}],[]],"directed":"True","graph":[],"multigraph":false,"nodes":[{"id":0,"funcName":"entry0","functionFeatureSubset":{"name":"entry0","ninstrs":13,"edges":0,"indegree":0,"outdegree":1,"nlocals":0,"nargs":1,"signature":"entry0 (int64_t arg3);"}},{"id":1,"funcName":"unk.0x3fe0","functionFeatureSubset":{"name":"","ninstrs":0,"edges":0,"indegree":0,"outdegree":0,"nlocals":0,"nargs":0,"signature":""}}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"adjacency":[[{"id":1,"weight":0}],[]],"directed":"True","graph":[],"multigraph":false,"nodes":[{"id":0,"funcName":"main","functionFeatureSubset":{"name":"main","ninstrs":38,"edges":11,"indegree":3,"outdegree":6,"nlocals":2,"nargs":0,"signature":"int main (int argc, char **argv, char **envp);"}},{"id":1,"funcName":"sym.imp.printf","functionFeatureSubset":{"name":"sym.imp.printf","ninstrs":2,"edges":0,"indegree":6,"outdegree":0,"nlocals":0,"nargs":0,"signature":"int sym.imp.printf (const char *format);"}}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"adjacency":[[{"id":2,"weight":0},{"id":1,"weight":0}],[],[]],"directed":"True","graph":[],"multigraph":false,"nodes":[{"id":0,"funcName":"sym.__do_global_dtors_aux","functionFeatureSubset":{"name":"sym.__do_global_dtors_aux","ninstrs":14,"edges":5,"indegree":0,"outdegree":2,"nlocals":0,"nargs":0,"signature":"sym.__do_global_dtors_aux ();"}},{"id":1,"funcName":"sym..plt.got","functionFeatureSubset":{"name":"sym..plt.got","ninstrs":2,"edges":0,"indegree":1,"outdegree":0,"nlocals":0,"nargs":0,"signature":"sym..plt.got ();"}},{"id":2,"funcName":"sym.deregister_tm_clones","functionFeatureSubset":{"name":"sym.deregister_tm_clones","ninstrs":9,"edges":4,"indegree":1,"outdegree":0,"nlocals":0,"nargs":0,"signature":"sym.deregister_tm_clones ();"}}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"adjacency":[[{"id":2,"weight":0},{"id":1,"weight":0}],[],[]],"directed":"True","graph":[],"multigraph":false,"nodes":[{"id":0,"funcName":"sym.__libc_csu_init","functionFeatureSubset":{"name":"sym.__libc_csu_init","ninstrs":34,"edges":5,"indegree":0,"outdegree":2,"nlocals":0,"nargs":3,"signature":"sym.__libc_csu_init (int64_t arg1, int64_t arg2, int64_t arg3);"}},{"id":1,"funcName":"sym._init","functionFeatureSubset":{"name":"sym._init","ninstrs":8,"edges":3,"indegree":1,"outdegree":1,"nlocals":0,"nargs":0,"signature":"sym._init ();"}},{"id":2,"funcName":"rsp","functionFeatureSubset":{"name":"","ninstrs":0,"edges":0,"indegree":0,"outdegree":0,"nlocals":0,"nargs":0,"signature":""}}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"adjacency":[[{"id":1,"weight":0}],[]],"directed":"True","graph":[],"multigraph":false,"nodes":[{"id":0,"funcName":"sym._init","functionFeatureSubset":{"name":"sym._init","ninstrs":8,"edges":3,"indegree":1,"outdegree":1,"nlocals":0,"nargs":0,"signature":"sym._init ();"}},{"id":1,"funcName":"unk.0xffffffffffffffff","functionFeatureSubset":{"name":"","ninstrs":0,"edges":0,"indegree":0,"outdegree":0,"nlocals":0,"nargs":0,"signature":""}}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"adjacency":[[{"id":1,"weight":0}],[]],"directed":"True","graph":[],"multigraph":false,"nodes":[{"id":0,"funcName":"entry0"},{"id":1,"funcName":"unk.0x3fe0"}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"adjacency":[[{"id":2,"weight":0},{"id":1,"weight":0}],[],[]],"directed":"True","graph":[],"multigraph":false,"nodes":[{"id":0,"funcName":"sym.__do_global_dtors_aux"},{"id":1,"funcName":"sym..plt.got"},{"id":2,"funcName":"sym.deregister_tm_clones"}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"adjacency":[[{"id":2,"weight":0},{"id":1,"weight":0}],[],[]],"directed":"True","graph":[],"multigraph":false,"nodes":[{"id":0,"funcName":"sym.__libc_csu_init"},{"id":1,"funcName":"sym._init"},{"id":2,"funcName":"rsp"}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"adjacency":[[{"id":1,"weight":0}],[]],"directed":"True","graph":[],"multigraph":false,"nodes":[{"id":0,"funcName":"sym._init"},{"id":1,"funcName":"unk.0xffffffffffffffff"}]}
24 changes: 0 additions & 24 deletions data-examples/processed/graphs/test_bin_cg/entry0-cg.json

This file was deleted.

This file was deleted.

This file was deleted.

24 changes: 0 additions & 24 deletions data-examples/processed/graphs/test_bin_cg/sym._init-cg.json

This file was deleted.

6 changes: 3 additions & 3 deletions src/afij.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pub struct Regvar {
pub ref_field: String,
}

#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
#[derive(Default, Debug, Clone, PartialEq, Hash, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AFIJFeatureSubset {
pub name: String,
Expand All @@ -115,8 +115,8 @@ impl From<&AFIJFunctionInfo> for AFIJFeatureSubset {
fn from(src: &AFIJFunctionInfo) -> AFIJFeatureSubset {
AFIJFeatureSubset {
name: src.name.clone(),
ninstrs: src.ninstrs.clone(),
edges: src.edges.clone(),
ninstrs: src.ninstrs,
edges: src.edges,
indegree: src.indegree.unwrap_or(0),
outdegree: src.outdegree.unwrap_or(0),
nlocals: src.nlocals.unwrap_or(0),
Expand Down
Loading

0 comments on commit dcf81a9

Please sign in to comment.