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

Method dumpMemFile

KittyMemoryEx/KittyMemoryMgr.cpp:165–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165bool KittyMemoryMgr::dumpMemFile(const std::string &memFile, const std::string &destination) const
166{
167 if (!isMemValid() || memFile.empty() || destination.empty())
168 return false;
169
170 auto fileMaps = KittyMemoryEx::getMaps(_pid, EProcMapFilter::EndWith, memFile);
171 if (fileMaps.empty())
172 return false;
173
174 auto firstMap = fileMaps.front();
175 uintptr_t lastEnd = firstMap.endAddress;
176
177 for (size_t i = 1; i < fileMaps.size(); ++i)
178 {
179 const auto &it = fileMaps[i];
180 if (firstMap.inode != 0 && it.inode == firstMap.inode && it.startAddress == lastEnd)
181 {
182 lastEnd = it.endAddress;
183 continue;
184 }
185 break;
186 }
187
188 return dumpMemRange(firstMap.startAddress, lastEnd, destination);
189}
190
191bool KittyMemoryMgr::dumpMemELF(const ElfScanner &elf, const std::string &destination) const
192{

Callers 2

mainFunction · 0.80
mainFunction · 0.80

Calls 1

getMapsFunction · 0.85

Tested by

no test coverage detected