code: public void applyPatch(File file, File currentFolder) throws Exception {
          FileInputStream fis = new FileInputStream(file);
          BufferedReader br = new BufferedReader(new InputStreamReader(fis));
          String line;
          String failedString = patchString;
          String[] patch = patchData;
          // Attempt to look if file is vulnerable
          for (int i = 0 ; i < 80 ; i++) { // Check first 80 lines - if there is no signature it is not our file
              line = br.readLine();
              if (line == null) {
                  // File less than 80 lines long, no signature encountered
                  return;
              }
              if (line.trim().equals("function validURL(url) {")) { // Already patched
                  failedString = null;
                  patch = null;
                  continue;
              }
              if (line.trim().equals(quickFixString)) { // The patch had famous 2-letter bug, update it
                  failedString = quickFixString;
                  patch = quickFix;
                  continue;
              }
              if (line.trim().equals("function loadFrames() {")) {
                  fis.close(); // It should not interfere with the file renaming process
                  if (failedString != null) {
                      // Vulnerable file
                      if (!doPatch) { // Report and return
                          System.out.println("Vulnerable file found: "+file.getCanonicalPath());
                      } else {
                          replaceStringInFile(currentFolder, file, failedString, patch);
                      }
                  }
                  return;
              }
          }
      }
docs: /*
  Try to apply patch to the single file in the specific folder
  If global parameter doPatch is false we should only print the location of the vulnerable html file
  and return