File tree Expand file tree Collapse file tree 1 file changed +6
-14
lines changed
python/unblob/handlers/archive Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Original file line number Diff line number Diff line change 11"""MSI Handler
22
3- Extracts uses 7z for now. Could migrate to fully implementation:
3+ Extracts uses 7z for now. Could migrate to a fully Python-based implementation:
44
55 https://github.com/nightlark/pymsi
66"""
@@ -51,21 +51,13 @@ class MsiHandler(Handler):
5151 def calculate_chunk (self , file : File , start_offset : int ) -> Optional [ValidChunk ]:
5252 file .seek (start_offset , io .SEEK_SET )
5353
54- try :
55- # TODO: pymsi wants a path or BytesIO
56- buf = io .BytesIO ()
57- buf .write (file [:])
58- buf .seek (0 )
59-
60- package = pymsi .Package (buf )
61- msi = pymsi .Msi (package , True )
62- except Exception :
63- return None
54+ package = pymsi .Package (file )
55+ msi = pymsi .Msi (package , False )
6456
6557 # MSI moves the file pointer
66- msi_end_offset = buf .tell ()
58+ msi_end_offset = file .tell ()
6759
6860 return ValidChunk (
69- start_offset = start_offset ,
70- end_offset = msi_end_offset ,
61+ start_offset = start_offset ,
62+ end_offset = msi_end_offset ,
7163 )
You can’t perform that action at this time.
0 commit comments