From 4d2dc5ea6c3c8b60076aeba4ba4d8df7a4896b17 Mon Sep 17 00:00:00 2001 From: serpilliere Date: Wed, 31 Oct 2012 16:10:27 +0100 Subject: ia32_arch: parse label starting w dot --- miasm/arch/ia32_arch.py | 4 +++- 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() -- cgit 1.4.1