Skip to content

🖥 Nm and otool implementation in C. Parse Mach-o files, supports fat binaries, archives and corrupted binaries. A medium article is available in description.

Notifications You must be signed in to change notification settings

jterrazz/42-nm-otool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hey there, app enthusiasts! 👋 Ready to dive into the world of game-changing apps? At jterrazz.com, I'm all about crafting useful applications and sharing the journey! Discover coding insights, self-improvement hacks, and sneak peeks of my latest projects (psst... my next app is all about leveling up in life! 🚀). Come along for the ride - you might just find the spark for your next big idea! 💡💻

42-nm-otool

Custom C implementation of nm and otool commands.

  • ft_nm <args> displays the name list (symbol table of nlist structures) of the <args> files
  • ft_tool displays the content of the (__TEXT,__text) segment

This project will makes you understand how Mach-O files are structured.

How to use

Build

make

# Clean commands
make clean
make fclean
make re

Usage

# Files supported: exec, .a, .so, .dylib, .o.
./ft_nm file
./ft_otool file

Implementation

  • Support for archives
  • Support for fat binaries
  • Support for debug symbols (gcc -g <args> files).
  • Many flags (see ./ft_nm -h or ./ft_otool -h)
  • Checks for corruption

To understand how I implemented this program, you can refer to the medium article of this project.

File structure

/inc
    # Self made printf
    # Self made libc
    nm_otool.h
/src
    /cmd # Parse argv and set the program state
    /hande # Handle structure for magic files
    /parse # Parse the inner structures
    /shared

    # Root files
    ft_nm.c
    ft_otool.c

Predefined values

About

🖥 Nm and otool implementation in C. Parse Mach-o files, supports fat binaries, archives and corrupted binaries. A medium article is available in description.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages