|iRdZdZddlZddlZddlZejejeje Z ejej e dZ e ejvrej de ddlZddlZddlmZdZdZdZd Zd Zed kr edSdS) a olebrowse.py A simple GUI to browse OLE files (e.g. MS Word, Excel, Powerpoint documents), to view and extract individual data streams. Usage: olebrowse.py [file] olebrowse project website: http://www.decalage.info/python/olebrowse olebrowse is part of the python-oletools package: http://www.decalage.info/python/oletools olebrowse is copyright (c) 2012-2019, Philippe Lagadec (http://www.decalage.info) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. z0.54Nz..) ezhexviewerz~ About olebrowsez~ Quitc<tjdtdS)z- Display information about this tool zAbout olebrowse)titletextN)easyguitextbox__doc__@C:\PYTHON\_runtimes\venv\Lib\site-packages\oletools/olebrowse.pyaboutr Ps  O+'::::::r cf dt|z}gd}tj|d|}|d|vrdS|drB||}t j|d |zd n|d r||}tjd }|Pt|d}| || tj d|z1)z4 Browse a stream (hex view or save to file) Tz:Select an action for the stream "%s", or press Esc to exit)zHex viewzSave stream to filez~ Back to main menu olebrowse)rchoicesNBackHexz Stream: %s)msgrSavez stream.bin)defaultwbzstream saved to file %s) reprr choicebox startswith openstreamgetvaluer hexview_data filesaveboxopenwriteclosemsgbox)olestreamractionsactiondatafnamefs r browse_streamr)WsA B IDQWLL X"3k7KKK >Vv-- E   u % % B>>&))2244D  $T|f/DK X X X X X  v & & B>>&))2244D' ===E %%  85@AAA9Br cf tjd}n#tj}YnxYw t j|}|}g}|D]*}|d|+|t|td}|Wd}d}tj |||}| |tkrdS|tkrtnt|||UdSdS#tjYdSxYw)z Main function /TNz%Select a stream, or press Esc to exitr)sysargvr fileopenboxolefile OleFileIOlistdirappendjoinABOUTQUITrr r) exceptionbox)filenamer"r2streamsdirentryr#rrs r mainr;|s>)8A;)&(())++-- / /H NN388H-- . . . .ut 8CE&sE7;;F~4c6***     s,B6D(,DD0__main__)r __version__optparser-ospathnormpathabspathdirname__file___thismodule_dirr4 _parent_dirinsertrr0oletoolsrr5r6r r)r;__name__r r r rJs<##X '""27??27??83L3L#M#MNNgrw||OTBBCC chHOOA{### ;;;!B!B!BJD zDFFFFFr