src/doge/patcher/FilePatcher.java
public static void writePatch(RandomAccessFile fh,
            HashMap<String, Function> listOfNewFunctions, Patch patch) throws IOException {
        boolean fileAndNewPatchMatched = FileVerifier
                .isFileAndNewPatchMatched(fh, listOfNewFunctions, patch);
        boolean fileAndOldPatchMatched = FileVerifier
                .isFileAndOldPatchMatched(fh, listOfNewFunctions, patch);

        int newOffset = FilePatcher.getNewOffset(listOfNewFunctions, patch);
        if (fileAndNewPatchMatched || fileAndOldPatchMatched) {
            FilePatcher.writeBytes(fh, newOffset, patch.getNewBytes());
        } else {
            FileVerifier.printMismatchBytes(fh, newOffset, patch.getLength(), patch.getNewBytes());
        }
    }
/**
     * Enable a patch
     *
     * @param fh RandomAccessFile for better performance
     * @param listOfNewFunctions can be gotten from a DumpParser
     * @param patch the Patch object
     */
Enable a patch
@param fh RandomAccessFile for better performance
@param listOfNewFunctions can be gotten from a DumpParser
@param patch the Patch object
Enable a patch @param fh RandomAccessFile for better performance @param listOfNewFunctions can be gotten from a DumpParser @param patch the Patch object
public static void writePatch(RandomAccessFile fh,
            HashMap<String, Function> listOfNewFunctions, Patch patch) throws IOException {
        boolean fileAndNewPatchMatched = FileVerifier
                .isFileAndNewPatchMatched(fh, listOfNewFunctions, patch);
        boolean fileAndOldPatchMatched = FileVerifier
                .isFileAndOldPatchMatched(fh, listOfNewFunctions, patch);
        int newOffset = FilePatcher.getNewOffset(listOfNewFunctions, patch);
        if (fileAndNewPatchMatched || fileAndOldPatchMatched) {
            FilePatcher.writeBytes(fh, newOffset, patch.getNewBytes());
        } else {
            FileVerifier.printMismatchBytes(fh, newOffset, patch.getLength(), patch.getNewBytes());
        }
    }
public static void writePatch ( RandomAccessFile fh , HashMap < String , Function > listOfNewFunctions , Patch patch ) throws IOException { boolean fileAndNewPatchMatched = FileVerifier . isFileAndNewPatchMatched ( fh , listOfNewFunctions , patch ) ; boolean fileAndOldPatchMatched = FileVerifier . isFileAndOldPatchMatched ( fh , listOfNewFunctions , patch ) ; int newOffset = FilePatcher . getNewOffset ( listOfNewFunctions , patch ) ; if ( fileAndNewPatchMatched || fileAndOldPatchMatched ) { FilePatcher . writeBytes ( fh , newOffset , patch . getNewBytes ( ) ) ; } else { FileVerifier . printMismatchBytes ( fh , newOffset , patch . getLength ( ) , patch . getNewBytes ( ) ) ; } }
Enable a patch
 @param fh RandomAccessFile for better performance
 @param listOfNewFunctions can be gotten from a DumpParser
 @param patch the Patch object
Enable a patch @param fh RandomAccessFile for better performance @param listOfNewFunctions can be gotten from a DumpParser @param patch the Patch object