main/ltb-project-ssp: rewrite prepare() for patching