Skip to content

A Simple Demo Without Heuristics

cxreet edited this page Jul 16, 2020 · 1 revision
  1. Go to the ./simple-demo directory: cd ~/workspace/razor/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 merge_log. 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