Ubuntu

Comment 21 for bug 986841

Robert Fleming (fleming) wrote :

Here's a script to automate the fix from comment 3. Run as, e.g. "sudo ./fix_nppdf.py /opt/Adobe/Reader9/Browser/intellinux/nppdf.so".

#! /usr/bin/python3

import mmap, sys

target = br'C:\nppdf32Log\debuglog.txt'
replacement = br'/dev/null'
replacement += b'\0' * (len(target) - len(replacement))

with open(sys.argv[1], 'r+') as f:
  m = mmap.mmap(f.fileno(), 0)
  offset = m.find(target)
  assert offset != -1
  m[offset:offset+len(target)] = replacement