diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2015-10-29 14:13:36 +0100 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2015-10-29 21:40:20 +0100 |
| commit | 7bd9f72a3c3c48c246a6d4917bcfaa0075fd0860 (patch) | |
| tree | ed0783670ca655d9b50ac2c739d9ef19e3599794 /miasm2/core/parse_asm.py | |
| parent | b64b11399e4b6988169edd2964dda48a816eaf7e (diff) | |
| download | miasm-7bd9f72a3c3c48c246a6d4917bcfaa0075fd0860.tar.gz miasm-7bd9f72a3c3c48c246a6d4917bcfaa0075fd0860.zip | |
Core/Parse_asm: fix string parsing
Diffstat (limited to 'miasm2/core/parse_asm.py')
| -rw-r--r-- | miasm2/core/parse_asm.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/miasm2/core/parse_asm.py b/miasm2/core/parse_asm.py index 8f193705..646ad445 100644 --- a/miasm2/core/parse_asm.py +++ b/miasm2/core/parse_asm.py @@ -148,7 +148,7 @@ def parse_txt(mnemo, attrib, txt, symbol_pool=None): if directive in ['string', 'ascii']: # XXX HACK line = line.replace(r'\n', '\n').replace(r'\r', '\r') - raw = line[line.find(r'"') + 1:line.rfind(r"'")] + raw = line[line.find(r'"') + 1:line.rfind(r'"')] raw = raw.decode('string_escape') if directive == 'string': raw += "\x00" @@ -157,7 +157,7 @@ def parse_txt(mnemo, attrib, txt, symbol_pool=None): if directive == 'ustring': # XXX HACK line = line.replace(r'\n', '\n').replace(r'\r', '\r') - raw = line[line.find(r'"') + 1:line.rfind(r"'")] + "\x00" + raw = line[line.find(r'"') + 1:line.rfind(r'"')] + "\x00" raw = raw.decode('string_escape') raw = "".join([string + '\x00' for string in raw]) lines.append(asmbloc.asm_raw(raw)) |