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

Commits on Jul 5, 2017

  1. makes main state global and few bug fixes

    The main change is that now there is only one main state in the
    machine (aka project), not a separate copy per machine.
    
    This commit also fixes leave-{blk,sub} events and adds several new
    observations, such as exn-raised, that occurs every time a machine
    switches to an exceptional control flow.
    
    The commit also adds few common method to the monad interface.
    ivg committed Jul 5, 2017
    Copy the full SHA
    1cb4158 View commit details
    Browse the repository at this point in the history

Commits on Jul 7, 2017

  1. adds attributes to bitvectors

    Now it is possible to attach arbitrary values to a bitvector.
    ivg committed Jul 7, 2017
    Copy the full SHA
    80e282c View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    f1c01cf View commit details
    Browse the repository at this point in the history

Commits on Jul 14, 2017

  1. wip

    ivg committed Jul 14, 2017
    Copy the full SHA
    c727172 View commit details
    Browse the repository at this point in the history

Commits on Jul 21, 2017

  1. wip

    ivg committed Jul 21, 2017
    Copy the full SHA
    0270a94 View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2017

  1. wip

    ivg committed Jul 25, 2017
    Copy the full SHA
    57ac0c6 View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2017

  1. wip

    ivg committed Aug 1, 2017
    Copy the full SHA
    356644a View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2017

  1. wip

    ivg committed Aug 2, 2017
    Copy the full SHA
    9ffefbd View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2017

  1. wip - now it compiles at least

    ivg committed Aug 3, 2017
    Copy the full SHA
    b2de45e View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    693ef92 View commit details
    Browse the repository at this point in the history
  3. ensures normalization and well-typedness

    also fixes a bug in Eval.binop.
    ivg committed Aug 3, 2017
    Copy the full SHA
    3dce937 View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2017

  1. fixes a bug in arm lifter

    This bug leads to a type error, as a result of a byte load and a half
    word load is stored in a 32 bit variable.
    ivg committed Aug 4, 2017
    Copy the full SHA
    cc61387 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    5cfa5f3 View commit details
    Browse the repository at this point in the history
  3. fixes a bug in type checker and exp normalizer

    a type checker didn't held correctly shifts
    and the normalizer didn't properly recurse
    ivg committed Aug 4, 2017
    Copy the full SHA
    5a1951a View commit details
    Browse the repository at this point in the history
  4. do not force constant folding

    allow a backend to choose whether to propagate consts or not.
    ivg committed Aug 4, 2017
    Copy the full SHA
    a9b0014 View commit details
    Browse the repository at this point in the history
  5. so far force the normalization in the exp

    this is temporal cludge.
    ivg committed Aug 4, 2017
    Copy the full SHA
    91fc4f3 View commit details
    Browse the repository at this point in the history
  6. removes exp normalization

    BIR becomes unreadable. We will apply normalization when needed.
    
    Later, we may add a memoization or stuff like that.
    ivg committed Aug 4, 2017
    Copy the full SHA
    a603537 View commit details
    Browse the repository at this point in the history

Commits on Aug 7, 2017

  1. sets BAP_DEBUG to true

    this enables better diagnostics of compilation and configuration errors
    on travis.
    ivg committed Aug 7, 2017
    Copy the full SHA
    8134dca View commit details
    Browse the repository at this point in the history
  2. adds primus mark visted plugin

    the plugin will mark all terms that were visited by Primus with the
    visited attribute.
    ivg committed Aug 7, 2017
    Copy the full SHA
    7ac0c14 View commit details
    Browse the repository at this point in the history
  3. a precedence sensitive exp pretty printer

    Should do this long ago, but finally found some time. No more
    unnecessary parentheses!
    
    Note: operator precedences follow the C language, not OCaml.
    
       +-------------------------------------------+----+
       | x[y], <cast>:<N>[x], extract:<N>:<M>[x]   | 10 |
       +-------------------------------------------+----+
       | ~x, -x                                    |  9 |
       +-------------------------------------------+----+
       | *,/,/$, %, %$                             |  8 |
       +-------------------------------------------+----+
       | +,-                                       |  7 |
       +-------------------------------------------+----+
       | <<,>>,~>>                                 |  6 |
       +-------------------------------------------+----+
       | <,>,<=,>=                                 |  5 |
       +-------------------------------------------+----+
       | =, <>                                     |  4 |
       +-------------------------------------------+----+
       | &                                         |  3 |
       +-------------------------------------------+----+
       | ^                                         |  2 |
       +-------------------------------------------+----+
       | |                                         |  1 |
       +-------------------------------------------+----+
       | let.., x with y <- z, if.., . (dot)       |  0 |
       +-------------------------------------------+----+
    
    1) Higher precedence means that operators binds tighter.
    2) Any bil statement has precedence lower than an expression.
    ivg committed Aug 7, 2017
    Copy the full SHA
    92a0fbd View commit details
    Browse the repository at this point in the history
  4. fixes simplifier, adds cast simplification

    1. at some branches the simplified didn't recurce
    2. if a cast casts to the same type it is removed
    ivg committed Aug 7, 2017
    Copy the full SHA
    220bef3 View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    7aab046 View commit details
    Browse the repository at this point in the history
  6. fixes the Bitvector.unsigned function

    it was wrong.
    ivg committed Aug 7, 2017
    Copy the full SHA
    1a08c7d View commit details
    Browse the repository at this point in the history
  7. Copy the full SHA
    9b53efa View commit details
    Browse the repository at this point in the history
  8. Copy the full SHA
    31c9d8d View commit details
    Browse the repository at this point in the history
  9. adds ssa and dead-code-elimination plugins

    The ssa just translates a program into the SSA form
    The dead-code-elimination is a conservative deadcode elimination
    plugin, that helps alot with x86 binaries by removing tons of unused
    flags calcualations.
    ivg committed Aug 7, 2017
    Copy the full SHA
    56ec68e View commit details
    Browse the repository at this point in the history

