Facebook
From Fiery Gorilla, 1 Year ago, written in Python.
This paste is a reply to ofusca chromedriver from rakudaoamor - view diff
Embed
Download Paste or View Raw
Hits: 212
  1. import io, re, string, os;
  2.  
  3.  
  4. path = os.path.abspath("/tmp/chromedriver");
  5. replacement = "akl_roepstdlwoeproslPOweos".encode()
  6.  
  7. with io.open(path, "r+b") as fh:
  8.     for line in iter(lambda: fh.readline(), b""):
  9.         if b"cdc_" in line:
  10.             fh.seek(-len(line), 1);
  11.             newline = re.sub(b"cdc_.{22}", replacement, line);
  12.             fh.write(newline);
  13.             print("�33[93m[*]�33[0m Linha encontrada e alterada com sucesso: ", line, "to", newline);