/* Peddler.java by Mark D. LaDue */ /* March 15, 1998 */ /* Copyright (c) 1998 Mark D. LaDue You may study, use, modify, and distribute this example for any purpose. This example is provided WITHOUT WARRANTY either expressed or implied. */ /* Peddler.java fixes SFped.class in Finjan's SurfinCheck 1.0 to renew its demo license. To use it, do the following: 1. Compile Peddler.java to obtain Peddler.class. 2. Place the resulting Peddler.class in the SurfinCheck folder, along with SFped.class. 3. Update Sfped.class with the following command: java Peddler SurfinCheck will now run as before, and its splash screen will again report that the evaluation license has 30 days before it expires. */ import java.io.*; import java.util.*; public class Peddler { public static void main(String[] argv) { String hack = "SFped.class"; Date now = new Date(); try { // Start by opening the file for reading and writing RandomAccessFile victim = new RandomAccessFile(hack, "rw"); // Put the current day at byte 15, put the current month at byte 20, // and put the current year at byte 25 victim.seek(14); victim.writeByte(now.getDate()); victim.seek(19); victim.writeByte(now.getMonth()); victim.seek(24); victim.writeByte(now.getYear()); // That's all for now victim.close(); } catch (IOException ioe) {System.err.println("Oops!");} System.out.println("SFped.class has been updated successfully."); } }