Skip to content

Instantly share code, notes, and snippets.

@JohnLaTwC
Created October 10, 2020 17:17
Show Gist options
  • Save JohnLaTwC/ec5688588dc10e346557df2da81aba4e to your computer and use it in GitHub Desktop.
Save JohnLaTwC/ec5688588dc10e346557df2da81aba4e to your computer and use it in GitHub Desktop.
Python code to remove XOR encryption
filename = r"419301a8b6bb734a27fe3682eb6231113c36ce525c4b0dec220cb9b9b7f9ca0e"
password = "VelvetSweatshop"
encryption_removed_filename = filename + '.saved.xls'
from xlrd import *
import win32com.client
xlApp = win32com.client.Dispatch("Excel.Application")
xlwb = xlApp.Workbooks.Open(filename, Password=password)
xlwb.SaveAs(encryption_removed_filename)
xlApp.Application.quit()
import XLMMacroDeobfuscator.deobfuscator
xlmdeob = XLMMacroDeobfuscator.deobfuscator
from imp import reload
reload(xlmdeob)
result = xlmdeob.process_file(file=encryption_removed_filename,
noninteractive= True,
noindent= True,
output_formula_format='[[CELL_ADDR]], [[INT-FORMULA]]',
return_deobfuscated= True)
for record in result:
print(record)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment