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

Method dumpMemELF

KittyMemoryEx/KittyMemoryMgr.cpp:191–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189}
190
191bool KittyMemoryMgr::dumpMemELF(const ElfScanner &elf, const std::string &destination) const
192{
193 if (!isMemValid() || !elf.base() || !elf.loadSize())
194 return false;
195
196 bool dumped = dumpMemRange(elf.base(), elf.end(), destination);
197 if (dumped && elf.isFixedBySoInfo())
198 {
199 KittyIOFile destIO(destination, O_WRONLY);
200 destIO.open();
201 KT_ElfW(Ehdr) fixedHdr = elf.header();
202 destIO.pwrite(0, &fixedHdr, sizeof(fixedHdr));
203 destIO.close();
204 }
205
206 return dumped;
207}

Callers 2

mainFunction · 0.80
mainFunction · 0.80

Calls 8

baseMethod · 0.80
loadSizeMethod · 0.80
endMethod · 0.80
isFixedBySoInfoMethod · 0.80
openMethod · 0.80
headerMethod · 0.80
pwriteMethod · 0.80
closeMethod · 0.80

Tested by

no test coverage detected