It requires patience, perseverance and inginuity. ???
From a metal coat hanger make a hook to go into the rivit pin hole. Feed inwards while rotating the sprocket using either of the crankshaft nuts. It will catch, feed around the sprocket and then you can pull it out.
Have the charity swearbox beside you will doing this.