Skip to content

Instantly share code, notes, and snippets.

@hashlash
Last active December 18, 2020 18:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hashlash/8b6bccb796a1089b34a5871acd857c58 to your computer and use it in GitHub Desktop.
Save hashlash/8b6bccb796a1089b34a5871acd857c58 to your computer and use it in GitHub Desktop.
Binary Exploitation Cheatsheet

Examinining Memory

https://ftp.gnu.org/old-gnu/Manuals/gdb/html_node/gdb_55.html

x/nfu addr

  • n, the repeat count. Decimal integer, default to 1, counted by units u.

  • f, the display format. Default changes each time using x or print command.

    • s null-terminated string

    • i machine instruction

    • x hexadecimal (initial default)

  • u, the unit size

    • b Bytes.

    • h Halfwords (two bytes).

    • w Words (four bytes). This is the initial default.

    • g Giant words (eight bytes).

Memory layout

It contained in a /proc/<pid>/maps file. From gdb we can do:

gdb$ info proc mappings
gdb$ maintenance info sections
gdb$ files

Dynamic library

$ ldd <binary>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment