diff options
| author | Ajax <commial@gmail.com> | 2018-07-02 17:31:59 +0200 |
|---|---|---|
| committer | Ajax <commial@gmail.com> | 2018-07-03 14:28:18 +0200 |
| commit | 68fac2e86cc61eba9adfe520fa0e04a7e8943450 (patch) | |
| tree | 2be74a21b54a3111f3c18746badfb0cf1ed41149 /miasm2/analysis/binary.py | |
| parent | 6ef8dbb2223d0847e3822b545b249511e96a1f9b (diff) | |
| download | miasm-68fac2e86cc61eba9adfe520fa0e04a7e8943450.tar.gz miasm-68fac2e86cc61eba9adfe520fa0e04a7e8943450.zip | |
symbol_pool -> loc_db
Diffstat (limited to 'miasm2/analysis/binary.py')
| -rw-r--r-- | miasm2/analysis/binary.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/miasm2/analysis/binary.py b/miasm2/analysis/binary.py index 5d9374da..ae3b964e 100644 --- a/miasm2/analysis/binary.py +++ b/miasm2/analysis/binary.py @@ -1,8 +1,9 @@ import logging +import warnings from miasm2.core.bin_stream import bin_stream_str, bin_stream_elf, bin_stream_pe from miasm2.jitter.csts import PAGE_READ -from miasm2.core.asmblock import AsmSymbolPool +from miasm2.core.locationdb import LocationDB log = logging.getLogger("binary") @@ -94,7 +95,7 @@ class Container(object): self._bin_stream = None self._entry_point = None self._arch = None - self._symbol_pool = AsmSymbolPool() + self._loc_db = LocationDB() # Launch parsing self.parse(*args, **kwargs) @@ -120,10 +121,15 @@ class Container(object): return self._arch @property - def symbol_pool(self): - "AsmSymbolPool instance preloaded with container symbols (if any)" - return self._symbol_pool + def loc_db(self): + "LocationDB instance preloaded with container symbols (if any)" + return self._loc_db + @property + def symbol_pool(self): + "[DEPRECATED API]" + warnings.warn("Deprecated API: use 'loc_db'") + return self.loc_db ## Format dependent classes class ContainerPE(Container): @@ -205,13 +211,13 @@ class ContainerELF(Container): if not name: continue try: - self._symbol_pool.add_location(name, offset) + self._loc_db.add_location(name, offset) except ValueError: # Two symbols points on the same offset log.warning("Same offset (%s) for %s and %s", (hex(offset), name, - self._symbol_pool.getby_offset(offset))) + self._loc_db.getby_offset(offset))) continue |