@@ -148,7 +148,7 @@ def provider_local_database(hex_encoded_id, hash_type):
148
148
"online" : [provider_libcdb , provider_libc_rip ]
149
149
}
150
150
151
- def search_by_hash (hex_encoded_id , hash_type = 'build_id' , unstrip = True , offline = False ):
151
+ def search_by_hash (hex_encoded_id , hash_type = 'build_id' , unstrip = True , offline_only = False ):
152
152
assert hash_type in HASHES , hash_type
153
153
154
154
# Ensure that the libcdb cache directory exists
@@ -161,7 +161,7 @@ def search_by_hash(hex_encoded_id, hash_type='build_id', unstrip=True, offline=F
161
161
return None
162
162
163
163
providers = PROVIDERS ["offline" ]
164
- if not offline :
164
+ if not offline_only :
165
165
providers += PROVIDERS ["online" ]
166
166
167
167
# Run through all available libc database providers to see if we have a match.
@@ -610,7 +610,7 @@ def search_by_symbol_offsets(symbols, select_index=None, unstrip=True, return_as
610
610
selected_libc = _handle_multiple_matching_libcs (matching_libcs )
611
611
return search_by_build_id (selected_libc ['buildid' ], unstrip = unstrip )
612
612
613
- def search_by_build_id (hex_encoded_id , unstrip = True , offline = False ):
613
+ def search_by_build_id (hex_encoded_id , unstrip = True , offline_only = False ):
614
614
"""
615
615
Given a hex-encoded Build ID, attempt to download a matching libc from libcdb.
616
616
@@ -619,8 +619,10 @@ def search_by_build_id(hex_encoded_id, unstrip=True, offline=False):
619
619
Hex-encoded Build ID (e.g. 'ABCDEF...') of the library
620
620
unstrip(bool):
621
621
Try to fetch debug info for the libc and apply it to the downloaded file.
622
- offline(bool):
623
- Enable offline search mode, which will disable online providers.
622
+ offline_only(bool):
623
+ Both offline and online providers are used by default. When pass
624
+ `offline_only=True`, libcdb enable an exclusive offline search mode,
625
+ which will disable online providers.
624
626
625
627
Returns:
626
628
Path to the downloaded library on disk, or :const:`None`.
@@ -636,9 +638,9 @@ def search_by_build_id(hex_encoded_id, unstrip=True, offline=False):
636
638
>>> hex(ELF(filename).symbols.read)
637
639
'0xeef40'
638
640
"""
639
- return search_by_hash (hex_encoded_id , 'build_id' , unstrip , offline )
641
+ return search_by_hash (hex_encoded_id , 'build_id' , unstrip , offline_only )
640
642
641
- def search_by_md5 (hex_encoded_id , unstrip = True , offline = False ):
643
+ def search_by_md5 (hex_encoded_id , unstrip = True , offline_only = False ):
642
644
"""
643
645
Given a hex-encoded md5sum, attempt to download a matching libc from libcdb.
644
646
@@ -647,8 +649,10 @@ def search_by_md5(hex_encoded_id, unstrip=True, offline=False):
647
649
Hex-encoded md5sum (e.g. 'ABCDEF...') of the library
648
650
unstrip(bool):
649
651
Try to fetch debug info for the libc and apply it to the downloaded file.
650
- offline(bool):
651
- Enable offline search mode, which will disable online providers.
652
+ offline_only(bool):
653
+ Both offline and online providers are used by default. When pass
654
+ `offline_only=True`, libcdb enable an exclusive offline search mode,
655
+ which will disable online providers.
652
656
653
657
Returns:
654
658
Path to the downloaded library on disk, or :const:`None`.
@@ -664,9 +668,9 @@ def search_by_md5(hex_encoded_id, unstrip=True, offline=False):
664
668
>>> hex(ELF(filename).symbols.read)
665
669
'0xeef40'
666
670
"""
667
- return search_by_hash (hex_encoded_id , 'md5' , unstrip , offline )
671
+ return search_by_hash (hex_encoded_id , 'md5' , unstrip , offline_only )
668
672
669
- def search_by_sha1 (hex_encoded_id , unstrip = True , offline = False ):
673
+ def search_by_sha1 (hex_encoded_id , unstrip = True , offline_only = False ):
670
674
"""
671
675
Given a hex-encoded sha1, attempt to download a matching libc from libcdb.
672
676
@@ -675,8 +679,10 @@ def search_by_sha1(hex_encoded_id, unstrip=True, offline=False):
675
679
Hex-encoded sha1sum (e.g. 'ABCDEF...') of the library
676
680
unstrip(bool):
677
681
Try to fetch debug info for the libc and apply it to the downloaded file.
678
- offline(bool):
679
- Enable offline search mode, which will disable online providers.
682
+ offline_only(bool):
683
+ Both offline and online providers are used by default. When pass
684
+ `offline_only=True`, libcdb enable an exclusive offline search mode,
685
+ which will disable online providers.
680
686
681
687
Returns:
682
688
Path to the downloaded library on disk, or :const:`None`.
@@ -692,10 +698,9 @@ def search_by_sha1(hex_encoded_id, unstrip=True, offline=False):
692
698
>>> hex(ELF(filename).symbols.read)
693
699
'0xeef40'
694
700
"""
695
- return search_by_hash (hex_encoded_id , 'sha1' , unstrip , offline )
701
+ return search_by_hash (hex_encoded_id , 'sha1' , unstrip , offline_only )
696
702
697
-
698
- def search_by_sha256 (hex_encoded_id , unstrip = True , offline = False ):
703
+ def search_by_sha256 (hex_encoded_id , unstrip = True , offline_only = False ):
699
704
"""
700
705
Given a hex-encoded sha256, attempt to download a matching libc from libcdb.
701
706
@@ -704,8 +709,10 @@ def search_by_sha256(hex_encoded_id, unstrip=True, offline=False):
704
709
Hex-encoded sha256sum (e.g. 'ABCDEF...') of the library
705
710
unstrip(bool):
706
711
Try to fetch debug info for the libc and apply it to the downloaded file.
707
- offline(bool):
708
- Enable offline search mode, which will disable online providers.
712
+ offline_only(bool):
713
+ Both offline and online providers are used by default. When pass
714
+ `offline_only=True`, libcdb enable an exclusive offline search mode,
715
+ which will disable online providers.
709
716
710
717
Returns:
711
718
Path to the downloaded library on disk, or :const:`None`.
@@ -721,7 +728,7 @@ def search_by_sha256(hex_encoded_id, unstrip=True, offline=False):
721
728
>>> hex(ELF(filename).symbols.read)
722
729
'0xeef40'
723
730
"""
724
- return search_by_hash (hex_encoded_id , 'sha256' , unstrip , offline )
731
+ return search_by_hash (hex_encoded_id , 'sha256' , unstrip , offline_only )
725
732
726
733
727
734
0 commit comments