only read *.symbols file can search quicklier

when search the libc, only need read the "*.symbols" file to find
This commit is contained in:
1nv0k3r 2019-05-24 18:08:38 +08:00 committed by GitHub
parent d8afd02c86
commit 1e27a32123
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -38,9 +38,11 @@ class LibcSearcher(object):
db = self.libc_database_path
files = []
# only read "*.symbols" file to find
for _, _, f in os.walk(db):
files += f
for i in f:
files += re.findall('^.*symbols$', i)
result = []
for ff in files:
fd = open(db + ff, "rb")