🖥️nm

➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the nm command with important options and switches using examples.

▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁

#                ███╗   ██╗███╗   ███╗
#                ████╗  ██║████╗ ████║
#                ██╔██╗ ██║██╔████╔██║
#                ██║╚██╗██║██║╚██╔╝██║
#                ██║ ╚████║██║ ╚═╝ ██║
#                ╚═╝  ╚═══╝╚═╝     ╚═╝
                                     
                                     
                                    
# List symbol names in object files
# The nm command is used to display symbols from object files.

# Demangle C++ symbols (make them readable):
nm --demangle file.o

# Display object files that refer to a symbol
nm  -A ./*.o | grep func

# Display all undefined symbols in a file
nm -u executable

# List all symbols, even debugging symbols:
nm -a executable

# Display all symbols in executable
# (sorted in order of their addresses)
nm -n executable

# Search for a symbols and display its size
nm  -S 1 | grep abc

# Display dynamic symbols in executable
nm -D executable

# Change the format of the nm output
# (display the output of nm command in posix style)
nm -u -f posix executable

# Display only the external symbols of executable
nm -g executable

# Sort the nm output by the symbol size
nm -g --size-sort executable

# Specify nm options in a file
nm @nm_file

nm test
0804a020 B __bss_start
0804841d T compare
0804a020 b completed.6591
0804a018 D __data_start
0804a018 W data_start
08048360 t deregister_tm_clones
080483d0 t __do_global_dtors_aux
08049f0c t __do_global_dtors_aux_fini_array_entry
0804a01c D __dso_handle
08049f14 d _DYNAMIC
0804a020 D _edata
0804a024 B _end
080484e4 T _fini
080484f8 R _fp_hw
080483f0 t frame_dummy
...
...
...

#==============================##==============================#
# CMD NM						       #
#==============================##==============================#
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

  █║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌

              ██╗ ██╗ ██████╗  ██████╗ ██╗  ██╗███████╗██████╗
             ████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
             ╚██╔═██╔╝██║  ██║██║   ██║ ╚███╔╝ █████╗  ██║  ██║
             ████████╗██║  ██║██║   ██║ ██╔██╗ ██╔══╝  ██║  ██║
             ╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
              ╚═╝ ╚═╝ ╚═════╝  ╚═════╝ ╚═╝  ╚═╝╚══════╝╚═════╝

               █║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░