Commit Graph
2141 Commits
Author SHA1 Message Date
hugsy 278e84dc8b Merge branch 'master' into dev 2021.10 2021-10-16 10:10:03 -07:00
hugsy 8074f880dd Merge fix 2021-10-16 10:09:22 -07:00
hugsy 63ffc67e35 Fixed a few bugs and added minor improvements to scripts/new-release.py 2021-10-16 10:06:24 -07:00
hugsy 2becf7bea3 Update docs/requirements.txt
Fix dependabot security report
2021-10-14 13:01:29 -07:00
Zion 5c2fe285b6 add thread symbol resolving like traces (#744) 2021-10-13 19:24:46 -07:00
Zion 48ed480c8f Resolve Context Trace Symbols (#743)
* add symbol resolving for traces
2021-10-13 19:24:24 -07:00
Zion 8719457f67 Fix a max() call on None in print_guessed_arguments (#742) 2021-10-13 09:15:53 -07:00
theguy147 ed413d1ea9 feat: measure coverage (#738) 2021-10-10 11:26:01 -04:00
theguy147 078ce338e4 feat: allow tests to be run in other places than /tmp (#739) 2021-10-08 13:10:29 -04:00
theguy147 467273fee5 fix: create tempdir before first usage (#740) 2021-10-08 13:10:10 -04:00
theguy147 fac4e7df76 fix: DeprecationWarning for unicode-escape decoding (#736)
* fix: DeprecationWarning for unicode-escape decoding

* refactor: adjust comments
2021-10-02 09:19:56 -07:00
theguy147 5ecaadb0c8 Review (#733)
* docs: fix usage for 'functions' cmd

* fix: ksymaddr cmd

- refactor ksymaddr command
- introduce argparse syntax to ksymaddr command
- add warning if process can't resolve kernel symbol addresses
- fix issue when matching symbol wasn't recognized because it was
  compared against the combination of symbol name plus module name
- add note to docs about needed permissions

* feat: add capability to pass multiple commands to gdb helpers as cmd

- refactor: create new CommandType for 'before', 'cmd' and 'after'
- refactor: add whitespace around "="
- refactor: extract method for adding commands to gdb subprocess command
- feat: add capability to pass multiple commands to 'cmd'

* fix: stub cmd

- feat: add -r shortform to argparse syntax
- docs: change LOCATION to address
- docs: update --retval syntax
- docs: fix line length
- tests: upgrade tests from just checking for exceptions to also check
  the functionality of the stub command

* docs: update reset-cache

* fix: pattern command

- docs: update pattern command
- docs: apply markdown lints and remove typo
- feat: set n for pattern cmd to default of current_arch.ptrsize
- args: update pattern command
- remove: pattern.period gef setting
- feat: support 16bit size for struct.patch
- tests: more extensive tests

* docs: update screenshots

* refactor: please linter

* fix: correct some nitpicks

* feat: use argparse syntax for deref cmd

* docs: update deref syntax

* docs: capitalize De Bruijn

* docs: fix code block on docs/index.md
2021-09-30 15:20:43 -07:00
theguy147 970a6d3608 fix: cleanly close opened files (#737) 2021-09-30 14:22:25 -07:00
Zion 5baa1280dc Allow empty context titles (#732) 2021-09-29 12:04:44 -04:00
hugsy a4a9033f4d [CI] Use Actions to check URL links in the documentation (#731)
* Fixing #729 : adding a URL checker for the documentation

* Update docs-link-check.yml:  Execute the URL check regardless of the branch

* [ #731 ] Fixing bad URLs found by the Actions

* [ #731 ] Bump Actions version to latest (1.0.13)

* [ #731 ] Better formatting in `docs/commands.md`
2021-09-29 08:31:24 -07:00
3b0d9da2b3 Support for custom contexts in ContextCommand (#727)
* added support for external context panes

* fixed a trailing space in settings

* fix for review from @hugsy

* fixed format string usage

Co-authored-by: hugsy <[email protected]>

* added ability for dynamic titles and updated api documentation

* review fix 2

* Apply suggestions from code review

Co-authored-by: hugsy <[email protected]>

* Apply suggestions from code review

Co-authored-by: theguy147 <[email protected]>

Co-authored-by: hugsy <[email protected]>
Co-authored-by: theguy147 <[email protected]>
2021-09-27 08:59:11 -07:00
hugsy 55f90908ec [ci] adjusted heap-multiple-heaps to use the universal DebugBreak so non x86 test can successfully be triggered 2021-09-26 17:18:17 -07:00
Grazfather 6400ef753f CI: Lint: Add more linters to test files (#725)
* CI: Lint: Add more linters to test files

* Fix line lengths in test files

* Fix type hints

* Use fstrings in tests

* Make tests use tuple as default iterable

* Add more lint rules and move some to 'common'

* lint: Fail on error
2021-09-25 16:52:16 -07:00
hugsy 143e60ae66 Adding unit tests for non-x86 architectures (#720)
* Use `pytest` on top of `unittest` to allow multi-proc execution
2021-09-24 19:16:12 -04:00
theguy147 1df157e56d refactor: use parse_address whenever appropriate (#723)
* refactor: use parse_address whenever appropriate

* fix typo

* refactor: replace further parse_address usages

* refactor: remove unnecessary int conversion

* typo: remove empty line
2021-09-21 19:55:03 -07:00
theguy147 f5df117611 Add feature to print heap chunks of all arenas (#722)
* feat: print heap chunks for all arenas

* style: adapt looks of heap chunks for arenas

* refactor: make GlibcArena iterable
2021-09-21 19:53:08 -07:00
irontigran 860facfd1b Add test for printing chunks with multiple heaps (#711)
* Add test for printing chunks with multiple heaps

This test checks that when a non-main arena has multiple (and therefore
non-contiguous) heaps, we still print them all out.

* Fix 'before' command in multiple heaps test

The heap set-arena command doesn't work if the heap is uninitialized, so
make sure to run to the breakpoint before using it.
2021-09-21 20:28:39 -04:00
hugsy 915ff91141 Configuration for the stale bot (#718)
* Created the config file for the stalebot in `.github/stale.yml` to auto tag an inactive issue, and close it if still no activity.

* [stalebot] Added `exemptMilestones` and `exemptAssignees` directives
2021-09-21 13:37:54 -07:00
theguy147 11a68a2f12 Fix heap chunks cmd for multiple heaps per arena (#716)
* Fix heap chunks cmd for multiple heaps per arena
* Update heap chunks screenshot in docs
* Cache get_glibc_arena
2021-09-20 22:46:38 +02:00
theguy147 1c80677a26 Fix error on help (#721) 2021-09-20 09:15:30 -04:00
Kileak f37d0ff17b Backport Elf / ElfInfoCommand updates (#717)
* backport ElfInfo from bata24

* Fix column sizes for x86

* Update formatting

* review updates / removed mem parsing

* Review update

* Use permission enum for phdr permissions
2021-09-19 10:33:54 -07:00
RafaelLeeImg 44c12c65ad Fix error where breakpoint.location is None (#715) 2021-09-15 11:46:45 +02:00
hugsy 90ffa6b08b Use pytest on top of unittest to allow multi-proc execution (#714)
* Use `pytest` on top of `unittest` to allow multi-proc execution
* Added test binary to test `unicorn` more simply
2021-09-14 20:51:31 -07:00
theguy147 3fc237c658 Fix 'heap chunks' command for non-main arenas (#706) (#709)
* Fix 'heap chunks' command for non-main arenas (#706)

* Fix 'heap chunks' cmd for non-main arenas with debug symbols enabled

* Rename arena global

* Visually realign globals

* Fix 'heap chunks' command for non-main arenas (#706)

* Fix 'heap chunks' cmd for non-main arenas with debug symbols enabled

* Rename arena global

* Visually realign globals

* Fix address parsing
2021-09-11 10:27:55 -07:00
theguy147 3bc42efa7a Fix unicorn-emulate cmd (#713) 2021-09-08 19:44:45 -04:00
CptGibbon 620ca60d77 Correct have_fastchunks arena adjustment (#704)
This check (though uncommented) appears to have been introduced to compensate for the have_fastchunks flag being moved from an arena's flags into its own field in GLIBC 2.27. The only thing that needs changing is the version number, it should be >= 2.27 rather that 2.26. In its current state, if you try to debug a program linked to a GLIBC 2.26 build without debug symbols, the arena layout is misinterpreted and heap commands will hang or give incorrect information.
2021-09-08 10:39:01 -04:00
theguy147 f1ffad0b21 Add test for gef-remote cmd (#712) 2021-09-07 11:44:16 -04:00
theguy147 f02e9ae822 Update and fix heap command (#701) 2021-09-07 11:31:02 -04:00
theguy147 1f208cc317 Update docs for several commands (#703) 2021-09-07 10:28:15 -04:00
hugsy 0bc68bb777 📕 fixed xinfo screenshot 2021-09-05 11:43:26 -07:00
hugsy 139830fb91 📕 adding new sponsors on readme 2021-09-05 08:49:38 -07:00
Kileak 8c5abfc6da Fix namebreak and add additional unit tests (#710) 2021-09-05 11:33:15 -04:00
theguy147 c4a4f58efb Fix name-break address parsing (#708) 2021-09-04 20:55:30 -04:00
plop 169e6e6dad fix typo in search-pattern help (#705) 2021-09-02 08:38:08 -04:00
hugsy 00bb12410c [ci] added decorators to include/exclude test for specific architecture(s) 2021-08-25 22:28:32 -07:00
hugsy c942736b63 followup on 4f9bd61623 2021-08-25 21:17:26 -07:00
hugsy 5beef624e7 [ci] in test bins, replaced int3 with __builtin_trap() 2021-08-25 21:14:37 -07:00
hugsy b56e8cc92e [ci] added ubuntu-18.04 to the list of CI targets (duh) 2021-08-25 16:44:20 -07:00
hugsy 4f9bd61623 [ci] added ubuntu-18.04 to the list of CI targets 2021-08-25 15:27:11 -07:00
theguy147 5e5c638c84 Update break commands (#702) 2021-08-24 14:26:07 -04:00
theguy147 6300e759ba Fix assemble command including docs and tests (#694)
Fixes the documentation and help messages for the assemble command. Furthermore the assemble command now works for all architectures (and modes, endianness) that are supported by both GDB and keystone (so not the ones that are only supported by one of them). Also this PR includes one test for each of the possible combinations of architecture, mode and endianness.

These are all now supported targets for this command:

Available architectures/modes (with endianness):
- ARM
  * ARM     (little, big)
  * THUMB   (little, big)
  * ARMV8   (little, big)
  * THUMBV8 (little, big)
- ARM64
  * AARCH64 (little)
- MIPS
  * MIPS32  (little, big)
  * MIPS64  (little, big)
- PPC
  * PPC32   (big)
  * PPC64   (little, big)
- SPARC
  * SPARC32 (little, big)
  * SPARC64 (big)
- SYSTEMZ
  * SYSTEMZ (little, big)
- X86
  * 16      (little)
  * 32      (little)
  * 64      (little)
2021-08-23 14:10:01 -04:00
theguy147 dcfa6f2eb1 Fix capstone-disassemble command and documentation (#695)
This fixes the documentation and help messages for the capstone-disassemble command. Furthermore the command was not working in use cases like emulating aarch64 inside qemu. This was due to an uncaught exception caused in gef_get_auxiliary_values when gdb's info auxv doesn't return useful results. This bug has been fixed. Also resolving of LOCATIONs has been fixed.

I also change the syntax for the location argument back to how it was before argparse: as a positional argument.

I introduced a new convenience wrapper function around gdb's parse_and_eval to specifically resolve LOCATIONs. This way other commands can rely on it without having to handle the different possible cases necessary (because e.g. gdb resolves registers different from symbols and for symbols a simple conversion to int does not work directly). This new function does not aim at replacing gef_safe_parse_and_eval at this point because too many commands currently rely on it and there might be use cases that don't resolve locations.
2021-08-23 11:02:18 -04:00
hugsy 90d2c8cd56 Fixed test of test_cmd_memory_watch: no need for scanf, which makes testing more hazardous 2021-08-21 17:40:33 -07:00
hugsy 2fb1b1030e Update run-tests.yml 2021-08-21 14:51:35 -07:00
hugsy 76c060f825 Added unittest for parse_address 2021-08-21 14:43:01 -07:00