MCPcopy Create free account
hub / github.com/MJx0/KittyMemoryEx / findRemoteSymbol

Method findRemoteSymbol

KittyMemoryEx/KittyScanner.cpp:1317–1342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1315}
1316
1317uintptr_t ElfScannerMgr::findRemoteSymbol(const std::string &local_sym_name, uintptr_t local_sym_addr)
1318{
1319 if (!_pMem || local_sym_name.empty() || !local_sym_addr)
1320 return 0;
1321
1322 ElfScanner r_lib{};
1323 KittyMemoryEx::ProcMap l_lib{};
1324
1325 l_lib = KittyMemoryEx::getAddressMap(getpid(), local_sym_addr);
1326 if (l_lib.isValid())
1327 r_lib = findElf(l_lib.pathname);
1328
1329 if (!r_lib.isValid())
1330 {
1331 KITTY_LOGD("KittyInjector: Failed to find %s, remote lib not found.", local_sym_name.c_str());
1332 return 0;
1333 }
1334
1335 uintptr_t remote_address = r_lib.findSymbol(local_sym_name);
1336
1337 // fallback
1338 if (!remote_address)
1339 remote_address = local_sym_addr - l_lib.startAddress + r_lib.base();
1340
1341 return remote_address;
1342}
1343
1344#ifdef __ANDROID__
1345LinkerScannerMgr::LinkerScannerMgr(IKittyMemOp *pMem, uintptr_t linkerBase) : ElfScanner(pMem, linkerBase)

Callers 2

mainFunction · 0.80
mainFunction · 0.80

Calls 4

getAddressMapFunction · 0.85
findSymbolMethod · 0.80
baseMethod · 0.80
isValidMethod · 0.45

Tested by

no test coverage detected