From a0f2e079bbeb59064c7006d74c0db29c2d4c5a84 Mon Sep 17 00:00:00 2001 From: Cervenka Dusan Date: Thu, 19 Dec 2019 11:30:01 +0100 Subject: [PATCH] Added support for gcc attribute Ignoring __attribute__ --- 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..6d77c82 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+(__attribute__\(\([^)]+\)\)\s*)?(?P[^\s]+)?(?P\s*\{[^}]+\}(?P\s+[^;\n]+)?)?\s*;', data, ) for t in r: