Merge pull request #1264 from mandiant/fix/issue-1263

render: verbose: fix rendering of scopes
This commit is contained in:
Willi Ballenthin
2023-01-05 11:54:59 +01:00
committed by GitHub
2 changed files with 6 additions and 0 deletions

View File

@@ -74,6 +74,7 @@
- elf: better detect OS via GLIBC ABI version needed and dependencies #1221 @williballenthin
- dotnet: address unhandled exceptions with improved type checking #1230 @mike-hunhoff
- fix import-to-ida script formatting #1208 @williballenthin
- render: fix verbose rendering of scopes #1263 @williballenthin
### capa explorer IDA Pro plugin
- fix: display instruction items #1154 @mr-tz

View File

@@ -22,6 +22,8 @@ Unless required by applicable law or agreed to in writing, software distributed
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and limitations under the License.
"""
import enum
import tabulate
import capa.rules
@@ -126,6 +128,9 @@ def render_rules(ostream, doc: rd.ResultDocument):
if isinstance(v, list) and len(v) == 1:
v = v[0]
if isinstance(v, enum.Enum):
v = v.value
rows.append((key, v))
if rule.meta.scope != capa.rules.FILE_SCOPE: