I am NOT a plumber, but I have had to deal with some crazy plumbing.
That white ring - if you unscrew it, does it disconnect the black pipe from the silver above? If so, that solves the sink side of the problem.
For the drain into the wall, I wonder if you'd be able to just screw the new pipe into it? Basically, just leave the crazy plumbing for the next person. Otherwise, my crazy pipe untwisted from the pipe in the wall, and I was able to just replace everything from the wall out.
Of course, I put the p trap on backwards and couldn't figure out why it was leaking, so take this with a grain of salt.