Commits on Aug 8, 2017

  1. makes string_of_value more consistent

    The string_of_value function now emits the `0x` prefix for hexnumbers,
    unless instructed explicitly with the `prefix:false` flag.
    
    The reason for this change is to enable a consitent handling of signed
    and unsinged, negative and positive values.
    ivg committed Aug 8, 2017
    Copy the full SHA
    ca78a3d View commit details
    Browse the repository at this point in the history
  2. publishes Exp.substitute function

    long time ago we forgot to make it public.
    ivg committed Aug 8, 2017
    Copy the full SHA
    dfa249f View commit details
    Browse the repository at this point in the history
  3. enhances dead-code elimination plugin

    1. Now it will run until a fix point is reached
    2. A simple constant propagation is added, so that more virtuals are
    removed
    ivg committed Aug 8, 2017
    Copy the full SHA
    3c91a53 View commit details
    Browse the repository at this point in the history
  4. renames mem32 and mem64 in x86 lifter to mem

    there is no need to have two different names for memory.
    ivg committed Aug 8, 2017
    Copy the full SHA
    1a8788d View commit details
    Browse the repository at this point in the history
  5. fixes and enhances lifted representation of shifts

    1. The original implementation emited the following code
    
    ```
        flag := flag
    ```
       to denote an unchanged flag. The code was problematic for both static
       and dynamic analysis. Static analysis treated this as a used before
       defined variable and treated flag as a free variable in the eclosing
       definition. The dynamic analysis treated `flag` as an undefined
       variable with all the consequences.
    
       The new implementation uses the `if` statement and changes flag only
       if it is necessary. Moreover, instead of using multiple if/then/else
       expressions, all assignment are gathered under one big if statement,
       that leads to a more simple CFG representation.
    
    2. The original implementation emited a temporary variable that holds a
       number of bits to which the destination should be shifted. There is
       no need for such variable (it is never changed). Moreover, the
       value of this variable is usually (if not always) a constant, so it
       is better to inline it directly in expressions. It looks like that
       this is the case of a common error -  delegating OCaml computation to
       BIL. In our case this problem is solved by constant propagation.
    ivg committed Aug 8, 2017
    Copy the full SHA
    efc0bd6 View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2017

  1. applies simplification to assoc operations

    If in operator is associative and expression is left recursive, then
    recurse to the right in hope to meet constants there. In particular,
    this will simplify `x + 1 + 1 + 1` to `x + 3`.
    ivg committed Aug 9, 2017
    Copy the full SHA
    8c0df9e View commit details
    Browse the repository at this point in the history
  2. few optimizations and refactoring in old tainter

    1. do not store values with just empty sets of values
    2. special handling for the one byte storage
    3. remove a key from the taint set if it is set to empty
    ivg committed Aug 9, 2017
    Copy the full SHA
    6cd6abb View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    0c7ebd8 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    68bfc3b View commit details
    Browse the repository at this point in the history
  5. removes unused code

    ivg committed Aug 9, 2017
    Copy the full SHA
    73d3e8c View commit details
    Browse the repository at this point in the history
  6. calls exit if bap is interupted by Ctrl-C

    so that profiler will work, as well as other at exit handlers.
    ivg committed Aug 9, 2017
    Copy the full SHA
    6ae6dbe View commit details
    Browse the repository at this point in the history

Commits on Aug 10, 2017

  1. implements new Bitvector pretty printer

    and rolls back the [Word.string_of_value] behavior.
    
    The pretty printing function was totally rewritten from scratch, as
    Z.format and other Z printing functions are broken. Now we have a
    generic printer that suits all tastes, as well as 9 preinstantiated
    pretty printers.
    
    We also changed the bitvector default string representation. The new
    representation doesn't used [true] or [false] for the [1] and [0] (this
    is binary analysis anyway), and doesn't loose the signedness
    information.
    ivg committed Aug 10, 2017
    Copy the full SHA
    bc13d48 View commit details
    Browse the repository at this point in the history

