Commit be0f02960332bc5ec886ff55fffbb484fd908a7b
1 parent
efc46922
updated olebrowse to use olefile
Showing
1 changed file
with
14 additions
and
4 deletions
oletools/olebrowse.py
| ... | ... | @@ -12,7 +12,7 @@ olebrowse project website: http://www.decalage.info/python/olebrowse |
| 12 | 12 | olebrowse is part of the python-oletools package: |
| 13 | 13 | http://www.decalage.info/python/oletools |
| 14 | 14 | |
| 15 | -olebrowse is copyright (c) 2012, Philippe Lagadec (http://www.decalage.info) | |
| 15 | +olebrowse is copyright (c) 2012-2014, Philippe Lagadec (http://www.decalage.info) | |
| 16 | 16 | All rights reserved. |
| 17 | 17 | |
| 18 | 18 | Redistribution and use in source and binary forms, with or without modification, |
| ... | ... | @@ -36,11 +36,12 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 36 | 36 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 37 | 37 | """ |
| 38 | 38 | |
| 39 | -__version__ = '0.01' | |
| 39 | +__version__ = '0.02' | |
| 40 | 40 | |
| 41 | 41 | #------------------------------------------------------------------------------ |
| 42 | 42 | # CHANGELOG: |
| 43 | 43 | # 2012-09-17 v0.01 PL: - first version |
| 44 | +# 2014-11-29 v0.02 PL: - use olefile instead of OleFileIO_PL | |
| 44 | 45 | |
| 45 | 46 | #------------------------------------------------------------------------------ |
| 46 | 47 | # TODO: |
| ... | ... | @@ -52,7 +53,7 @@ __version__ = '0.01' |
| 52 | 53 | |
| 53 | 54 | import optparse, sys, os |
| 54 | 55 | from thirdparty.easygui import easygui |
| 55 | -from thirdparty.OleFileIO_PL import OleFileIO_PL | |
| 56 | +import thirdparty.olefile as olefile | |
| 56 | 57 | import ezhexviewer |
| 57 | 58 | |
| 58 | 59 | ABOUT = '~ About olebrowse' |
| ... | ... | @@ -60,10 +61,16 @@ QUIT = '~ Quit' |
| 60 | 61 | |
| 61 | 62 | |
| 62 | 63 | def about (): |
| 64 | + """ | |
| 65 | + Display information about this tool | |
| 66 | + """ | |
| 63 | 67 | easygui.textbox(title='About olebrowse', text=__doc__) |
| 64 | 68 | |
| 65 | 69 | |
| 66 | 70 | def browse_stream (ole, stream): |
| 71 | + """ | |
| 72 | + Browse a stream (hex view or save to file) | |
| 73 | + """ | |
| 67 | 74 | #print 'stream:', stream |
| 68 | 75 | while True: |
| 69 | 76 | msg ='Select an action for the stream "%s", or press Esc to exit' % repr(stream) |
| ... | ... | @@ -98,12 +105,15 @@ def browse_stream (ole, stream): |
| 98 | 105 | |
| 99 | 106 | |
| 100 | 107 | def main(): |
| 108 | + """ | |
| 109 | + Main function | |
| 110 | + """ | |
| 101 | 111 | try: |
| 102 | 112 | filename = sys.argv[1] |
| 103 | 113 | except: |
| 104 | 114 | filename = easygui.fileopenbox() |
| 105 | 115 | try: |
| 106 | - ole = OleFileIO_PL.OleFileIO(filename) | |
| 116 | + ole = olefile.OleFileIO(filename) | |
| 107 | 117 | listdir = ole.listdir() |
| 108 | 118 | streams = [] |
| 109 | 119 | for direntry in listdir: | ... | ... |