Skip to content
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.

Try a simple demo without applying heuristics.

  1. Go to the simple-demo directory: cd simple-demo/.

  2. 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.
  3. Run Razor step by step:

    1. Merge the logs: python debloat_simple.py -c trace -a 1 -b y. The output is ./simple-trace.log.
    2. Dump the executed instructions: python debloat_simple.py -c dump_inst. The output is ./instr.s.
    3. Instrument the executed instructions: python debloat_simple.py -c instrument. The output is ./simple.s.
    4. Rewrite the binary: python debloat_simple.py -c rewrite. The output is ./simple_temp/simple.debloated.
  4. 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
Clone this wiki locally