What kind of pipe is it? Cast iron, abs, pvc? Depending on what it is, and the size of the pipe would determine the easiest way to resolve this. Once you have the old flange of, a no-hub connector, or maybe even just a glue-on coupler, a short riser, and the new flange would be all that is required. You'll probably have to chip out around the pipe for a bit to make room for either the coupler (if plastic) or access to tighten a no-hub connector onto the pipe (if CI). Keep in mind that the new flange should be installed on TOP of the finished floor, so however you are raising the floor, leave room around the pipe (if it is 3") for the new flange to slide over the pipe which you can leave long until the finished floor is in. If it is a 4" pipe, you have the option of either an inside mount or outside mount (preferred). Make sure the riser is plumb, or installing the flange and having it level will be impossible.