-
-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial work to support revng decompiler for r2, for now just a docke…
…r image
- Loading branch information
Showing
5 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM ubuntu:22.04 | ||
|
||
# Avoid prompts from apt | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Update and install basic utilities (optional) | ||
RUN apt-get update && apt-get install -y \ | ||
curl \ | ||
git \ | ||
xz-utils \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Your command here | ||
RUN curl -L -s https://rev.ng/downloads/revng-distributable/master/install.sh | bash | ||
|
||
COPY revng.sh / | ||
|
||
ENTRYPOINT /revng.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
all: | ||
docker build --platform linux/amd64 -t revng:0.1 . | ||
|
||
demo: all | ||
gcc -o demo demo.c | ||
docker run --rm --platform linux/amd64 -i revng:0.1 /revng.sh < demo | ||
|
||
shell: | ||
docker run --platform linux/amd64 -it revng:0.1 /usr/bin/bash | ||
|
||
.PHONY: demo run all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# r2revng | ||
|
||
This directory contains the scripts to run revng from Docker | ||
|
||
## Usage | ||
|
||
```bash | ||
docker run --rm --platform linux/amd64 -i revng:0.1 /revng.sh < compiled.bin > decompiled.c | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include <stdio.h> | ||
|
||
int main() { | ||
printf ("Hello World\n"); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
export BASH=/usr/bin/bash | ||
cat > a.out | ||
. /revng/environment | ||
revng artifact --analyze --progress decompile-to-single-file $@ a.out | revng ptml --color |