Commits on Aug 11, 2017

  1. Copy the full SHA
    f0ddbd5 View commit details
    Browse the repository at this point in the history

Commits on Aug 16, 2017

  1. docs update and few renamings

    Updated bap.mli with a documentation for new functions.
    Also, renamed Image.Scheme.reference to Image.Scheme.relocation.
    ivg committed Aug 16, 2017
    Copy the full SHA
    ad61176 View commit details
    Browse the repository at this point in the history
  2. updated testsuite

    ivg committed Aug 16, 2017
    Copy the full SHA
    ff1f1cb View commit details
    Browse the repository at this point in the history
  3. fix dash/underscore issue

    ivg committed Aug 16, 2017
    Copy the full SHA
    38368bd View commit details
    Browse the repository at this point in the history
  4. automates documentation generation

    Now it is enough just to type `make doc` and everything will work out of
    box, if a correct version of OCaml is used, i.e., 4.03. The Makefile
    recipe will pull the latest version of argot (git is required) and use
    it to build the documentation. BAP should be installed either from the
    source tree, or from opam, doesn't matter.
    ivg committed Aug 16, 2017
    Copy the full SHA
    f02e92b View commit details
    Browse the repository at this point in the history

Commits on Aug 17, 2017

  1. updates Primus docs

    also removes some unnecessary stuff from it.
    ivg committed Aug 17, 2017
    Copy the full SHA
    f63ac4c View commit details
    Browse the repository at this point in the history

Commits on Aug 18, 2017

  1. adds monads interfaces

    ivg committed Aug 18, 2017
    Copy the full SHA
    63c7883 View commit details
    Browse the repository at this point in the history

Commits on Aug 21, 2017

  1. updates monads docs

    ivg committed Aug 21, 2017
    Copy the full SHA
    04b7d1d View commit details
    Browse the repository at this point in the history

Commits on Aug 22, 2017

  1. cleans and documents the monads library

    I've removed few unnecessary funciton, e.g., `State.modify` and also
    fixed the type of the call/cc function.
    ivg committed Aug 22, 2017
    Copy the full SHA
    ef26b3b View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    9779116 View commit details
    Browse the repository at this point in the history
  3. adds type checker to backends

    also fixes few bugs that were found as a result
    
    1) a zero width word was created (should be a one bit width)
    2) a bug in the typechecker that led to a stackoverflow
    
    So far no more type errors
    ivg committed Aug 22, 2017
    Copy the full SHA
    a93d7d7 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    6d71e01 View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    99ae4d0 View commit details
    Browse the repository at this point in the history
  6. adds missing manpages

    also added parameters to the primus loader.
    ivg committed Aug 22, 2017
    Copy the full SHA
    f37bee9 View commit details
    Browse the repository at this point in the history
  7. typo in the docs

    ivg committed Aug 22, 2017
    Copy the full SHA
    f296ce4 View commit details
    Browse the repository at this point in the history

Commits on Aug 23, 2017

  1. gone crazy and rewrote the taint propagation plugin

    because my last update to primus broke it(((
    ivg committed Aug 23, 2017
    Copy the full SHA
    a05087c View commit details
    Browse the repository at this point in the history
  2. makes oasy little bit less hungry

    ivg committed Aug 23, 2017
    Copy the full SHA
    a99e870 View commit details
    Browse the repository at this point in the history

Commits on Aug 24, 2017

  1. dispatches linker unresolved calls to a lisp stub

    The __primus_linker_unresolved_call function is called in case if a
    linker can resolved a call.
    
    Also adds the `pc` method to the interpreter interface and publish it
    as a primitive `get-current-program-counter`.
    ivg committed Aug 24, 2017
    Copy the full SHA
    70752f3 View commit details
    Browse the repository at this point in the history
  2. fixes a bug in random number generation

    not actually in the random number generator, but rather in a casting it
    to a word.
    ivg committed Aug 24, 2017
    Copy the full SHA
    66ee85c View commit details
    Browse the repository at this point in the history
  3. don't fail the whole program on a division by zero

    just fail the machine.
    ivg committed Aug 24, 2017
    Copy the full SHA
    66f3c6c View commit details
    Browse the repository at this point in the history
  4. enhances the run plugin with the multi-entry mode

    Now we can specify a list of entry points, or a magic `all-subroutines`
    to start execution in parallel from all specified entry points. If no
    specified, then all subroutine terms marked with the `entry_point`
    attribute are entered.
    ivg committed Aug 24, 2017
    Copy the full SHA
    6f4e4f2 View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    9aef93b View commit details
    Browse the repository at this point in the history
  6. adds a Primus component that ensures termination

    The primus-limit plugin will terminate a machine after a certain amount
    of computations has happened.
    ivg committed Aug 24, 2017
    Copy the full SHA
    87ad64f View commit details
    Browse the repository at this point in the history