I'll see what I can remember...it was a while ago. I do recall that you need a pretty long flex-shaft screwdriver (or whatever they're called) to get at those torx (T-15?) sunroof screws. A ratcheting screwdriver is also very helpful.
The trim panel (#5) is clipped to the sunroof panel with six metal spring clips (#8)
in this diagram. Normally, you slide the roof halfway back & use a trim tool or screwdriver to pry the front of the trim panel off. Then you slide it back and remove the six torx screws that hold the sunroof on its plastic rails.
With the roof jammed it's virtually impossible to get at those clips. My trim fabric was pretty nasty too, so I just cut through the center and ripped it apart enough to unscrew the sunroof panel. Then I unclipped the trim, lifted off the roof, and proceeded with the rest of my power sunroof upgrade. LMK if you want details for that...it was easier than I though it'd be.
You'll need to remove the metal rail covers (
#7 in this diagram) to get at the cables (#11). It's about 20 small sheet metal screws, don't lose too many (or if you do, PM me, I have a lot left over). Pull the rails out & maybe what's left of the liner too.
To replace the cable, just keep cranking the handle until the cables snake all the way out of the crank tubes. The plastic rails can be removed & put onto a newer set. Make sure the plastic brackets aren't cracked around the rivets...they'll fail in a week or two if they have any cracks at all. Then lube the new cables, snake them back into the crank tubes (take care that they're even), put the liner back in, feed the plastic rails back into their tracks, and put the rail covers back on.
Finally, crank the sunroof cables to closed position, put the roof panel back on, and align it in the closed position. Finally, open it back up and re-clip the liner panel in place.
Done!