diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2020-12-16 20:01:42 +0100 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2020-12-24 17:15:46 +0100 |
| commit | 73e54732e50b405762c64e0faa032e5ae0fcd1ed (patch) | |
| tree | d00eca211174dcef32971e271f307721a1217a40 | |
| parent | 19e2aad184a089c26682c42b81d6d7ea8eca897a (diff) | |
| download | miasm-73e54732e50b405762c64e0faa032e5ae0fcd1ed.tar.gz miasm-73e54732e50b405762c64e0faa032e5ae0fcd1ed.zip | |
Add deprecation warning
| -rw-r--r-- | miasm/analysis/dse.py | 6 | ||||
| -rw-r--r-- | miasm/analysis/machine.py | 13 | ||||
| -rw-r--r-- | miasm/analysis/simplifier.py | 7 | ||||
| -rw-r--r-- | miasm/ir/analysis.py | 12 | ||||
| -rw-r--r-- | miasm/ir/ir.py | 11 | ||||
| -rw-r--r-- | miasm/jitter/llvmconvert.py | 6 |
6 files changed, 54 insertions, 1 deletions
diff --git a/miasm/analysis/dse.py b/miasm/analysis/dse.py index c90f30ef..5e6c4e8d 100644 --- a/miasm/analysis/dse.py +++ b/miasm/analysis/dse.py @@ -49,6 +49,7 @@ Here are a few remainings TODO: """ from builtins import range from collections import namedtuple +import warnings try: import z3 @@ -548,6 +549,11 @@ class DSEPathConstraint(DSEEngine): if produce_solution == self.PRODUCE_SOLUTION_PATH_COV: self._history = [] # List of addresses in the current path + @property + def ir_arch(self): + warnings.warn('DEPRECATION WARNING: use ".lifter" instead of ".ir_arch"') + return self.lifter + def take_snapshot(self, *args, **kwargs): snap = super(DSEPathConstraint, self).take_snapshot(*args, **kwargs) snap["new_solutions"] = { diff --git a/miasm/analysis/machine.py b/miasm/analysis/machine.py index 4936fd26..bf3cc6f8 100644 --- a/miasm/analysis/machine.py +++ b/miasm/analysis/machine.py @@ -1,4 +1,5 @@ #-*- coding:utf-8 -*- +import warnings class Machine(object): @@ -216,7 +217,7 @@ class Machine(object): self.__log_jit = log_jit self.__log_arch = log_arch self.__base_expr = arch.base_expr - self.__ir = ir + self.__lifter = lifter self.__name = machine_name @property @@ -267,3 +268,13 @@ class Machine(object): def available_machine(cls): "Return a list of supported machines" return cls.__available + + @property + def ira(self): + warnings.warn('DEPRECATION WARNING: use ".lifter_model_call" instead of ".ira"') + return self.lifter_model_call + + @property + def ir(self): + warnings.warn('DEPRECATION WARNING: use ".lifter" instead of ".ir"') + return self.lifter diff --git a/miasm/analysis/simplifier.py b/miasm/analysis/simplifier.py index fd053b26..e547ee19 100644 --- a/miasm/analysis/simplifier.py +++ b/miasm/analysis/simplifier.py @@ -3,6 +3,7 @@ Apply simplification passes to an IR cfg """ import logging +import warnings from functools import wraps from miasm.analysis.ssa import SSADiGraph from miasm.analysis.outofssa import UnSSADiGraph @@ -50,6 +51,12 @@ class IRCFGSimplifier(object): self.lifter = lifter self.init_passes() + @property + def ir_arch(self): + fds + warnings.warn('DEPRECATION WARNING: use ".lifter" instead of ".ir_arch"') + return self.lifter + def init_passes(self): """ Init the array of simplification passes diff --git a/miasm/ir/analysis.py b/miasm/ir/analysis.py index 13e4d238..c08ea13b 100644 --- a/miasm/ir/analysis.py +++ b/miasm/ir/analysis.py @@ -105,3 +105,15 @@ class LifterModelCall(Lifter): def sizeof_pointer(self): "Return the size of a void* in bits" raise NotImplementedError("Abstract method") + + + +class ira(LifterModelCall): + """ + DEPRECATED object + Use LifterModelCall instead of ira + """ + + def __init__(self, arch, attrib, loc_db): + warnings.warn('DEPRECATION WARNING: use "LifterModelCall" instead of "ira"') + super(ira, self).__init__(arch, attrib, loc_db) diff --git a/miasm/ir/ir.py b/miasm/ir/ir.py index b80d5f8b..9039efa1 100644 --- a/miasm/ir/ir.py +++ b/miasm/ir/ir.py @@ -921,6 +921,17 @@ class Lifter(object): return new_irblocks +class IntermediateRepresentation(Lifter): + """ + DEPRECATED object + Use Lifter instead of IntermediateRepresentation + """ + + def __init__(self, arch, attrib, loc_db): + warnings.warn('DEPRECATION WARNING: use "Lifter" instead of "IntermediateRepresentation"') + super(IntermediateRepresentation, self).__init__(arch, attrib, loc_db) + + class ir(Lifter): """ DEPRECATED object diff --git a/miasm/jitter/llvmconvert.py b/miasm/jitter/llvmconvert.py index d2210a4d..2430d884 100644 --- a/miasm/jitter/llvmconvert.py +++ b/miasm/jitter/llvmconvert.py @@ -17,6 +17,7 @@ import os from llvmlite import binding as llvm from llvmlite import ir as llvm_ir from builtins import int as int_types +import warnings from future.utils import viewitems, viewvalues @@ -230,6 +231,11 @@ class LLVMContext_JIT(LLVMContext): LLVMContext.__init__(self, name) self.vmcpu = {} + @property + def ir_arch(self): + warnings.warn('DEPRECATION WARNING: use ".lifter" instead of ".ir_arch"') + return self.lifter + def load_libraries(self): # Get LLVM specific functions name = "libLLVM-%d.%d" % (llvm.llvm_version_info[0], |