Sounds like you have a lead waste line and a piece of lead soldered to a closet flange these are known as a lead dutchman.Your best bet would be to call in plumber.If you can clean it all up and it is in good shape ,you might be able to slip the lead piece back into the waste line and re scure the flange to the floor,then reset the stool.A two piece wall hung tank type stool will give you a fit if you have never done it before.Good luck