Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import os
# preinstalled python is python2
filename = '/'.join(map(os.environ.get, ('TARGET_TEMP_DIR', 'FULL_PRODUCT_NAME'))) + '.xcent'
evil = '''
<!-- -->
with open(filename, 'r') as fp:
buf =
cursor = buf.rfind('</dict>')
output = buf[0:cursor] + evil + buf[cursor:]
with open(filename, 'w') as fp:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment