How in IDA can save memory dump with command or script?

Dino Balloons picture Dino Balloons · Mar 12, 2017 · Viewed 10.3k times · Source
  1. IDA, Hex-View here picture
  2. I select with mouse zone of bytes from StartAddress to EndAddress
  3. Right Click -> Save to File
  4. Got memory dump.

How do the same with command?Like: SaveDump(StartAddress , EndAddress) SaveDump(0x00001000 , 0x00002000)

Answer

poit picture poit · Feb 14, 2018

yes that works, but it's very slow writing a single byte at a time. try this for instant dumping:

auto fname      = "C:\\dump_mem.bin";
auto address    = 0x0400000;
auto size       = 0x0300000;
auto file= fopen(fname, "wb");

savefile(file, 0, address, size);
fclose(file);