From d30dffda619bb42a6fc4f55cdfc5869d8d556c1d Mon Sep 17 00:00:00 2001 From: root <dc3pe@virginia.edu> Date: Fri, 7 Aug 2020 23:54:50 -0700 Subject: [PATCH] Added a few comments --- include/inc-transform/rewrite_util.hpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/include/inc-transform/rewrite_util.hpp b/include/inc-transform/rewrite_util.hpp index 39ecac1..3ea2dac 100644 --- a/include/inc-transform/rewrite_util.hpp +++ b/include/inc-transform/rewrite_util.hpp @@ -24,7 +24,28 @@ namespace IRDB_SDK extern Instruction_t* insertAssemblyBefore (FileIR_t* firp, Instruction_t* before, string assembly, Instruction_t *target=nullptr); extern Instruction_t* insertAssemblyAfter (FileIR_t* firp, Instruction_t* after , string assembly, Instruction_t *target=nullptr); +/* + * The insertAssemblyInstructionsBefore function takes in a group of (semicolon-seperated) assembly statements and inserts them into the + * program before the "before" instruction. + * Param: firp -- The current FileIR_t object + * before -- The instruction that the new instructions will be inserted before + * instructions -- The assembly to be inserted. Typical assembly formatting applies: instructions + * start on new lines, defined labels are allowed. For x86, the format must be in NASM style assembly. + * Returns: A vector of the newly inserted instructions. + * Side Effect: The new instructions are inserted into the IRDB data structures. + */ + extern std::vector<Instruction_t*> insertAssemblyInstructionsBefore (FileIR_t* firp, Instruction_t* before, string instructions, Instruction_t *target=nullptr); +/* + * The insertAssemblyInstructionsAfter function takes in a group of (semicolon-seperated) assembly statements and inserts them into the + * program after the "after" instruction. + * Param: firp -- The current FileIR_t object + * after -- The instruction that the new instructions will be inserted after + * instructions -- The assembly to be inserted. Typical assembly formatting applies: instructions + * start on new lines, defined labels are allowed. For x86, the format must be in NASM style assembly. + * Returns: A vector of the newly inserted instructions. + * Side Effect: The new instructions are inserted into the IRDB data structures. + */ extern std::vector<Instruction_t*> insertAssemblyInstructionsAfter (FileIR_t* firp, Instruction_t* after , string instructions, Instruction_t *target=nullptr); extern Instruction_t* insertDataBitsBefore (FileIR_t* firp, Instruction_t* before, string dataBits, Instruction_t *target=nullptr); extern Instruction_t* insertDataBitsAfter (FileIR_t* firp, Instruction_t* after , string dataBits, Instruction_t *target=nullptr); -- GitLab