Commit edb7ecec199afc1825a44ee8bad8b0312f382004
1 parent
879c3fb4
More fixes on relative imports (py3)
Showing
11 changed files
with
34 additions
and
34 deletions
oletools/ezhexviewer.py
| @@ -54,7 +54,7 @@ __version__ = '0.50' | @@ -54,7 +54,7 @@ __version__ = '0.50' | ||
| 54 | # + options to set title and msg | 54 | # + options to set title and msg |
| 55 | 55 | ||
| 56 | 56 | ||
| 57 | -from thirdparty.easygui import easygui | 57 | +from .thirdparty.easygui import easygui |
| 58 | import sys | 58 | import sys |
| 59 | 59 | ||
| 60 | # === PYTHON 2+3 SUPPORT ====================================================== | 60 | # === PYTHON 2+3 SUPPORT ====================================================== |
| @@ -154,4 +154,4 @@ def main(): | @@ -154,4 +154,4 @@ def main(): | ||
| 154 | 154 | ||
| 155 | 155 | ||
| 156 | if __name__ == '__main__': | 156 | if __name__ == '__main__': |
| 157 | - main() | ||
| 158 | \ No newline at end of file | 157 | \ No newline at end of file |
| 158 | + main() |
oletools/mraptor.py
| @@ -66,8 +66,8 @@ __version__ = '0.51' | @@ -66,8 +66,8 @@ __version__ = '0.51' | ||
| 66 | 66 | ||
| 67 | import sys, logging, optparse, re | 67 | import sys, logging, optparse, re |
| 68 | 68 | ||
| 69 | -from thirdparty.xglob import xglob | ||
| 70 | -from thirdparty.tablestream import tablestream | 69 | +from .thirdparty.xglob import xglob |
| 70 | +from .thirdparty.tablestream import tablestream | ||
| 71 | 71 | ||
| 72 | import olevba | 72 | import olevba |
| 73 | 73 |
oletools/mraptor3.py
| @@ -63,13 +63,13 @@ __version__ = '0.50py3' | @@ -63,13 +63,13 @@ __version__ = '0.50py3' | ||
| 63 | 63 | ||
| 64 | import sys, logging, optparse, re | 64 | import sys, logging, optparse, re |
| 65 | 65 | ||
| 66 | -from thirdparty.xglob import xglob | 66 | +from .thirdparty.xglob import xglob |
| 67 | 67 | ||
| 68 | # import the python 3 version of tablestream: | 68 | # import the python 3 version of tablestream: |
| 69 | -from thirdparty.tablestream import tablestream | 69 | +from .thirdparty.tablestream import tablestream |
| 70 | 70 | ||
| 71 | # import the python 3 version of olevba | 71 | # import the python 3 version of olevba |
| 72 | -import olevba3 as olevba | 72 | +from . import olevba3 as olevba |
| 73 | 73 | ||
| 74 | # === LOGGING ================================================================= | 74 | # === LOGGING ================================================================= |
| 75 | 75 |
oletools/olebrowse.py
| @@ -52,9 +52,9 @@ __version__ = '0.02' | @@ -52,9 +52,9 @@ __version__ = '0.02' | ||
| 52 | # - stream info: magic, entropy, ... ? | 52 | # - stream info: magic, entropy, ... ? |
| 53 | 53 | ||
| 54 | import optparse, sys, os | 54 | import optparse, sys, os |
| 55 | -from thirdparty.easygui import easygui | ||
| 56 | -import thirdparty.olefile as olefile | ||
| 57 | -import ezhexviewer | 55 | +from .thirdparty.easygui import easygui |
| 56 | +from .thirdparty import olefile | ||
| 57 | +from . import ezhexviewer | ||
| 58 | 58 | ||
| 59 | ABOUT = '~ About olebrowse' | 59 | ABOUT = '~ About olebrowse' |
| 60 | QUIT = '~ Quit' | 60 | QUIT = '~ Quit' |
oletools/olemap.py
| @@ -52,8 +52,8 @@ __version__ = '0.50' | @@ -52,8 +52,8 @@ __version__ = '0.50' | ||
| 52 | # === IMPORTS ================================================================ | 52 | # === IMPORTS ================================================================ |
| 53 | 53 | ||
| 54 | import sys | 54 | import sys |
| 55 | -from thirdparty.olefile import olefile | ||
| 56 | -from thirdparty.tablestream import tablestream | 55 | +from .thirdparty.olefile import olefile |
| 56 | +from .thirdparty.tablestream import tablestream | ||
| 57 | 57 | ||
| 58 | 58 | ||
| 59 | 59 |
oletools/olemeta.py
| @@ -60,8 +60,8 @@ __version__ = '0.50' | @@ -60,8 +60,8 @@ __version__ = '0.50' | ||
| 60 | #=== IMPORTS ================================================================= | 60 | #=== IMPORTS ================================================================= |
| 61 | 61 | ||
| 62 | import sys, codecs | 62 | import sys, codecs |
| 63 | -import thirdparty.olefile as olefile | ||
| 64 | -from thirdparty.tablestream import tablestream | 63 | +import .thirdparty import olefile |
| 64 | +from .thirdparty.tablestream import tablestream | ||
| 65 | 65 | ||
| 66 | 66 | ||
| 67 | #=== MAIN ================================================================= | 67 | #=== MAIN ================================================================= |
| @@ -117,4 +117,4 @@ def main(): | @@ -117,4 +117,4 @@ def main(): | ||
| 117 | ole.close() | 117 | ole.close() |
| 118 | 118 | ||
| 119 | if __name__ == '__main__': | 119 | if __name__ == '__main__': |
| 120 | - main() | ||
| 121 | \ No newline at end of file | 120 | \ No newline at end of file |
| 121 | + main() |
oletools/oleobj.py
| @@ -70,8 +70,8 @@ __version__ = '0.51' | @@ -70,8 +70,8 @@ __version__ = '0.51' | ||
| 70 | 70 | ||
| 71 | import logging, struct, optparse, os, re, sys | 71 | import logging, struct, optparse, os, re, sys |
| 72 | 72 | ||
| 73 | -from thirdparty.olefile import olefile | ||
| 74 | -from thirdparty.xglob import xglob | 73 | +from .thirdparty.olefile import olefile |
| 74 | +from .thirdparty.xglob import xglob | ||
| 75 | 75 | ||
| 76 | # === LOGGING ================================================================= | 76 | # === LOGGING ================================================================= |
| 77 | 77 |
oletools/oletimes.py
| @@ -61,8 +61,8 @@ __version__ = '0.50' | @@ -61,8 +61,8 @@ __version__ = '0.50' | ||
| 61 | #=== IMPORTS ================================================================= | 61 | #=== IMPORTS ================================================================= |
| 62 | 62 | ||
| 63 | import sys, datetime | 63 | import sys, datetime |
| 64 | -import thirdparty.olefile as olefile | ||
| 65 | -from thirdparty.prettytable import prettytable | 64 | +from .thirdparty import olefile |
| 65 | +from .thirdparty.prettytable import prettytable | ||
| 66 | 66 | ||
| 67 | 67 | ||
| 68 | # === MAIN =================================================================== | 68 | # === MAIN =================================================================== |
oletools/olevba.py
| @@ -256,15 +256,16 @@ except ImportError: | @@ -256,15 +256,16 @@ except ImportError: | ||
| 256 | + "see http://codespeak.net/lxml " \ | 256 | + "see http://codespeak.net/lxml " \ |
| 257 | + "or http://effbot.org/zone/element-index.htm") | 257 | + "or http://effbot.org/zone/element-index.htm") |
| 258 | 258 | ||
| 259 | -import thirdparty.olefile as olefile | ||
| 260 | -from thirdparty.prettytable import prettytable | ||
| 261 | -from thirdparty.xglob import xglob, PathNotFoundException | ||
| 262 | -from thirdparty.pyparsing.pyparsing import \ | 259 | +from .thirdparty import olefile |
| 260 | +from .thirdparty.prettytable import prettytable | ||
| 261 | +from .thirdparty.xglob import xglob, PathNotFoundException | ||
| 262 | +from .thirdparty.pyparsing.pyparsing import \ | ||
| 263 | CaselessKeyword, CaselessLiteral, Combine, Forward, Literal, \ | 263 | CaselessKeyword, CaselessLiteral, Combine, Forward, Literal, \ |
| 264 | Optional, QuotedString,Regex, Suppress, Word, WordStart, \ | 264 | Optional, QuotedString,Regex, Suppress, Word, WordStart, \ |
| 265 | alphanums, alphas, hexnums,nums, opAssoc, srange, \ | 265 | alphanums, alphas, hexnums,nums, opAssoc, srange, \ |
| 266 | infixNotation, ParserElement | 266 | infixNotation, ParserElement |
| 267 | -import ppt_parser | 267 | +from . import ppt_parser |
| 268 | + | ||
| 268 | 269 | ||
| 269 | # monkeypatch email to fix issue #32: | 270 | # monkeypatch email to fix issue #32: |
| 270 | # allow header lines without ":" | 271 | # allow header lines without ":" |
| @@ -1886,7 +1887,7 @@ def detect_dridex_strings(vba_code): | @@ -1886,7 +1887,7 @@ def detect_dridex_strings(vba_code): | ||
| 1886 | :param vba_code: str, VBA source code | 1887 | :param vba_code: str, VBA source code |
| 1887 | :return: list of str tuples (encoded string, decoded string) | 1888 | :return: list of str tuples (encoded string, decoded string) |
| 1888 | """ | 1889 | """ |
| 1889 | - from thirdparty.DridexUrlDecoder.DridexUrlDecoder import DridexUrlDecode | 1890 | + from .thirdparty.DridexUrlDecoder.DridexUrlDecoder import DridexUrlDecode |
| 1890 | 1891 | ||
| 1891 | results = [] | 1892 | results = [] |
| 1892 | found = set() | 1893 | found = set() |
oletools/pyxswf.py
| @@ -74,10 +74,11 @@ __version__ = '0.50' | @@ -74,10 +74,11 @@ __version__ = '0.50' | ||
| 74 | 74 | ||
| 75 | #=== IMPORTS ================================================================= | 75 | #=== IMPORTS ================================================================= |
| 76 | 76 | ||
| 77 | -import optparse, sys, os, rtfobj | 77 | +import optparse, sys, os |
| 78 | +from . import rtfobj | ||
| 78 | from io import BytesIO | 79 | from io import BytesIO |
| 79 | -from thirdparty.xxxswf import xxxswf | ||
| 80 | -import thirdparty.olefile as olefile | 80 | +from .thirdparty.xxxswf import xxxswf |
| 81 | +from .thirdparty import olefile | ||
| 81 | 82 | ||
| 82 | 83 | ||
| 83 | #=== MAIN ================================================================= | 84 | #=== MAIN ================================================================= |
oletools/rtfobj.py
| @@ -83,12 +83,10 @@ __version__ = '0.51' | @@ -83,12 +83,10 @@ __version__ = '0.51' | ||
| 83 | import re, os, sys, binascii, logging, optparse | 83 | import re, os, sys, binascii, logging, optparse |
| 84 | import os.path | 84 | import os.path |
| 85 | 85 | ||
| 86 | -from thirdparty.xglob import xglob | ||
| 87 | -from oleobj import OleObject, OleNativeStream | ||
| 88 | -import oleobj | ||
| 89 | - | ||
| 90 | -from thirdparty.tablestream import tablestream | ||
| 91 | - | 86 | +from .thirdparty.xglob import xglob |
| 87 | +from .thirdparty.tablestream import tablestream | ||
| 88 | +from .oleobj import OleObject, OleNativeStream | ||
| 89 | +from . import oleobj | ||
| 92 | 90 | ||
| 93 | # === LOGGING ================================================================= | 91 | # === LOGGING ================================================================= |
| 94 | 92 |