We can easily view the contents of a memory location with the memory dump. We can use Immunity Debugger or pwndbg for this.
Memory dump
How to do it...
Follow the steps for better understanding of memory dump:
- Open an application in the Immunity Debugger.
- If you want to view the memory dump in ESI register and right-click on the address and select the Follow in Dump option:
![](https://static.packt-cdn.com/products/9781784399771/graphics/assets/292e4a31-d862-41e4-b4b8-1075676380a4.png)
- This will update the memory dump window in the bottom-left corner. The memory dump window in Immunity Debugger looks as follows:
![](https://static.packt-cdn.com/products/9781784399771/graphics/assets/a7e91cf7-f840-406c-8274-8b59539f9edb.png)
- With pwndbg we can get the memory dump with the hexdump command. For that, load the application in gdb and run it with a breaker:
pwndbg> break 5 pwndbg> run
- Now to view the memory dump in RSI register, run...