GDB命令,逆向除錯很有用
阿新 • • 發佈:2019-01-09
感覺比很多網站的教程有用,分享一下
對於我自己用gdb反彙編十分有幫助啊,感謝外國友人了~
實用的幾個command:
Restart>>>run / r
Break any point>>>break *address Break func >>> break [function] F9>>>continue F7>>>step,next finish this function >>> finish show current code >>> x /10i (10 lines)
GDB Command Line Arguments: |
Starting GDB:
- gdbname-of-executable
- gdb -ename-of-executable-cname-of-core-file
- gdbname-of-executable--pid=process-id
Useps -auxwto list process id's:- Attach to a process already running:
[prompt]$ ps -auxw | grep myapp user1 2812 0.7 2.0 1009328 164768 ? Sl Jun07 1:18 /opt/bin/myapp [prompt]$
- Attach to a process already running:
Command line options: (version 6. Older versions use a single "-")
-
Option Description --help
-hList command line arguments --exec=file-name
-efile-nameIdentify executable associated with core file. --core=name-of-core-file
-cname-of-core-fileSpecify core file. --command=command-file
-xcommand-fileFile listing GDB commands to perform. Good for automating set-up. --directory=directory
-ddirectoryAdd directory to the path to search for source files. --cd=directory Run GDB using specified directory as the current working directory. --nx
-nDo not execute commands from~/.gdbinitinitialization file. Default is to look at this file and execute the list of commands. --batch -xcommand-file Run in batch (not interactive) mode. Execute commands from file. Requires-xoption. --symbols=file-name
-sfile-nameRead symbol table from file file. --se=file-name Use FILE as symbol file and executable file. --write Enable writing into executable and core files. --quiet
-qDo not print the introductory and copyright messages. --tty=device Specifydevicefor running program's standard input and output. --tui Use a terminal user interface. Console curses based GUI interface for GDB. Generates a source and debug console area. --pid=process-id
-pprocess-idSpecify process ID number to attach to. --version Print version information and then exit.
Commands used within GDB:
Displaying STL container classes using the GDB "pvariable-name" results in an cryptic display of template definitions and pointers. Use the followingfile
(V1.03 09/15/08). Now works with GDB 4.3+. Use the following commands provided by the script:
Example:STL_vector_int.cpp
|