Skip to content

Commit

Permalink
chore: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ninoseki committed May 29, 2022
1 parent 8a26281 commit 5942b3e
Show file tree
Hide file tree
Showing 5 changed files with 1,277 additions and 1,202 deletions.
9 changes: 4 additions & 5 deletions app/services/oleid.py
@@ -1,16 +1,15 @@
from typing import Optional

import oletools.oleid
from olefile import OleFileIO, isOleFile
from olefile import isOleFile


class OleID:
def __init__(self, data: bytes):
self.oid: Optional[oletools.oleid.OleID] = None

if isOleFile(data):
ole_file = OleFileIO(data)
self.oid = oletools.oleid.OleID(ole_file)
self.oid = oletools.oleid.OleID(data=data)
self.oid.check()

def is_encrypted(self) -> bool:
Expand All @@ -24,8 +23,8 @@ def has_vba_macros(self) -> bool:
if self.oid is None:
return False

macros = self.oid.get_indicator("vba_macros")
return macros is not None and macros.value is True
macros = self.oid.get_indicator("vba")
return macros is not None and macros.value == "Yes"

def has_flash_objects(self) -> bool:
if self.oid is None:
Expand Down

0 comments on commit 5942b3e

Please sign in to comment.