Did the part work before the legs came off? If so, it's possible to file down the package, solder some new leads and cover it with epoxy. You'll need to be extremely careful, when re-soldering it to the board. Wrap a damp piece of paper towel round the new leads can protect them from getting too hot for the epoxy and solder it as quickly as possible.