What is the best way to make a custom page from a plugin?

I had a similar thing just last week and I’ve got a solution and pushed the code up to github: https://github.com/deadlyhifi/wp_query_intercepter

Basically, it allows you to intercept an URL and choose to send a custom template file, or run anything you like based on the request.

It’s updated since my question on Rewrite loading custom template file but is_home() returns true, and there’s no 404

You should be able to change it to suit your situation.

And yes, Johannes Pille is correct, you shouldn’t change the core files. They will get overwritten at the next WP update and could cause other unexpected behaviour. You really shouldn’t need to anyway as just about everything in WP can be plugged into, filtered, or overwritten somehow.