MCPcopy Create free account
hub / github.com/GJDuck/e9patch / getCFTTarget

Function getCFTTarget

src/e9patch/e9x86_64.cpp:919–934  ·  view source on GitHub ↗

* Returns the control-flow-transfer target if known, else INTPTR_MIN. */

Source from the content-addressed store, hash-verified

917 * Returns the control-flow-transfer target if known, else INTPTR_MIN.
918 */
919intptr_t getCFTTarget(intptr_t addr, const uint8_t *bytes, unsigned size,
920 int flags)
921{
922 CFTInfo CFT;
923 if (!getCFTInfo(addr, bytes, size, &CFT))
924 return INTPTR_MIN;
925 if (CFT.target == INTPTR_MIN)
926 return INTPTR_MIN;
927 if ((flags & CFT_CALL) != 0 && CFT.call)
928 return CFT.target;
929 if ((flags & CFT_JMP) != 0 && CFT.jmp)
930 return CFT.target;
931 if ((flags & CFT_JCC) != 0 && CFT.jcc)
932 return CFT.target;
933 return INTPTR_MIN;
934}
935

Callers 3

optimizeJumpFunction · 0.85
getBuiltinLabelAddressFunction · 0.85
buildBytesFunction · 0.85

Calls 1

getCFTInfoFunction · 0.85

Tested by

no test coverage detected