Misc update (#592)

* Update .remill_commit_id

* Add referecnes to Dyninst frontend README in top-level README

* Expand dyninst frontend local README

* Add whitespace to separate lines

* Update README.md
This commit is contained in:
Aiethel
2019-10-09 21:32:12 +02:00
committed by Peter Goodman
parent bb1cac3e52
commit d134f3ad44
3 changed files with 33 additions and 11 deletions
+1 -1
View File
@@ -1 +1 @@
8146c3df3c662f9c6b7530dc9048b03495cee3fe
b1ea8c291105944fa5559bea9fa9958f8abe6a42
+5 -5
View File
@@ -102,7 +102,7 @@ RUN /root/binaryninja/scripts/linux-setup.sh
#### Step 3: Build & Run Dockerfile
This will build the container for you and run it with your local directory mounted into the container (at /home/user/local) such that your work in the container is saved locally:
This will build the container for you and run it with your local directory mounted into the container (at /home/user/local) such that your work in the container is saved locally:
`docker build -t=mcsema . && docker run --rm -it --ipc=host -v "${PWD}":/home/user/local mcsema`
### On Linux
@@ -143,7 +143,7 @@ mkdir mcsema-ve
virtualenv mcsema-ve
cd mcsema-ve
source bin/activate
```
```
##### Fixing IDA Pro's Python installation (Ubuntu 14.04)
Note: If you are using IDA on 64 bit Ubuntu and your IDA install does not use the system Python, you can add the `protobuf` library manually to IDA's zip of modules.
@@ -264,7 +264,7 @@ powershell -nologo -executionpolicy bypass -File llvm_toolchain_vs2017.ps1
Next, its time to fetch library dependencies. You can either build them yourself using our [cxx-common](https://github.com/trailofbits/cxx-common) dependency manager or download a pre-built package.
There are two versions of LLVM used by remill and mcsema. One version (currently 7.0.1) builds remill and mcsema. Another version (currently 5.0.1) is used to build the translation semantics.
There are two versions of LLVM used by remill and mcsema. One version (currently 7.0.1) builds remill and mcsema. Another version (currently 5.0.1) is used to build the translation semantics.
On Windows, only the LLVM 5.0.1 package is supported for building semantics. If you build it yourself, use the Visual Studio 2017 Win64 generator with the LLVM 5.0.1 toolchain. The cxx-common script will automatically take care of this requirement.
@@ -304,7 +304,7 @@ Also update your PYTHONPATH: C:\mcsema\Lib\site-packages
### Dyninst frontend
Dyninst frontend can be build with ```./build.sh --dyninst-frontend```. More information can be found in ```tools/mcsema_disass/dyninst/README.md```.
[Dyninst frontend](tools/mcsema_disass/dyninst/README.md) can be build with ```./build.sh --dyninst-frontend```. More information can be found in ```tools/mcsema_disass/dyninst/README.md```.
## Additional Documentation
@@ -329,7 +329,7 @@ This is a hotly contested issue. We must explore the etymology of the name to fi
### Why do I need IDA Pro to use McSema
You don't! You can also use Binary Ninja or Dyninst to fill the role of IDA Pro; however, in our experiments, IDA Pro tends to be most reliable and both the product itself, and our scripts using it, have more person-years of development behind them.
You don't! You can also use Binary Ninja or [Dyninst](tools/mcsema_disass/dyninst/README.md) to fill the role of IDA Pro; however, in our experiments, IDA Pro tends to be most reliable and both the product itself, and our scripts using it, have more person-years of development behind them.
### What is Remill, and why does McSema need it
+27 -5
View File
@@ -1,9 +1,9 @@
# mcsema-dyninst-disass
mcsema-dyninst-disass is an experimental frontend for McSema based on the [Dyninst API](http://www.dyninst.org/dyninst). We hereby aim to provide a free frontend for McSema, whose main development branch currently requires the proprietary [IDA Pro](https://www.hex-rays.com/products/ida) software. We hope to make McSema more accessible this way to users that do not have access to an IDA Pro license.
mcsema-dyninst-disass is an experimental frontend for McSema based on the [Dyninst API](https://github.com/dyninst/dyninst). We hereby aim to provide a free frontend for McSema, whose main development branch currently requires the proprietary [IDA Pro](https://www.hex-rays.com/products/ida) software. We hope to make McSema more accessible this way to users that do not have access to an IDA Pro license.
The Dyninst frontend had been developed as part of a laboratory course at the [University of Erlangen-Nuremberg](https://www4.cs.fau.de/).
Later this code was picked up and reworked to what you currently see. As of now it can lift most of the McSema test suite (possibly all not tested yet) including some more complicated binaries like stripped gzip. Position independent binaries work for small tests, status of bigger binaries is unknown, although there is no known reason for them not to work correctly.
Later this code was picked up and reworked to what you currently see. You can read more about it (and a lot of other McSema related topics) in [diploma thesis](https://is.muni.cz/th/pxe1j/thesis.pdf) that was written about the frontend!
## Dependencies
@@ -11,6 +11,25 @@ You won't need IDA Pro to run mcsema-dyninst-disass, but Git, CMake, Google Prot
## Building mcsema-dyninst-disass
The build process can be split into two separate phases: Dyninst API itself and McSema with this frontend. Frontend itself is not depended on McSema (it is not linked with McSema or Remill) but they do share some dependencies.
### Building Dyninst
Firstly you will need to build [Dyninst API](https://github.com/dyninst/dyninst). You will need version `9.3.2` which should be present in Dyninst `master` branch under tag `v9.3.2`. You can easily switch to the tag by:
```
git checkout v9.3.2
```
After checking out the correct version of the DynInst source code, we recommend following DynInst's build instructions, which can be found in its repository.
If you are using a newer distributions (e.g. archlinux), then you may encounter some errors during the build process. They should correspond to issues that are resolved in newer versions:
* https://github.com/dyninst/dyninst/issues/486
* https://github.com/dyninst/dyninst/issues/526
### Building mcsema frontend
Assuming that you've installed Dyninst to ```/usr/local/```, you need to export the following environment variables:
```shell
@@ -19,15 +38,18 @@ export CMAKE_PREFIX_PATH=/usr/local/lib/cmake/Dyninst
The ```CMAKE_PREFIX_PATH``` environment variable tells CMake where to find the necessary Dyninst files.
Now, you should be able to build this frontend along with McSema using the ```build.sh --dyninst-frontend``` (sets ```BUILD_MCSEMA_DYNINST_DISASS``` variable in cmake) script from the remill repository. Please see the top-level McSema README.md file for details.
Now, you should be able to build this frontend along with McSema using the ```build.sh --dyninst-frontend``` (sets ```BUILD_MCSEMA_DYNINST_DISASS``` variable in cmake) script from the remill repository. Please see the top-level McSema README.md file for details on how to use the build script.
Compiler with C++14 support is required.
## Using mcsema-dyninst-disass
mcsema-dyninst-disass replaces the IDA Pro frontend in the sense that both take a binary file as input and produce a Google Protocol Buffer file as output. The output can then be fed into mcsema-lift for further processing. Command line arguments are the same as for other frontends.
`mcsema-dyninst-disass` replaces the IDA Pro frontend in the sense that both take a binary file as input and produce a Google Protocol Buffer file as output. The output can then be fed into mcsema-lift for further processing. Command line arguments are the same as for other frontends.
In case you encounter any errors or problems during build or lift process you simply cannot get your head around, feel free to visit `#binary-lifting` channel of the [Empire Hacking Slack](https://empireslacking.herokuapp.com/). Also feel free to drop-by in case you want to discuss why the frontend cannot lift your binary, maybe it can be fixed quite easily!
## Known limitations
Pull request fixing bugs or implementing missing features are welcomed!
Please keep in mind the following list of limitations; we welcome pull requests for fixing bugs or implementing missing features!
* Tested *only* 64-bit ELF files, but there should not be fundamental problem with 32-bit. Support of other binary formats is possible as long as Dyninst is able to parse them. In such case a few classes would need different implementation based on chosen format specific information (jump table heuristics, recognition of xrefs in sections).
* Has *only* been tested on Linux
* Shared library are not lifted correctly