Input: G:- the vulnerable program
Output: S:- data-oriented gadget set
1 S = ;;
2 FuncSet = getFuncSet(G)
3 foreach f 2 FuncSet do
4 cfg = getCFG(f)
5 for instr = getNextInstr(cfg) do
6 if isMemStore(instr) then
7 gadget = getBackwardSlice(instr, f)
8 input = getInput(gadget)
9 if isMemLoad(input) then
10 S = S [ fgadgetg
Input: G:- the vulnerable program
Output: D:- gadget dispatcher set
1 D = ;;
2 FuncSet = getFuncSet(G)
3 foreach f 2 FuncSet do
4 foreach loop = getLoop(f) do
5 loop.gadgets = ;
6 foreach instr = getNextInstr(loop) do
7 if isMemStore(instr) then
8 loop.gadgets [= getGadget(instr)
9 else if isCall(instr) then
10 target = getTarget(instr)
11 loop.gadgets [= getGadget(target)
12 if loop.gadgets != ; then
13 D = D [ floopg
L. Szekeres, M. Payer, T. Wei, and D. Song, “SoK: Eternal War in Memory,” in Proceedings of the 34th IEEE Symposium on Security and Privacy, 2013.
C. Song, B. Lee, K. Lu, W. R. Harris, T. Kim, and W. Lee, “Enforcing Kernel Security Invariants with Data Flow Integrity,” in Proceedings of the 23th Annual Network and Distributed System Security Symposium, 2016.