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

Method isValidELF

KittyMemoryEx/KittyScanner.cpp:1010–1017  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1008 const uint32_t nbucket = header[0], nchain = header[1];
1009
1010 const uintptr_t bucketsAddr = hashAddr + sizeof(header);
1011 const uintptr_t chainAddr = bucketsAddr + uintptr_t(nbucket) * sizeof(uint32_t);
1012
1013 const uint32_t nameHash = elfHashName(symbolName);
1014 uint32_t symIdx = 0;
1015 if (!_pMem->Read(bucketsAddr + (nameHash % nbucket) * sizeof(uint32_t), &symIdx, sizeof(symIdx)))
1016 return false;
1017
1018 for (uint32_t steps = 0; symIdx != 0 && symIdx < nchain && steps < 1'000'000; ++steps)
1019 {
1020 KT_ElfW(Sym) sym{};

Callers

nothing calls this directly

Calls 1

ReadMethod · 0.80

Tested by

no test coverage detected