diff --git a/libtransform/include/Rewrite_Utility.hpp b/libtransform/include/Rewrite_Utility.hpp index 3ef2e47aee7a127b8d1f83ea63011cea33d7d8b7..94cfe0ec588489134d73419f38c2b852ac219903 100644 --- a/libtransform/include/Rewrite_Utility.hpp +++ b/libtransform/include/Rewrite_Utility.hpp @@ -65,13 +65,5 @@ Instruction_t* allocateNewInstruction(FileIR_t* virp, Instruction_t *template_in void setInstructionAssembly(FileIR_t* virp,Instruction_t *p_instr, string p_assembly, Instruction_t *p_fallThrough, Instruction_t *p_target); Instruction_t* getHandlerCode(FileIR_t* virp, Instruction_t* fallthrough, mitigation_policy policy ); -string getJumpDataBits(); -string getJnsDataBits(); -string getJzDataBits(); -string getJnzDataBits(); -string getJecxzDataBits(); -string getRetDataBits(); - -Relocation_t* createNewRelocation(FileIR_t* firp, Instruction_t* insn, string type, int offset); } diff --git a/libtransform/src/Rewrite_Utility.cpp b/libtransform/src/Rewrite_Utility.cpp index c1d0bdae04b5575f0c2c1817450b875629d70448..009f21fe4fe4e094e29b5f0c126d93c7c9833181 100644 --- a/libtransform/src/Rewrite_Utility.cpp +++ b/libtransform/src/Rewrite_Utility.cpp @@ -249,82 +249,4 @@ void setInstructionAssembly(FileIR_t* virp,Instruction_t *p_instr, string p_asse } -string getRetDataBits() -{ - string dataBits; - dataBits.resize(1); - dataBits[0] = 0xc3; - return dataBits; -} - - -string getJumpDataBits() -{ - string dataBits; - dataBits.resize(5); - dataBits[0] = 0xe9; - dataBits[1] = 0x00; // value doesn't matter -- we will fill it in later - dataBits[2] = 0x00; // value doesn't matter -- we will fill it in later - dataBits[3] = 0x00; // value doesn't matter -- we will fill it in later - dataBits[4] = 0x00; // value doesn't matter -- we will fill it in later - return dataBits; -} - -// jns - jump not signed -string getJnsDataBits() -{ - string dataBits; - dataBits.resize(2); - dataBits[0] = 0x79; - dataBits[1] = 0x00; // value doesn't matter -- we will fill it in later - return dataBits; -} - -// jz - jump zero -string getJzDataBits() -{ - string dataBits; - dataBits.resize(2); - dataBits[0] = 0x74; - dataBits[1] = 0x00; // value doesn't matter -- we will fill it in later - - return dataBits; -} - -// jnz - jump not zero -string getJnzDataBits() -{ - string dataBits; - dataBits.resize(2); - dataBits[0] = 0x75; - dataBits[1] = 0x00; // value doesn't matter -- we will fill it in later - - return dataBits; -} - -// jecxz - jump ecx zero -string getJecxzDataBits() -{ - string dataBits; - dataBits.resize(2); - dataBits[0] = 0xe3; - dataBits[1] = 0x00; // value doesn't matter -- we will fill it in later - - return dataBits; -} - - -Relocation_t* createNewRelocation(FileIR_t* firp, Instruction_t* insn, string type, int offset) -{ - Relocation_t* reloc=new Relocation_t; - insn->GetRelocations().insert(reloc); - firp->GetRelocations().insert(reloc); - - reloc->SetType(type); - reloc->SetOffset(offset); - - return reloc; -} - - }