Skip to content

iamabdularham/MemoryPeak

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

MemPeek - Memory Viewer Utility

A lightweight memory viewing utility written in x64 Assembly for macOS. MemPeek allows you to examine memory contents in both hexadecimal and ASCII formats.

Features

  • View memory contents starting from any address
  • Display 16 bytes at a time in both hexadecimal and ASCII formats
  • Safe memory access within a controlled buffer
  • User-friendly interface with interactive navigation
  • Properly aligned output for easy reading

Usage

Building the Program

nasm -f macho64 mempeek.asm && ld -o mempeek mempeek.o -macosx_version_min 10.7.0 -no_pie

Running MemPeek

./mempeek

Interface

  1. When started, the program prompts you to enter a memory address in hexadecimal format
  2. Press Enter without an address to use the default safe memory buffer
  3. The program displays memory contents in the following format:
[Address]   [Hex Bytes]                     [ASCII]
0x0000000000100000: 20 21 22 23 24 25 26 27  !"#$%&'

Navigation Commands

  • N - View Next 16 bytes
  • A - Enter a new Address
  • Q - Quit the program

Technical Details

  • Written in x64 Assembly for macOS
  • Uses macOS system calls for I/O operations
  • Implements safe memory access checks
  • 16-byte aligned stack maintenance
  • 4KB safe buffer for demonstration purposes

Memory Display Format

  • Address displayed in full 64-bit hexadecimal format
  • 16 bytes per line displayed in hex
  • ASCII representation of the same bytes (non-printable characters shown as '.')
  • Extra space after 8 bytes for better readability

Safety Features

  • Memory access is restricted to a safe pre-allocated buffer
  • Input validation for hex address entry
  • Proper error handling for invalid memory access
  • Stack alignment maintained for macOS compatibility

Requirements

  • macOS operating system
  • NASM (Netwide Assembler)
  • x64 processor architecture

Limitations

  • Can only safely access memory within the pre-allocated buffer
  • Memory access outside the safe buffer is prevented
  • Limited to 16 bytes per view

Author's Note

This program is designed as a educational tool for understanding memory layout and assembly programming. It demonstrates:

  • x64 Assembly programming techniques
  • System call usage in macOS
  • Safe memory handling
  • User input processing
  • Hex/ASCII data representation

About

MemPeek is a retro-style utility that reads and displays memory contents from a given address in both hexadecimal and ASCII. Built for 64-bit Linux systems using NASM, it brings back the raw feel of low-level memory inspection — perfect for developers who want to explore system internals or learn Assembly in a fun, hands-on way.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors