First get sources of all the software of this phone you can. Plus rescue firmware and make sure you know how to use it. Searching for it when you are already in trouble takes much more time than normal
Then think what you want to do with it. Simply add an app? Recompile your kernel? Add a new driver?