From f7b3b29aefa9100d42521d77f003d47bf7543843 Mon Sep 17 00:00:00 2001 From: Cervenka Dusan Date: Thu, 19 Dec 2019 11:44:39 +0100 Subject: [PATCH] Better handling of comments inside structures --- dissect/cstruct/cstruct.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dissect/cstruct/cstruct.py b/dissect/cstruct/cstruct.py index 3314e40..537740f 100644 --- a/dissect/cstruct/cstruct.py +++ b/dissect/cstruct/cstruct.py @@ -368,7 +368,7 @@ def _enums(self, data): def _structs(self, data): compiler = Compiler(self.cstruct) r = re.finditer( - r'(#(?P(?:compile))\s+)?((?Ptypedef)\s+)?(?P[^\s]+)\s+(?P[^\s]+)?(?P\s*\{[^}]+\}(?P\s+[^;\n]+)?)?\s*;', + r'(#(?P(?:compile))\s+)?((?Ptypedef)\s+)?(?P[^\s]+)\s+(?P[^\s]+)?(?P\s*\{(\s*//[^\n]*|/\*[^*]*\*/|[^}])+\}(?P\s+[^;\n]+)?)?\s*;', data, ) for t in r: