kp7742 / MemDumper

Dump Memory of Process in Android

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Auto dump mode always starts from zero

WcLyic opened this issue · comments

Auto mode has its own variables (start_addr, end_addr), but these variables are just used in calculating seg_size.

MemDumper/jni/kmods.cpp

Lines 273 to 285 in 8368b58

//Segment Start Address
kaddr start_addr = get_module_base(name.c_str());
if (start_addr == 0) {
cout << "Can't find Segment: " << name.c_str() << endl;
return -1;
}
//Segment End Address
kaddr end_addr = get_module_end(name.c_str());
if (end_addr == 0) {
cout << "Can't find End of Segment: " << name.c_str() << endl;
return -1;
}

Then dumping always starts from startAddr which is always zero in auto mode.

MemDumper/jni/kmods.cpp

Lines 296 to 308 in 8368b58

if (isFastDump) {
uint8_t *buffer = new uint8_t[seg_size];
memset(buffer, '\0', seg_size);
vm_readv((void *) startAddr, buffer, seg_size);
sdump.write((char *) buffer, seg_size);
} else {
char *buffer = new char[1];
while (seg_size != 0) {
vm_readv((void *) (startAddr++), buffer, 1);
sdump.write(buffer, 1);
--seg_size;
}
}