Skip to content

Commit

Permalink
Add dyninstAPI/StackModExpr.h
Browse files Browse the repository at this point in the history
  • Loading branch information
hainest committed Apr 3, 2024
1 parent fbaabe6 commit 9997650
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 16 deletions.
50 changes: 50 additions & 0 deletions docs/dyninstAPI/developer/StackMod/StackModExpr.h.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,53 @@
StackModExpr.h
##############

.. cpp:class:: BPatch_stackInsertExpr : public BPatch_snippet

.. cpp:function:: BPatch_stackInsertExpr(int size)

Creates a stack shift (insertion) of size


.. cpp:class:: BPatch_stackRemoveExpr : public BPatch_snippet

.. cpp:function:: BPatch_stackRemoveExpr(int size)

Creates a stack shift (removal) of size


.. cpp:class:: BPatch_stackMoveExpr : public BPatch_snippet

.. cpp:function:: BPatch_stackMoveExpr()

Generates no new code, but triggers relocation and sensitivty analysis


.. cpp:class:: BPatch_canaryExpr : public BPatch_snippet

.. cpp:function:: BPatch_canaryExpr()

Creates the placement of a per-thread canary value on the stack


.. cpp:class:: BPatch_canaryCheckExpr : public BPatch_snippet

.. cpp:function:: BPatch_canaryCheckExpr(BPatch_function* failureFunc, bool canaryAfterPrologue, long canaryHeight)

Checks the integrity of a per-thread canary value on the stack

``failureFunc`` is the function called if the canary check at function exit fails.
``canaryAfterPrologue`` indicates if the canary is inserted at entry (false) or after the
function prologue (true).
``canaryHeight`` is the height of the canary relative to the stack height at which
the canary is being referenced; in the common case, this is 0.
If the canary is inserted after the prologue, there may not be
an instruction whose stack height is the intended canary location,
in this case, canaryHeight must be set to the difference.


.. cpp:class:: BPatch_stackRandomizeExpr : public BPatch_snippet

.. cpp:function:: BPatch_stackRandomizeExpr()

Generates no new code, but triggers relocation and sensitivty analysis

16 changes: 0 additions & 16 deletions dyninstAPI/src/StackMod/StackModExpr.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,42 +37,26 @@ class BPatch_function;

class BPatch_stackInsertExpr : public BPatch_snippet {
public:
// Creates a stack shift (insertion) of size
BPatch_stackInsertExpr(int size);
};

class BPatch_stackRemoveExpr : public BPatch_snippet {
public:
// Creates a stack shift (removal) of size
BPatch_stackRemoveExpr(int size);
};

class BPatch_stackMoveExpr : public BPatch_snippet {
public:
// Generates no new code, but triggers relocation and sensitivty analysis
BPatch_stackMoveExpr();
};

class BPatch_canaryExpr : public BPatch_snippet {
public:
// Creates the placement of a per-thread canary value on the stack
BPatch_canaryExpr();
};

class BPatch_canaryCheckExpr : public BPatch_snippet {
public:
// Checks the integrity of a per-thread canary value on the stack
// failureFunc
// The function called if the canary check at function exit fails
// canaryAfterPrologue
// Indicates if the canary is inserted at entry (false)
// or after the function prologue (true)
// canaryHeight
// The height of the canary relative to the stack height at which
// the canary is being referenced; in the common case, this is 0.
// If the canary is inserted after the prologue, there may not be
// an instruction whose stack height is the intended canary location,
// in this case, canaryHeight must be set to the difference
BPatch_canaryCheckExpr(BPatch_function* failureFunc, bool canaryAfterPrologue, long canaryHeight);
};

Expand Down

0 comments on commit 9997650

Please sign in to comment.