First of all, if you have bad knees and you're overweight, the biggest help for your knees would be for you to lose some weight. Second, you must do squats and do them properly. The "I have bad knees so I can't do squats" is the oldest yet misguided excuse in the world.
I have a friend that was complaining about "cracking" knees every time she did squats at home. When I asked her to show me how she would do a squat, I saw how her form was all wrong... no wonder she was complaining about her knees! And so many people do this. They put most of their weight on the balls of their feet and let their knees come far in front of their toes. All they're using are their quad muscles (hence more stress on their knees) and no posterior chain muscles (i.e., hamstrings and glutes). When I showed her how to properly due a squat, I used a chair because I knew what was going to happen. When she did it properly, she pretty much fell on the chair because she had no strength on her posterior chain.
So if you have bad knees:
1. Learn how to do proper squats, driving yourself through your heels and coming down as if you're going to sit down. Bench and box squats (or a chair for that matter) help in this training.
2. Do not do deep squats. Keep them at 90 degrees at most. Do not go any deeper than that.
3. Strengthen your posterior chain muscles by doing Romanian Deadlifts and Pelvic Bridges.
4. Do not use fixed movement machines such as the leg extension machine. In fact, don't use these machines at all for anything! (That's a topic for another discussion).