Commit be0f02960332bc5ec886ff55fffbb484fd908a7b

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