converted FFPatcher to java UNTESTED