File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -74,9 +74,10 @@ CFunctionHook::SAssembly CFunctionHook::fixInstructionProbeRIPCalls(const SInstr
74
74
std::string code = probe.assembly .substr (lastAsmNewline, probe.assembly .find (" \n " , lastAsmNewline) - lastAsmNewline);
75
75
if (code.contains (" %rip" )) {
76
76
CVarList tokens{code, 0 , ' s' };
77
- size_t plusPresent = tokens[1 ][0 ] == ' +' ? 1 : 0 ;
78
- std::string addr = tokens[1 ].substr (plusPresent, tokens[1 ].find (" (%rip)" ) - plusPresent);
79
- const uint64_t OFFSET = configStringToInt (addr);
77
+ size_t plusPresent = tokens[1 ][0 ] == ' +' ? 1 : 0 ;
78
+ size_t minusPresent = tokens[1 ][0 ] == ' -' ? 1 : 0 ;
79
+ std::string addr = tokens[1 ].substr ((plusPresent || minusPresent), tokens[1 ].find (" (%rip)" ) - (plusPresent || minusPresent));
80
+ const uint64_t OFFSET = (minusPresent ? -1 : 1 ) * configStringToInt (addr);
80
81
if (OFFSET == 0 )
81
82
return {};
82
83
const uint64_t DESTINATION = currentAddress + OFFSET + len;
You can’t perform that action at this time.
0 commit comments