Date: | Wed, 11 Mar 2020 00:32:59 +0000 |
---|---|
From: | Mahwish Arif <mahwish05@xxxxxxxxx> |
Subject: | [DynInst_API:] BPatch_dynamicTargetExpr not returning correct value for return instructions |
Hi, I am using Dyninst to implement a CFI shadow stack. I am trying to get the target address of the return instruction as below: //Inst_pair is the iterator I get over the vector returned by getInstructions().ÂInst_pair.first is InstructionAPI instruction object and Inst_pair.secondÂis the starting address of the instruction. if(Inst_pair.first.getCategory() == Dyninst::InstructionAPI::c_ReturnInsn){    appImage->findPoints(Inst_pair.second, points);    BPatch_dynamicTargetExpr retAddr;    instArgs.push_back(&retAddr);    BPatch_funcCallExpr actionCallExpr2(*func_1, instArgs);    BPatchSnippetHandle *handle2 = app->insertSnippet(actionCallExpr2, *points[0] ,BPatch_callBefore,BPatch_lastSnippet); } void func_1(void * trgAddr){  Âcout<<hex<<trgAddr<<endl; } However the values returned to func_1 are random values and not actual return addresses. How to useÂBPatch_dynamicTargetExpr properly with return instructions? |
[← Prev in Thread] | Current Thread | [Next in Thread→] |
---|---|---|
|
Previous by Date: | [DynInst_API:] [dyninst/dyninst] c5f430: Use register x30 (Link Register) to generate long ..., Sasha NÃcolas |
---|---|
Next by Date: | Re: [DynInst_API:] building dyninst with -fsanitize-address, Stan Cox |
Previous by Thread: | Re: [DynInst_API:] API-breaking changes for upcoming Dyninst 11.0 release, Tim Haines |
Next by Thread: | [DynInst_API:] building dyninst with -fsanitize-address, Stan Cox |
Indexes: | [Date] [Thread] |