diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2016-01-30 14:56:01 +0100 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2016-01-30 21:10:01 +0100 |
| commit | 3bf16e07198476e614462cb189c7f0ce7a91e444 (patch) | |
| tree | 12e9aafda5e40182a3f00a65a50d1d2eaf1aa7d2 | |
| parent | 1cb9cbcc2d71d76faf10d7b822f29c035a758343 (diff) | |
| download | miasm-3bf16e07198476e614462cb189c7f0ce7a91e444.tar.gz miasm-3bf16e07198476e614462cb189c7f0ce7a91e444.zip | |
Tipo: dictionary
| -rw-r--r-- | miasm2/analysis/depgraph.py | 14 | ||||
| -rw-r--r-- | miasm2/core/asmbloc.py | 2 | ||||
| -rw-r--r-- | miasm2/core/graph.py | 16 | ||||
| -rw-r--r-- | miasm2/core/sembuilder.py | 4 | ||||
| -rw-r--r-- | miasm2/core/utils.py | 6 | ||||
| -rw-r--r-- | miasm2/expression/expression.py | 8 | ||||
| -rw-r--r-- | miasm2/jitter/jitload.py | 2 | ||||
| -rw-r--r-- | miasm2/jitter/loader/pe.py | 4 | ||||
| -rw-r--r-- | test/analysis/depgraph.py | 2 | ||||
| -rw-r--r-- | test/core/utils.py | 2 |
10 files changed, 30 insertions, 30 deletions
diff --git a/miasm2/analysis/depgraph.py b/miasm2/analysis/depgraph.py index 0a5d38aa..a7c16a19 100644 --- a/miasm2/analysis/depgraph.py +++ b/miasm2/analysis/depgraph.py @@ -122,7 +122,7 @@ class DependencyNode(object): class CacheWrapper(IterableUserDict): - """Wrapper class for cache dictionnary""" + """Wrapper class for cache dictionary""" def __init__(self, dct=None): """Create a CacheWrapper with value @dct.""" @@ -148,9 +148,9 @@ class CacheWrapper(IterableUserDict): @property def nostep_cache(self): - """Dictionnary of DependencyNode and their dependencies, + """Dictionary of DependencyNode and their dependencies, without the step attribute. - The dictionnary is generated once when the method is called for the + The dictionary is generated once when the method is called for the first time and not updated afterward. """ if self._nostep_cache is None: @@ -239,12 +239,12 @@ class DependencyDict(object): @property def cache(self): - "Dictionnary of DependencyNode and their dependencies" + "Dictionary of DependencyNode and their dependencies" return self._cache @property def pending(self): - """Dictionnary of DependencyNode and their dependencies, waiting for + """Dictionary of DependencyNode and their dependencies, waiting for resolution""" return self._pending @@ -530,7 +530,7 @@ class DependencyResult(object): @property def has_loop(self): - """True if current dictionnary has a loop""" + """True if current dictionary has a loop""" if self._has_loop is None: self._has_loop = (len(self.relevant_labels) != len(set(self.relevant_labels))) @@ -539,7 +539,7 @@ class DependencyResult(object): def emul(self, ctx=None, step=False): """Symbolic execution of relevant nodes according to the history Return the values of input nodes' elements - @ctx: (optional) Initial context as dictionnary + @ctx: (optional) Initial context as dictionary @step: (optional) Verbose execution Warning: The emulation is not sound if the input nodes depend on loop diff --git a/miasm2/core/asmbloc.py b/miasm2/core/asmbloc.py index 4d7a197a..dea0577b 100644 --- a/miasm2/core/asmbloc.py +++ b/miasm2/core/asmbloc.py @@ -752,7 +752,7 @@ class AsmCFG(DiGraph): # Helpers @property def pendings(self): - """Dictionnary of label -> set(AsmCFGPending instance) indicating + """Dictionary of label -> set(AsmCFGPending instance) indicating which label are missing in the current instance. A label is missing if a block which is already in nodes has constraints with him (thanks to its .bto) and the corresponding block is not yet in diff --git a/miasm2/core/graph.py b/miasm2/core/graph.py index f49e0da1..f1681078 100644 --- a/miasm2/core/graph.py +++ b/miasm2/core/graph.py @@ -166,14 +166,14 @@ class DiGraph(object): def node_attr(self, node): """ - Returns a dictionnary of the @node's attributes + Returns a dictionary of the @node's attributes @node: a node of the graph """ return {} def edge_attr(self, src, dst): """ - Return a dictionnary of attributes for the edge between @src and @dst + Return a dictionary of attributes for the edge between @src and @dst @src: the source node of the edge @dst: the destination node of the edge """ @@ -340,7 +340,7 @@ class DiGraph(object): The function doesn't return the self reference in dominators. @node: The start node - @gen_dominators: The dictionnary containing at least node's + @gen_dominators: The dictionary containing at least node's dominators/post_dominators @succ_cb: return predecessors/succesors of a node @@ -386,7 +386,7 @@ class DiGraph(object): """Return an iterator of the ordered list of @node's dominators The function doesn't return the self reference in dominators. @node: The start node - @dominators: The dictionnary containing at least node's dominators + @dominators: The dictionary containing at least node's dominators """ return self._walk_generic_dominator(node, dominators, @@ -396,7 +396,7 @@ class DiGraph(object): """Return an iterator of the ordered list of @node's postdominators The function doesn't return the self reference in postdominators. @node: The start node - @postdominators: The dictionnary containing at least node's + @postdominators: The dictionary containing at least node's postdominators """ @@ -771,7 +771,7 @@ class MatchGraph(DiGraph): @candidate: @graph's node @expected: MatchGraphJoker instance @graph: DiGraph instance - @partial_sol: (optional) dictionnary of MatchGraphJoker -> @graph's node + @partial_sol: (optional) dictionary of MatchGraphJoker -> @graph's node standing for a partial solution """ # Avoid having 2 different joker for the same node @@ -845,13 +845,13 @@ class MatchGraph(DiGraph): def match(self, graph): """Naive subgraph matching between graph and self. - Iterator on matching solution, as dictionnary MatchGraphJoker -> @graph + Iterator on matching solution, as dictionary MatchGraphJoker -> @graph @graph: DiGraph instance In order to obtained correct and complete results, @graph must be connected. """ # Partial solution: nodes corrects, edges between these nodes corrects - # A partial solution is a dictionnary MatchGraphJoker -> @graph's node + # A partial solution is a dictionary MatchGraphJoker -> @graph's node todo = list() # Dictionnaries containing partial solution done = list() # Aleady computed partial solutions diff --git a/miasm2/core/sembuilder.py b/miasm2/core/sembuilder.py index 83981919..ce327ce1 100644 --- a/miasm2/core/sembuilder.py +++ b/miasm2/core/sembuilder.py @@ -131,7 +131,7 @@ class SemBuilder(object): def __init__(self, ctx): """Create a SemBuilder - @ctx: context dictionnary used during parsing + @ctx: context dictionary used during parsing """ # Init self.transformer = MiasmTransformer() @@ -144,7 +144,7 @@ class SemBuilder(object): @property def functions(self): - """Return a dictionnary name -> func of parsed functions""" + """Return a dictionary name -> func of parsed functions""" return self._functions.copy() @staticmethod diff --git a/miasm2/core/utils.py b/miasm2/core/utils.py index 30aff7d2..70520c1b 100644 --- a/miasm2/core/utils.py +++ b/miasm2/core/utils.py @@ -53,7 +53,7 @@ def whoami(): class BoundedDict(UserDict.DictMixin): - """Limited in size dictionnary. + """Limited in size dictionary. To reduce combinatory cost, once an upper limit @max_size is reached, @max_size - @min_size elements are suppressed. @@ -65,7 +65,7 @@ class BoundedDict(UserDict.DictMixin): def __init__(self, max_size, min_size=None, initialdata=None, delete_cb=None): """Create a BoundedDict - @max_size: maximum size of the dictionnary + @max_size: maximum size of the dictionary @min_size: (optional) number of most used element to keep when resizing @initialdata: (optional) dict instance with initial data @delete_cb: (optional) callback called when an element is removed @@ -121,7 +121,7 @@ class BoundedDict(UserDict.DictMixin): @property def data(self): - "Return the current instance as a dictionnary" + "Return the current instance as a dictionary" return self._data def __getitem__(self, key): diff --git a/miasm2/expression/expression.py b/miasm2/expression/expression.py index 229f8a21..bda0dbc4 100644 --- a/miasm2/expression/expression.py +++ b/miasm2/expression/expression.py @@ -227,7 +227,7 @@ class Expr(object): def replace_expr(self, dct=None): """Find and replace sub expression using dct - @dct: dictionnary of Expr -> * + @dct: dictionary of Expr -> * """ if dct is None: dct = {} @@ -1214,7 +1214,7 @@ def test_set(e, v, tks, result): @e : Expr @v : Expr @tks : list of ExprId, available jokers - @result : dictionnary of ExprId -> Expr, current context + @result : dictionary of ExprId -> Expr, current context """ if not v in tks: @@ -1227,11 +1227,11 @@ def test_set(e, v, tks, result): def MatchExpr(e, m, tks, result=None): """Try to match m expression with e expression with tks jokers. - Result is output dictionnary with matching joker values. + Result is output dictionary with matching joker values. @e : Expr to test @m : Targetted Expr @tks : list of ExprId, available jokers - @result : dictionnary of ExprId -> Expr, output matching context + @result : dictionary of ExprId -> Expr, output matching context """ if result is None: diff --git a/miasm2/jitter/jitload.py b/miasm2/jitter/jitload.py index 2335cc3c..1bb9a806 100644 --- a/miasm2/jitter/jitload.py +++ b/miasm2/jitter/jitload.py @@ -428,7 +428,7 @@ class jitter: def add_lib_handler(self, libs, user_globals=None): """Add a function to handle libs call with breakpoints @libs: libimp instance - @user_globals: dictionnary for defined user function + @user_globals: dictionary for defined user function """ if user_globals is None: user_globals = {} diff --git a/miasm2/jitter/loader/pe.py b/miasm2/jitter/loader/pe.py index 1c811101..89876a92 100644 --- a/miasm2/jitter/loader/pe.py +++ b/miasm2/jitter/loader/pe.py @@ -228,7 +228,7 @@ def vm_load_pe_libs(vm, libs_name, libs, lib_path_base, **kargs): @libs_name: list of str @libs: libimp_pe instance @lib_path_base: (optional) DLLs relative path - Return a dictionnary Filename -> PE instances + Return a dictionary Filename -> PE instances Extra arguments are passed to vm_load_pe_lib """ return {fname: vm_load_pe_lib(vm, fname, libs, lib_path_base, **kargs) @@ -455,7 +455,7 @@ class libimp_pe(libimp): def vm_load_pe_and_dependencies(vm, fname, name2module, runtime_lib, lib_path_base, **kwargs): - """Load a binary and all its dependencies. Returns a dictionnary containing + """Load a binary and all its dependencies. Returns a dictionary containing the association between binaries names and it's pe object @vm: virtual memory manager instance diff --git a/test/analysis/depgraph.py b/test/analysis/depgraph.py index b532080b..211671a4 100644 --- a/test/analysis/depgraph.py +++ b/test/analysis/depgraph.py @@ -168,7 +168,7 @@ DD2.cache[DEPNODES_0[4]] = set(DEPNODES_0[5:9]) assert DD2.cache != DD0.cache -print " [+] Test dictionnary equality" +print " [+] Test dictionary equality" DNA = DependencyNode(LBL2, A, 0, next(STEP_COUNTER)) DNB = DependencyNode(LBL1, B, 1, next(STEP_COUNTER)) DNC = DependencyNode(LBL1, C, 0, next(STEP_COUNTER), True) diff --git a/test/core/utils.py b/test/core/utils.py index bf14df68..f7de6565 100644 --- a/test/core/utils.py +++ b/test/core/utils.py @@ -13,7 +13,7 @@ class TestUtils(unittest.TestCase): def logger(key): print "DELETE", key - # Create a 5/2 dictionnary + # Create a 5/2 dictionary bd = BoundedDict(5, 2, initialdata={"element": "value"}, delete_cb=logger) bd["element2"] = "value2" |