about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorserpilliere <devnull@localhost>2014-06-24 15:06:26 +0200
committerserpilliere <devnull@localhost>2014-06-24 15:06:26 +0200
commitf328270d56dd649bdeb87afac6d31c3c652b55ca (patch)
tree336b2343f080777f46caf3f0d53c22f2250cc853
parent70e7237106321ddf6fb2db198cdf45d06b74581a (diff)
downloadmiasm-f328270d56dd649bdeb87afac6d31c3c652b55ca.tar.gz
miasm-f328270d56dd649bdeb87afac6d31c3c652b55ca.zip
Cpu: bs_mod_name accept dict
Diffstat (limited to '')
-rw-r--r--miasm2/core/cpu.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/miasm2/core/cpu.py b/miasm2/core/cpu.py
index 7d672caa..9ce551db 100644
--- a/miasm2/core/cpu.py
+++ b/miasm2/core/cpu.py
@@ -532,7 +532,13 @@ class bs_mod_name(bs_divert):
         out = []
         for candidate in candidates:
             cls, name, bases, dct, fields = candidate
-            for value, new_name in enumerate(self.args['mn_mod']):
+            tab = self.args['mn_mod']
+            if isinstance(tab, list):
+                tmp = {}
+                for j, v in enumerate(tab):
+                    tmp[j] = v
+                tab = tmp
+            for value, new_name in tab.items():
                 nfields = fields[:]
                 s = int2bin(value, self.args['l'])
                 args = dict(self.args)