Cut the drain pipe close to where it enters the wall. Leave about an inch or so sticking out of the wall.
Remove the other end of the cut drain pipe from the drain trap.
Glue a T-fitting to the cut pipe extending from the wall. Make sure the "T" part of the fitting is facing straight up.
Slide the fitting over the end of the pipe until the fitting stops sliding.
Glue a trap adapter in the other end of the T-fitting. This adapter fits inside the T-fitting.
Slide it in until it won't move any more.
Connect the drain trap to the trap adapter by placing the end of the trap into the adapter. Tighten the screw ring on the adapter to fasten the two pieces together.
Glue a short piece of pipe into the "T" part of the fitting. Glue the Studor vent onto the piece of pipe by placing the vent on top of the pipe and pressing downward on the vent to seat it in place.