Skip to content

Commit 75cc3c3

Browse files
authored
libcdb.unstrip_libc: debug symbols are fetched only if not present (#2374)
* libcdb.unstrip_libc: debug symbols are fetched only if not present * Usage of `ELF.debuginfo` to check if debug symbols exist closes #2324 --------- Signed-off-by: sswastik02 <[email protected]> * Add CHANGELOG Signed-off-by: sswastik02 <[email protected]> --------- Signed-off-by: sswastik02 <[email protected]>
1 parent a2acdf9 commit 75cc3c3

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,10 @@ The table below shows which release corresponds to each branch, and what date th
7272
## 4.14.0 (`dev`)
7373

7474
- [#2356][2356] Add local libc database provider for libcdb
75+
- [#2374][2374] libcdb.unstrip_libc: debug symbols are fetched only if not present
7576

7677
[2356]: https://github.com/Gallopsled/pwntools/pull/2356
78+
[2374]: https://github.com/Gallopsled/pwntools/pull/2374
7779

7880
## 4.13.0 (`beta`)
7981

pwnlib/libcdb.py

+4
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,10 @@ def unstrip_libc(filename):
291291
log.warn_once('Given libc does not have a buildid. Cannot look for debuginfo to unstrip.')
292292
return False
293293

294+
if libc.debuginfo:
295+
log.debug('Given libc already contains debug information. Skipping unstrip.')
296+
return True
297+
294298
log.debug('Trying debuginfod servers: %r', DEBUGINFOD_SERVERS)
295299

296300
for server_url in DEBUGINFOD_SERVERS:

0 commit comments

Comments
 (0)