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

Final 1.3 update #688

Merged
merged 61 commits into from
Aug 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
1cb4158
makes main state global and few bug fixes
ivg Jul 5, 2017
80e282c
adds attributes to bitvectors
ivg Jul 7, 2017
f1c01cf
names the input interface of the Regular functor
ivg Jul 7, 2017
c727172
wip
ivg Jul 14, 2017
0270a94
wip
ivg Jul 21, 2017
57ac0c6
wip
ivg Jul 25, 2017
356644a
wip
ivg Aug 1, 2017
9ffefbd
wip
ivg Aug 2, 2017
b2de45e
wip - now it compiles at least
ivg Aug 3, 2017
693ef92
Merge branch 'master' into identifiable-values
ivg Aug 3, 2017
3dce937
ensures normalization and well-typedness
ivg Aug 3, 2017
cc61387
fixes a bug in arm lifter
ivg Aug 4, 2017
5cfa5f3
published Exp.normalization function.
ivg Aug 4, 2017
5a1951a
fixes a bug in type checker and exp normalizer
ivg Aug 4, 2017
a9b0014
do not force constant folding
ivg Aug 4, 2017
91fc4f3
so far force the normalization in the exp
ivg Aug 4, 2017
a603537
removes exp normalization
ivg Aug 4, 2017
8134dca
sets BAP_DEBUG to true
ivg Aug 7, 2017
7ac0c14
adds primus mark visted plugin
ivg Aug 7, 2017
92a0fbd
a precedence sensitive exp pretty printer
ivg Aug 7, 2017
220bef3
fixes simplifier, adds cast simplification
ivg Aug 7, 2017
7aab046
apply constant folding by default
ivg Aug 7, 2017
1a08c7d
fixes the Bitvector.unsigned function
ivg Aug 7, 2017
9b53efa
Merge branch 'master' into identifiable-values
ivg Aug 7, 2017
31c9d8d
removes unnecessary optimizations from the IR.lift
ivg Aug 7, 2017
56ec68e
adds ssa and dead-code-elimination plugins
ivg Aug 7, 2017
ca78a3d
makes string_of_value more consistent
ivg Aug 8, 2017
dfa249f
publishes Exp.substitute function
ivg Aug 8, 2017
3c91a53
enhances dead-code elimination plugin
ivg Aug 8, 2017
1a8788d
renames mem32 and mem64 in x86 lifter to mem
ivg Aug 8, 2017
efc0bd6
fixes and enhances lifted representation of shifts
ivg Aug 8, 2017
8c0df9e
applies simplification to assoc operations
ivg Aug 9, 2017
6cd6abb
few optimizations and refactoring in old tainter
ivg Aug 9, 2017
0c7ebd8
normalizes and simplifies expression before eval
ivg Aug 9, 2017
68bfc3b
switches propagator to a sparse storage
ivg Aug 9, 2017
73d3e8c
removes unused code
ivg Aug 9, 2017
6ae6dbe
calls exit if bap is interupted by Ctrl-C
ivg Aug 9, 2017
bc13d48
implements new Bitvector pretty printer
ivg Aug 10, 2017
f0ddbd5
Merge branch 'master' into final-1.3-update
ivg Aug 11, 2017
ad61176
docs update and few renamings
ivg Aug 16, 2017
ff1f1cb
updated testsuite
ivg Aug 16, 2017
38368bd
fix dash/underscore issue
ivg Aug 16, 2017
f02e92b
automates documentation generation
ivg Aug 16, 2017
f63ac4c
updates Primus docs
ivg Aug 17, 2017
63c7883
adds monads interfaces
ivg Aug 18, 2017
04b7d1d
updates monads docs
ivg Aug 21, 2017
ef26b3b
cleans and documents the monads library
ivg Aug 22, 2017
9779116
removes extra blank lines from bap.mli
ivg Aug 22, 2017
a93d7d7
adds type checker to backends
ivg Aug 22, 2017
6d71e01
removes unnecessary calls to Bil.fixpoint
ivg Aug 22, 2017
99ae4d0
Merge branch 'master' into final-1.3-update
ivg Aug 22, 2017
f37bee9
adds missing manpages
ivg Aug 22, 2017
f296ce4
typo in the docs
ivg Aug 22, 2017
a05087c
gone crazy and rewrote the taint propagation plugin
ivg Aug 23, 2017
a99e870
makes oasy little bit less hungry
ivg Aug 23, 2017
70752f3
dispatches linker unresolved calls to a lisp stub
ivg Aug 24, 2017
66ee85c
fixes a bug in random number generation
ivg Aug 24, 2017
66f3c6c
don't fail the whole program on a division by zero
ivg Aug 24, 2017
6f4e4f2
enhances the run plugin with the multi-entry mode
ivg Aug 24, 2017
9aef93b
flushes output from primus after each character
ivg Aug 24, 2017
87ad64f
adds a Primus component that ensures termination
ivg Aug 24, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ addons:
- opam
env:
global:
- OPAMYES=true PACKAGE=bap TESTS=false BAP_RUN_TEST=true BAP_RUN_CHECK=true OPAM_SWITCH=$OCAML_VERSION
- OPAMYES=true PACKAGE=bap BAP_DEBUG=true TESTS=false BAP_RUN_TEST=true BAP_RUN_CHECK=true OPAM_SWITCH=$OCAML_VERSION
matrix:
- OCAML_VERSION=4.02
- OCAML_VERSION=4.03
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ build: setup.ml

.PHONY: doc
doc:
@ocamlbuild -pkg bap bapdoc.native
make -C doc

all:
Expand Down
17 changes: 10 additions & 7 deletions bapdoc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@

*)

#use "topfind";;
#require "findlib";;
#require "bap";;

open Core_kernel.Std
open Bap_plugins.Std

Expand Down Expand Up @@ -55,6 +51,11 @@ let libraries = [
];
]

let std_libraries = [
"Bap"; "Core_kernel"; "Regular"; "Graphlib"; "Future"; "Monads";
"Bap_primus"
]

let frontends = [
"bap", "bap main frontend";
"bap-mc", "machine code playground";
Expand Down Expand Up @@ -242,6 +243,8 @@ let plugins =
let plugins_index =
sprintf "\n\n{2 Plugins}\n%s" plugins

let hides = String.concat ~sep:"," std_libraries
let argot = if Dynlink.is_native then "argot.cmxs" else "argot.cmo"

let render modules =
let intro,out = Filename.open_temp_file "intro" ".txt" in
Expand All @@ -256,10 +259,10 @@ let render modules =
"-html";
"-colorize-code";
"-short-paths";
"-i /home/ivg/.opam/devel/lib/argot";
"-g argot.cmo";
"-i"; Pkg.dir "argot";
"-g"; argot;
"-short-functors";
"-hide Bap.Std,Core_kernel.Std,Regular.Std,Graphlib.Std,Future.Std,Monads.Std,Bap_primus.Std";
"-hide"; hides;
"-passopt -search-frame";
"-passopt -search";
"-passopt -full-text";
Expand Down
17 changes: 14 additions & 3 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
.PHONY: doc
doc:
@ocaml ../bapdoc.ml 2>bapdoc.log
.PHONY: doc argot


doc: argot
../bapdoc.native 2>bapdoc.log


argot:
git clone https://github.com/ivg/argot.git
cd argot; git checkout 1.2-devel
cd argot && sh configure
make -C argot all
make -C argot install
rm -rf argot
2 changes: 1 addition & 1 deletion lib/arm/arm_cond.ml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let of_int_exn = function
let create w =
let open Or_error in
Word.to_int w >>= fun w ->
try_with (fun () -> of_int_exn w)
try_with ~backtrace:true (fun () -> of_int_exn w)

include Regular.Make(struct
type t = cond [@@deriving bin_io, compare, sexp]
Expand Down
7 changes: 2 additions & 5 deletions lib/arm/arm_lifter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1038,10 +1038,7 @@ let arm_ops_exn ops () =
~error:(Error.create "unsupported operand" op Op.sexp_of_t )
(Arm_op.create op))

let arm_ops ops = try_with (arm_ops_exn ops)



let arm_ops ops = try_with ~backtrace:true (arm_ops_exn ops)

module CPU = struct
include Arm_env
Expand Down Expand Up @@ -1125,4 +1122,4 @@ let insn_exn mem insn : bil Or_error.t =
let lift mem insn =
try insn_exn mem insn >>| resolve_pc mem with
| Lifting_failed msg -> errorf "%s:%s" (Basic.Insn.name insn) msg
| exn -> of_exn exn
| exn -> of_exn ~backtrace:`Get exn
3 changes: 2 additions & 1 deletion lib/arm/arm_mem.ml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ let lift_r ~(dst1 : Var.t) ?(dst2 : Var.t option) ~(base : Var.t)
let load m n = Bil.(load m n LittleEndian typ) in

let temp = match size with
| B | H -> tmp reg32_t
| B -> tmp reg8_t
| H -> tmp reg16_t
| _ -> dst1 in

let four = Bil.int (Word.of_int 4 ~width:32) in
Expand Down
2 changes: 1 addition & 1 deletion lib/arm/arm_mem_shift.ml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ let lift_r_op ~dest1 ?dest2 ?shift ~base ~offset mode sign size operation =
| `Imm w ->
let width = Word.bitwidth w in
let _1 = Word.one 32 in
let min_32 = Word.Int_exn.(_1 lsl Word.of_int 31 ~width) in
let min_32 = Word.(_1 lsl Word.of_int 31 ~width) in
if Word.(w = min_32)
then Bil.(int Word.(zero width))
else Bil.(int w) in
Expand Down
2 changes: 1 addition & 1 deletion lib/arm/arm_shift.ml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ let shift_c ~src shift_type ~shift t =
let ret1 = Bil.(src lsr e1) in
let carryin = Bil.(cast unsigned bits (var Env.cf) lsl (bits_e - e1)) in
let shifted = Bil.(ret1 lor carryin) in
let carry = nth_bit Bil.(int (Word.zero 0)) src in
let carry = nth_bit Bil.(int (Word.zero 1)) src in
shifted, carry

let r_shift ~src shift_type ~shift t =
Expand Down
Loading