• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Gallopsled / pwntools / 1

22 Mar 2023 11:26AM UTC coverage: 1.304% (-70.2%) from 71.53%
1

push

github

web-flow
Add search for libc binary by leaked function addresses (#2103)

* libcdb: Add option to search by function offsets

When you're able to leak addresses of the libc library, use `libcdb.search_by_symbol_offsets()` to find and download the matching libc library from https://libc.rip.

If there are multiple matches, the user is prompted to select one interactively. The selection can be saved in the code for future executions of the script.

Fixes #1867

* libcdb: Handle multiple results when looking up by hash

Sometimes the same library appears to be indexed multiple times (see 0b52d2e71). Handle that situation by selecting the first in the list, since they should all be identical given the same hash value.

* Update CHANGELOG

* Fix off-by-one when pre-selecting a libc

* Do .json() only once

---------

Co-authored-by: Arusekk <arek_koz@o2.pl>

2 of 5910 branches covered (0.03%)

0 of 52 new or added lines in 1 file covered. (0.0%)

11873 existing lines in 140 files now uncovered.

221 of 16952 relevant lines covered (1.3%)

0.01 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/pwnlib/testexample.py
1
"""
2
Module-level documentation would go here, along with a general description
3
of the functionality.  You can also add module-level doctests.
4

5
You can see what the documentation for this module will look like here:
6
https://docs.pwntools.com/en/stable/testexample.html
7

8
The tests for this module are run when the documentation is automatically-generated
9
by Sphinx.  This particular module is invoked by an "automodule" directive, which
10
imports everything in the module, or everything listed in ``__all__`` in the module.
11

12
The doctests are automatically picked up by the ``>>>`` symbol, like from
13
the Python prompt.  For more on doctests, see the `Python documentation
14
<https://docs.python.org/2/library/doctest.html>`_.
15

16
All of the syntax in this file is ReStructuredText.  You can find a
17
`nice cheat sheet here <https://github.com/ralsina/rst-cheatsheet/blob/master/rst-cheatsheet.rst>`_.
18

19
Here's an example of a module-level doctest:
20

21
    >>> add(3, add(2, add(1, 0)))
22
    6
23

24
If doctests are wrong / broken, you can disable them temporarily.
25

26
    >>> add(2, 2) # doctest: +SKIP
27
    5
28

29
Some things in Python are non-deterministic, like ``dict`` or ``set``
30
ordering.  There are a lot of ways to work around this, but the
31
accepted way of doing this is to test for equality.
32

33
    >>> a = {a:a+1 for a in range(3)}
34
    >>> a == {0:1, 1:2, 2:3}
35
    True
36

37
In order to use other modules, they need to be imported from the RST
38
which documents the module.
39

40
    >>> os.path.basename('foo/bar')
41
    'bar'
42

43
"""
44

UNCOV
45
def add(a, b):
×
46
    '''add(a, b) -> int
47

48
    Adds the numbers ``a`` and ``b``.
49

50
    Arguments:
51
        a(int): First number to add
52
        b(int): Second number to add
53

54
    Returns:
55
        The sum of ``a`` and ``b``.
56

57
    Examples:
58

59
        >>> add(1,2)
60
        3
61
        >>> add(-1, 33)
62
        32
63
    '''
UNCOV
64
    return a+b
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc