|
2 | 2 | #
|
3 | 3 | # DESCRIPTION: A user-friendly gdb configuration file, for x86/x86_64 and ARM platforms.
|
4 | 4 | #
|
5 |
| -# REVISION : 8.0.4 (08/05/2013) |
| 5 | +# REVISION : 8.0.5 (18/08/2013) |
6 | 6 | #
|
7 | 7 | # CONTRIBUTORS: mammon_, elaine, pusillus, mong, zhang le, l0kit,
|
8 | 8 | # truthix the cyberpunk, fG!, gln
|
|
30 | 30 | #
|
31 | 31 | # CHANGELOG: (older changes at the end of the file)
|
32 | 32 | #
|
| 33 | +# Version 8.0.5 (18/08/2013) |
| 34 | +# - Add commands header and loadcmds to dump Mach-O header information |
| 35 | +# - Other fixes and additions from previous commits |
| 36 | +# |
33 | 37 | # Version 8.0.4 (08/05/2013)
|
34 | 38 | # - Detect automatically 32 or 64 bits archs using sizeof(void*).
|
35 | 39 | # Thanks to Tyilo for the simple but very effective idea!
|
@@ -3676,6 +3680,31 @@ define resetkdp
|
3676 | 3680 | set $KDP64BITS = -1
|
3677 | 3681 | end
|
3678 | 3682 |
|
| 3683 | +define header |
| 3684 | + if $argc != 0 |
| 3685 | + dump memory /tmp/gdbinit_header_dump $arg0 $arg0 + 4096 |
| 3686 | + shell /usr/bin/otool -h /tmp/gdbinit_header_dump |
| 3687 | + shell /bin/rm -f /tmp/gdbinit_header_dump |
| 3688 | + end |
| 3689 | +end |
| 3690 | +document header |
| 3691 | +Syntax: header MACHO_HEADER_START_ADDRESS |
| 3692 | +| Dump the Mach-O header located at given address |
| 3693 | +end |
| 3694 | + |
| 3695 | +define loadcmds |
| 3696 | + if $argc != 0 |
| 3697 | + # this size should be good enough for most binaries |
| 3698 | + dump memory /tmp/gdbinit_header_dump $arg0 $arg0 + 4096 * 10 |
| 3699 | + shell /usr/bin/otool -l /tmp/gdbinit_header_dump |
| 3700 | + shell /bin/rm -f /tmp/gdbinit_header_dump |
| 3701 | + end |
| 3702 | +end |
| 3703 | +document loadcmds |
| 3704 | +Syntax: loadcmds MACHO_HEADER_START_ADDRESS |
| 3705 | +| Dump the Mach-O load commands |
| 3706 | +end |
| 3707 | + |
3679 | 3708 | #EOF
|
3680 | 3709 |
|
3681 | 3710 | # Older change logs:
|
|
0 commit comments