Is it LEGAL????

First do a title search, you might have to go to the main DMV.
You have to have a title if you don't and you rebuild it someone with that title can just take it from you and they don't even have to say thanks for the rebuild

That is the best piece of advice in this entire thread!

I assume you have a bill of sale from the salvage yard or can get one. Then go to your DMV and see what they say. When I titled my Dart in Colorado they did a title search to prove that the title (my mom and dad's names were on it) was valid and not reported stolen etc. After a week or so they sent me a new Colorado title and it is all good. You might have to trailer it to the local authority that verifies VINs on cars.

Depending on state etc title (proof of ownership) is independent of registration (right to drive it on the street)

If the car has no bottom (sitting in the mud for decades) it could be repaired with parts from a donor car. So don't remove the vin etc from the carcass, see about getting it titled, and repair or sell for whatever.

Good luck