-
Notifications
You must be signed in to change notification settings - Fork 8
Home
cxreet edited this page Jul 16, 2020
·
7 revisions
We have built a docker container for running Razor. Please install Install Docker first.
To pull the Razor container, run sudo docker pull chenxiong/razor:0.01
.
To run the container, run sudo docker run --rm -it chenxiong/razor:0.01
.
-
Go to the simple-demo directory:
cd simple-demo/
. -
Trace the program with two inputs:
python debloat_simple.py -c trace -a 1 -b y
-
python debloat_simple.py -c trace -a 0 -b y
This would generate two trace logs under directory ./logs.
-
Run Razor step by step:
- Merge the logs:
python debloat_simple.py -c trace -a 1 -b y
. The output is ./simple-trace.log. - Dump the executed instructions:
python debloat_simple.py -c dump_inst
. The output is ./instr.s. - Instrument the executed instructions:
python debloat_simple.py -c instrument
. The output is ./simple.s. - Rewrite the binary:
python debloat_simple.py -c rewrite
. The output is ./simple_temp/simple.debloated.
- Merge the logs:
-
Run the debloated binary:
- ./simple_temp/simple.debloated 1 y
- ./simple_temp/simple.debloated 0 y
- ./simple_temp/simple.debloated 1 n
- ./simple_temp/simple.debloated 0 n