diff options
| author | serpilliere <devnull@localhost> | 2012-10-31 16:10:27 +0100 |
|---|---|---|
| committer | serpilliere <devnull@localhost> | 2012-10-31 16:10:27 +0100 |
| commit | 4d2dc5ea6c3c8b60076aeba4ba4d8df7a4896b17 (patch) | |
| tree | 34b795436167cb476aece86423fc168e0116b83a | |
| parent | 27fa5b2f879d8a64d15958eec00db628d4c07d06 (diff) | |
| download | miasm-4d2dc5ea6c3c8b60076aeba4ba4d8df7a4896b17.tar.gz miasm-4d2dc5ea6c3c8b60076aeba4ba4d8df7a4896b17.zip | |
ia32_arch: parse label starting w dot
| -rw-r--r-- | miasm/arch/ia32_arch.py | 4 | ||||
| -rw-r--r-- | miasm/core/parse_ad.py | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/miasm/arch/ia32_arch.py b/miasm/arch/ia32_arch.py index c81f2a18..7a00f178 100644 --- a/miasm/arch/ia32_arch.py +++ b/miasm/arch/ia32_arch.py @@ -1750,7 +1750,9 @@ class x86_mn: @classmethod def parse_mnemo(self, l): - tokens = [t for t in shlex.shlex(l)] + wordsplitted = shlex.shlex(l) + wordsplitted.wordchars += '.' # Because labels sometimes begin with dot + tokens = [t for t in wordsplitted] prefix = [] if not tokens: raise ValueError('cannot parse mnemo?', l) diff --git a/miasm/core/parse_ad.py b/miasm/core/parse_ad.py index 3c1868ac..8f5ca00d 100644 --- a/miasm/core/parse_ad.py +++ b/miasm/core/parse_ad.py @@ -102,7 +102,7 @@ t_COLON = r':' t_OFFSET = r'OFFSET' def t_NAME(t): - r'[a-zA-Z_][a-zA-Z0-9_]*' + r'\.L[A-Z]*[0-9]+|[a-zA-Z_][a-zA-Z0-9_]*' if t.value.upper() in keywords: t.type = t.value.upper() t.value = t.value.lower() |