about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--miasm/core/asmblock.py158
1 files changed, 1 insertions, 157 deletions
diff --git a/miasm/core/asmblock.py b/miasm/core/asmblock.py
index 93ad6b13..5ac1312f 100644
--- a/miasm/core/asmblock.py
+++ b/miasm/core/asmblock.py
@@ -42,13 +42,6 @@ class AsmRaw(object):
         return str(self)
 
 
-class asm_raw(AsmRaw):
-
-    def __init__(self, raw=b""):
-        warnings.warn('DEPRECATION WARNING: use "AsmRaw" instead of "asm_raw"')
-        super(asm_label, self).__init__(raw)
-
-
 class AsmConstraint(object):
     c_to = "c_to"
     c_next = "c_next"
@@ -60,16 +53,6 @@ class AsmConstraint(object):
         self.loc_key = loc_key
         self.c_t = c_t
 
-    def get_label(self):
-        warnings.warn('DEPRECATION WARNING: use ".loc_key" instead of ".label"')
-        return self.loc_key
-
-    def set_label(self, loc_key):
-        warnings.warn('DEPRECATION WARNING: use ".loc_key" instead of ".label"')
-        self.loc_key = loc_key
-
-    label = property(get_label, set_label)
-
     def to_string(self, loc_db=None):
         if loc_db is None:
             return "%s:%s" % (self.c_t, self.loc_key)
@@ -83,13 +66,6 @@ class AsmConstraint(object):
         return self.to_string()
 
 
-class asm_constraint(AsmConstraint):
-
-    def __init__(self, loc_key, c_t=AsmConstraint.c_to):
-        warnings.warn('DEPRECATION WARNING: use "AsmConstraint" instead of "asm_constraint"')
-        super(asm_constraint, self).__init__(loc_key, c_t)
-
-
 class AsmConstraintNext(AsmConstraint):
 
     def __init__(self, loc_key):
@@ -99,13 +75,6 @@ class AsmConstraintNext(AsmConstraint):
         )
 
 
-class asm_constraint_next(AsmConstraint):
-
-    def __init__(self, loc_key):
-        warnings.warn('DEPRECATION WARNING: use "AsmConstraintNext" instead of "asm_constraint_next"')
-        super(asm_constraint_next, self).__init__(loc_key)
-
-
 class AsmConstraintTo(AsmConstraint):
 
     def __init__(self, loc_key):
@@ -114,12 +83,6 @@ class AsmConstraintTo(AsmConstraint):
             c_t=AsmConstraint.c_to
         )
 
-class asm_constraint_to(AsmConstraint):
-
-    def __init__(self, loc_key):
-        warnings.warn('DEPRECATION WARNING: use "AsmConstraintTo" instead of "asm_constraint_to"')
-        super(asm_constraint_to, self).__init__(loc_key)
-
 
 class AsmBlock(object):
 
@@ -131,13 +94,7 @@ class AsmBlock(object):
         self._loc_key = loc_key
         self.alignment = alignment
 
-    def get_label(self):
-        warnings.warn('DEPRECATION WARNING: use ".loc_key" instead of ".label"')
-        return self.loc_key
-
     loc_key = property(lambda self:self._loc_key)
-    label = property(get_label)
-
 
     def to_string(self, loc_db=None):
         out = []
@@ -290,13 +247,6 @@ class AsmBlock(object):
         )
 
 
-class asm_bloc(object):
-
-    def __init__(self, loc_key, alignment=1):
-        warnings.warn('DEPRECATION WARNING: use "AsmBlock" instead of "asm_bloc"')
-        super(asm_bloc, self).__init__(loc_key, alignment)
-
-
 class AsmBlockBad(AsmBlock):
 
     """Stand for a *bad* ASM block (malformed, unreachable,
@@ -345,26 +295,6 @@ class AsmBlockBad(AsmBlock):
         raise RuntimeError("An AsmBlockBad cannot be split")
 
 
-class asm_block_bad(AsmBlockBad):
-
-    def __init__(self, loc_key=None, alignment=1, errno=-1, *args, **kwargs):
-        warnings.warn('DEPRECATION WARNING: use "AsmBlockBad" instead of "asm_block_bad"')
-        super(asm_block_bad, self).__init__(loc_key, alignment, *args, **kwargs)
-
-class AsmSymbolPool(LocationDB):
-    """[DEPRECATED API] use 'LocationDB' instead"""
-
-    def __init__(self, *args, **kwargs):
-        warnings.warn("Deprecated API, use 'LocationDB' instead")
-        super(AsmSymbolPool, self).__init__(*args, **kwargs)
-
-class asm_symbol_pool(AsmSymbolPool):
-
-    def __init__(self):
-        warnings.warn('DEPRECATION WARNING: use "LocationDB" instead of "asm_symbol_pool"')
-        super(asm_symbol_pool, self).__init__()
-
-
 class AsmCFG(DiGraph):
 
     """Directed graph standing for a ASM Control Flow Graph with:
@@ -399,32 +329,6 @@ class AsmCFG(DiGraph):
         graph = self.__class__(self.loc_db)
         return graph + self
 
-
-    # Compatibility with old list API
-    def append(self, *args, **kwargs):
-        raise DeprecationWarning("AsmCFG is a graph, use add_node")
-
-    def remove(self, *args, **kwargs):
-        raise DeprecationWarning("AsmCFG is a graph, use del_node")
-
-    def __getitem__(self, *args, **kwargs):
-        raise DeprecationWarning("Order of AsmCFG elements is not reliable")
-
-    def __contains__(self, _):
-        """
-        DEPRECATED. Use:
-        - loc_key in AsmCFG.nodes() to test loc_key existence
-        """
-        raise RuntimeError("DEPRECATED")
-
-    def __iter__(self):
-        """
-        DEPRECATED. Use:
-        - AsmCFG.blocks() to iter on blocks
-        - loc_key in AsmCFG.nodes() to test loc_key existence
-        """
-        raise RuntimeError("DEPRECATED")
-
     def __len__(self):
         """Return the number of blocks in AsmCFG"""
         return len(self._nodes)
@@ -609,16 +513,6 @@ class AsmCFG(DiGraph):
         """
         return self._pendings
 
-    def label2block(self, loc_key):
-        """
-        DEPRECATED: Use "loc_key_to_block" instead of "label2block"
-
-        Return the block corresponding to loc_key @loc_key
-        @loc_key: LocKey instance
-        """
-        warnings.warn('DEPRECATION WARNING: use "loc_key_to_block" instead of "label2block"')
-        return self.loc_key_to_block(loc_key)
-
     def rebuild_edges(self):
         """Consider blocks '.bto' and rebuild edges according to them, ie:
         - update constraint type
@@ -1310,13 +1204,6 @@ def asmblock_final(mnemo, asmcfg, blockChains, loc_db, conservative=False):
             assemble_block(mnemo, block, loc_db, conservative)
 
 
-def asmbloc_final(mnemo, blocks, blockChains, loc_db, conservative=False):
-    """Resolve and assemble @blockChains using @loc_db until fixed point is
-    reached"""
-
-    warnings.warn('DEPRECATION WARNING: use "asmblock_final" instead of "asmbloc_final"')
-    asmblock_final(mnemo, blocks, blockChains, loc_db, conservative)
-
 def asm_resolve_final(mnemo, asmcfg, loc_db, dst_interval=None):
     """Resolve and assemble @asmcfg using @loc_db into interval
     @dst_interval"""
@@ -1405,31 +1292,6 @@ class disasmEngine(object):
         # Override options if needed
         self.__dict__.update(kwargs)
 
-    def get_job_done(self):
-        warnings.warn("""DEPRECATION WARNING: "job_done" is not needed anymore, support is dropped.""")
-        return set()
-
-    def set_job_done(self, _):
-        warnings.warn("""DEPRECATION WARNING: "job_done" is not needed anymore, support is dropped.""")
-        return
-
-    def get_dis_bloc_callback(self):
-        warnings.warn("""DEPRECATION WARNING: "dis_bloc_callback" use dis_block_callback.""")
-        return self.dis_block_callback
-
-    def set_dis_bloc_callback(self, function):
-        warnings.warn("""DEPRECATION WARNING: "dis_bloc_callback" use dis_block_callback.""")
-        self.dis_block_callback = function
-
-    @property
-    def symbol_pool(self):
-        warnings.warn("""DEPRECATION WARNING: use 'loc_db'""")
-        return self.loc_db
-
-    # Deprecated
-    job_done = property(get_job_done, set_job_done)
-    dis_bloc_callback = property(get_dis_bloc_callback, set_dis_bloc_callback)
-
     def _dis_block(self, offset, job_done=None):
         """Disassemble the block at offset @offset
         @job_done: a set of already disassembled addresses
@@ -1567,9 +1429,7 @@ class disasmEngine(object):
             self.dis_block_callback(mn=self.arch, attrib=self.attrib,
                                     pool_bin=self.bin_stream, cur_bloc=cur_block,
                                     offsets_to_dis=offsets_to_dis,
-                                    loc_db=self.loc_db,
-                                    # Deprecated API
-                                    symbol_pool=self.loc_db)
+                                    loc_db=self.loc_db)
         return cur_block, offsets_to_dis
 
     def dis_block(self, offset):
@@ -1580,14 +1440,6 @@ class disasmEngine(object):
         current_block, _ = self._dis_block(offset)
         return current_block
 
-    def dis_bloc(self, offset):
-        """
-        DEPRECATED function
-        Use dis_block instead of dis_bloc
-        """
-        warnings.warn('DEPRECATION WARNING: use "dis_block" instead of "dis_bloc"')
-        return self.dis_block(offset)
-
     def dis_multiblock(self, offset, blocks=None, job_done=None):
         """Disassemble every block reachable from @offset regarding
         specific disasmEngine conditions
@@ -1624,14 +1476,6 @@ class disasmEngine(object):
                                pool_bin=self.bin_stream)
         return blocks
 
-    def dis_multibloc(self, offset, blocs=None):
-        """
-        DEPRECATED function
-        Use dis_multiblock instead of dis_multibloc
-        """
-        warnings.warn('DEPRECATION WARNING: use "dis_multiblock" instead of "dis_multibloc"')
-        return self.dis_multiblock(offset, blocs)
-
     def dis_instr(self, offset):
         """Disassemble one instruction at offset @offset and return the
         corresponding instruction instance