A lightweight memory viewing utility written in x64 Assembly for macOS. MemPeek allows you to examine memory contents in both hexadecimal and ASCII formats.
- 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
nasm -f macho64 mempeek.asm && ld -o mempeek mempeek.o -macosx_version_min 10.7.0 -no_pie./mempeek- When started, the program prompts you to enter a memory address in hexadecimal format
- Press Enter without an address to use the default safe memory buffer
- The program displays memory contents in the following format:
[Address] [Hex Bytes] [ASCII]
0x0000000000100000: 20 21 22 23 24 25 26 27 !"#$%&'
N- View Next 16 bytesA- Enter a new AddressQ- Quit the program
- 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
- 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
- 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
- macOS operating system
- NASM (Netwide Assembler)
- x64 processor architecture
- Can only safely access memory within the pre-allocated buffer
- Memory access outside the safe buffer is prevented
- Limited to 16 bytes per view
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