Flag: Tornado! Hurricane!

Blogs >> omeg's Blog

Created: Tuesday, November 16 2010 06:36.28 CST Modified: Tuesday, November 16 2010 06:37.10 CST
Printer Friendly ...
(Yet another) Memory dumper
Author: omeg # Views: 10865

I wrote a simple process memory dumper recently. Actually, it started as a in-memory string replacer, but I'm only posting the dumper part for now - the rest is in a terrible mess. ;)

The dumper saves all process memory to a single file. It uses NTFS sparse files though, so any non committed memory range does not use physical disk space (sparse zeros). It also checks process handle for access entries limiting VM operations and can print a nice memory map. Nothing fancy, but just what I needed for some work.

It's officially 32-bit only (DWORDs for addresses etc), but seems to somewhat work with 64-bit processes. I'll do a proper 64-bit version later (maybe ;).

Sample output:
c:\code\MemoryDump\Release>MemoryDump.exe explorer.exe v
Searching for target process...
Failed to open process 0x0: 0x57
Failed to open process 0x4: 0x5
[...]
Checking target process' ACL for problematic entries...
Opened \Device\HarddiskVolume3\Windows\explorer.exe as PID 0xb30
Target process suspended, 31 threads
Proceeding with memory dump

Address   Size     Type    State   Protect
   10000:    10000 MAPPED  COMMIT  READ&WRITE
   20000:     2000 MAPPED  COMMIT  READONLY
   22000:     e000 0       FREE    NOACCESS
   30000:     4000 MAPPED  COMMIT  READONLY
   34000:     c000 0       FREE    NOACCESS
   40000:     2000 MAPPED  COMMIT  READONLY
   42000:     e000 0       FREE    NOACCESS
   50000:     1000 PRIVATE COMMIT  READ&WRITE
   51000:     f000 0       FREE    NOACCESS
   60000:    10000 PRIVATE COMMIT  READ&WRITE
   70000:     7000 MAPPED  COMMIT  READONLY
   77000:     9000 0       FREE    NOACCESS
[...]
77610000:     3000 IMAGE   COMMIT  READONLY
77613000:  79cd000 0       FREE    NOACCESS
7efe0000:     5000 MAPPED  COMMIT  READONLY
7efe5000:    fb000 MAPPED  RESERVE 0
7f0e0000:   f00000 PRIVATE RESERVE 0
7ffe0000:     1000 PRIVATE COMMIT  READONLY
7ffe1000:     f000 PRIVATE RESERVE 0

Process resumed. Memory dumped to 2864.mem


Source & binary: http://omeg.pl/code/MemoryDump.zip


Blog Comments
j00ru Posted: Tuesday, November 16 2010 14:45.04 CST
Thanks for sharing, might come in handy some time ;>



Add New Comment
Comment:









There are 31,314 total registered users.


Recently Created Topics
[help] Unpacking VMP...
Mar/12
Reverse Engineering ...
Jul/06
hi!
Jul/01
let 'IDAPython' impo...
Sep/24
set 'IDAPython' as t...
Sep/24
GuessType return une...
Sep/20
About retrieving the...
Sep/07
How to find specific...
Aug/15
How to get data depe...
Jul/07
Identify RVA data in...
May/06


Recent Forum Posts
Finding the procedur...
rolEYder
Question about debbu...
rolEYder
Identify RVA data in...
sohlow
let 'IDAPython' impo...
sohlow
How to find specific...
hackgreti
Problem with ollydbg
sh3dow
How can I write olly...
sh3dow
New LoadMAP plugin v...
mefisto...
Intel pin in loaded ...
djnemo
OOP_RE tool available?
Bl4ckm4n


Recent Blog Entries
halsten
Mar/14
Breaking IonCUBE VM

oleavr
Oct/24
Anatomy of a code tracer

hasherezade
Sep/24
IAT Patcher - new tool for ...

oleavr
Aug/27
CryptoShark: code tracer ba...

oleavr
Jun/25
Build a debugger in 5 minutes

More ...


Recent Blog Comments
nieo on:
Mar/22
IAT Patcher - new tool for ...

djnemo on:
Nov/17
Kernel debugger vs user mod...

acel on:
Nov/14
Kernel debugger vs user mod...

pedram on:
Dec/21
frida.github.io: scriptable...

capadleman on:
Jun/19
Using NtCreateThreadEx for ...

More ...


Imagery
SoySauce Blueprint
Jun 6, 2008

[+] expand

View Gallery (11) / Submit