Closed xudon9 closed 3 years ago
Sorry! We are aware the value_set
plugin does not compile with BAP 2.x - it was built for BAP 1. Our main work is on the wp
plugin in this repo, these days, but we hope to find time to revisit the value set analysis soon. I will update the readme to reflect the fact that value_set
is known not to work.
Thank you Chris!
I managed to build it with BAP 2.2.0. I created a PR to show the changes.
Be warned that they're a bit hacky though. :P
Seems that we are looking at the same problem lol. Your PR is cool. Coincidentally we have the same solution. The issue I raised is #298, which also mentioned a runtime problem which can be met. Probably we can communicate about it if you are interested @whst
Ah yes, turned out passing all the unit tests doesn't mean it works. I encountered exactly the same problem now :(
Thanks @whst and @zhouxuan009! I've merged PR #303 and it builds now. Please feel free to open a new issue documenting the broken behavior, and we'll take a look.
The following line declared
equal
to bet -> t -> bool
: https://github.com/draperlaboratory/cbat_tools/blob/4ff5ae9bdfbfa85947f1bcb3e5141309fffb39ae/vsa/value_set/lib/src/cbat_lattice_intf.ml#L34For the definition, https://github.com/draperlaboratory/cbat_tools/blob/4ff5ae9bdfbfa85947f1bcb3e5141309fffb39ae/vsa/value_set/lib/src/cbat_lattice_intf.ml#L142 OCaml think the
(=)
isCore_kernel.Int.t -> Core_kernel.Int.t -> bool
(even when we annotate it withlet equal (a:t) (b:t) = a = b
).Changing the definition to
let equal a b = Bool.(a = b)
solves the problem here, but brings more similar typing errors.Tested with 2 environments,
OCaml = 4.09.1
andbap = 2.3.0-alpha
OCaml = 4.08.1
andbap = 2.2.0