Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Process Memory Inspector

A Linux process inspection tool that reads the /proc filesystem to display a process's memory layout and basic status information. Written in C++.

What it shows

Given a PID, the tool prints:

  • Process information (from /proc/<pid>/status) — name, PID, state, thread count
  • Memory layout (from /proc/<pid>/maps) — every mapped region with:
    • Start and end addresses
    • Size in KB
    • Permissions
    • Section classification

Memory section classification

Section Detected when
HEAP Region is [heap]
STACK Region is [stack]
VDSO Region is [vdso]
VVAR Region is [vvar]
TEXT Executable permissions (x)
DATA Writable but not executable (w)
OTHER Everything else

Requirements

  • Linux (/proc is required)
  • g++ (C++17) and make

Build

make

Produces the main binary.

Usage

./main

You will be prompted for a PID:

--------------- Kundan Process Inspector --------------
Enter PID of a process that you want to inspect 

Clean build artifacts

make clean

Example session

Enter PID of a process that you want to inspect
1234
--------------------------------------------------------
------------------ Process Information -----------------
--------------------------------------------------------
Name:	sshd
Pid:	1234
State:	S (sleeping)
Threads:	1
--------------------------------------------------------
--------------------------------------------------------
-------------------- Memory Layout ---------------------
--------------------------------------------------------
----- Header -----
559a1... 559a2... 133 /usr/bin/sshd TEXT
...
--------------------------------------------------------

Note

Reading a process you do not own requires root (or the process must be yours). Non-readable processes will produce an "Unable to open file" message.

About

Linux process inspection tool in C++ that reads the /proc filesystem to show a process's memory layout and status. Parses /proc/<pid>/maps and /proc/<pid>/status, classifies mapped regions as HEAP, STACK, TEXT, DATA, VDSO, VVAR, or OTHER, and reports the process name, PID, state, and thread count using modern C++ streams and string parsing.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages