Leave last 48 bytes in place and duplicate them at file end

by PavelVolkovitskij