There are more than a few ways to break open a Masterlock, but that leaves the lock damaged. There are also many files on the internet that will claim to tell you how to get the combo, but most are outdated. However there is a way to get the combo to a modern (2005) Masterlock. And it's not all that complex.
First off let me say it's going to take some time, probably like 5-10 minutes, and it is made much harder by an old damaged lock, a brand new lock on the other hand is very easy.
We start with 40 * 40 * 40 = 64,000 possible combos.
When you pull on the lock you will notice the dial doesn't spin, well it moves a bit but then stops. Those stopping points are the key, there are 12 of them around the dial. Each of these 12 will fall into 1 of 3 groups. The numbers in the same group will all have the same ones place digit (ex 03, 13, 23, 33). There will be 3 of these groups, one group will have all the stopping points dead on a number, the other group will all have them between two numbers (ex 5-6, 15-16, 25-26, 35-36). I like to refer to the ones between 2 places as .5, so 5-6 is 5.5, and 15-16 is 15.5. The last group will have 3 which are in between, and 1 odd ball which is dead on.
This is by far the hardest step, as like I said an old lock can really make it hard to tell if it is dead on or in between. But logic can help a lot, let's take this example:
1, 3.5, 7.5, 11, 13.5, 17, 21.5, 23, 27.5, 31, 33.5, 37
We will break it down into it's groups:
1, 11, 21.5, 31
3.5, 13.5, 23, 33.5
7.5, 17, 27.5, 37
First thing is that 21.5, this one is obviously off. There is never a group with 3 dead ons and 1 in between, if one of the groups has 2 or more dead ons and you are sure they are dead ons then the whole group is dead ons.
Next we notice 23, 17, and 37 are canidents for our oddball. Now we need to go back and check just those 3 again, and decide of the 3 which 1 looks like it's most dead on. That is really the best we can do, like I said an old lock can really mess things up. Let's say that 23 ended up being our oddball (17 and 37 ended up being 17.5 and 37.5).
Well now we have the odd ball, that is your last number in the combo. So now you have:
40 * 40 * 1 = 1,600 possible combos, still a lot, but better.
Now you have to understand the second type of group with lock combos and that is the following 4 groups:
You will probably notice that these groups are just the possible numbers in a combo broken down by factors of 4. Whatever group the last number is part of the first number will also be a part of, and the second number will be a part of the other group which is also either even or odd. Kind of confusing I guess, but all three numbers will either be even or odd, and the first and last will be in the same group, the second will be in the only other group which is also even or odd. I labeled each group with either A or B, so if the last (and thus first) number is in an A group then the second will be in the other A group. So in our above example of 23 as the last number we have the first and last numbers in the last group (which is a B) and the second number will be in the second group (the other B). This gives us now:
10 * 10 * 1 = 100 possible combos, now that is pretty good.
From here you could just try all 100, but there is a way to limit it down to 64, and just try them. However, it requires a computer, something written down, or a very good memory. I made a program that will just ask for the last number then give you the 64 possibles. I recommend you just use this as it is pretty easy. You can get rid of 2 of the 10 possible second and first numbers with two rules. The first rule is, the second number can't be 2 higher or lower than the third number. Using the example of 23 as the last number this means that 21 and 25 can't be the second number. The second rule is, the first number can't be 2 or 6 higher than the second number. This rule is a bit harder, since the second number isn't known. It means that the possible combo of 07-05-23 isn't possible, since 07 is 2 higher than 05. Also 39-33-23 isn't possible since 39 is 6 more than 33.
Lastly take your time in the steps, nothing worst than trying 64 or 100 combos just to discover you either messed up the 1 combo that was right and it didn't work so you skipped over it, or you messed up somewhere getting the list of combos to try. Practice on a brand new lock, and one that you know the combo to, so that you can just see if you can get the number (and prove that the last number will provide you with the combo in the list).
It has recently come to my attention that the second number can possibly be figured out as well. However, this method relies upon the dial not being moved (much) since the correct combo was entered. This method, like the other, is much easier to do on a new lock. Thus, you should learn it with a new lock.
Get a lock to which the combo is known, lock it. Spin the dial a number of times in either direction, "clearing" the lock. Now note where you stop spinning, this point could be anywhere, but note where it is. Now begin spinning the dial in the other direction, just before you reach the point you stopped spinning there will be a noticeable tapping of something inside. You can both hear and feel this contact, although it is very slight. The hardest part is moving the dial with just the right amount of force. Too light and you won't notice the contact, too much and you will fly by the spot and risk not noticing where it was.
The contact is not a one time deal though, if you are unsure if it just happened you can move the dial back a few spots and then try again. However, note that you are actually moving the cam inside the lock and that the point where the contact happens will move. You can also move the lock in the other direction (the direction you had originally spun it to clear it), and feel the same contact spot from the other side (although it will be a few away, about 3-5 spots in size).
Now enter the correct combo into your test lock, open it and then lock it. Now, knowing where the second number is, move the dial to the left (counter clockwise, numbers going up). You should notice the tap right at the second number (note the tap will be wherever you stopped spinning the dial, so if you were sloppy it will be off). You can confirm the number by moving the dial in the other direction (right, clockwise, numbers going down), then just about 2 away from the second number you should again feel and hear the tap.
As said above, the tap will be wherever you stopped spinning the dial in that direction last, so if you stopped a number too soon or late so will the tap be a number too soon or late. Also obviously if the lock's dial has been spun, or cleared since the correct combo was last entered, then it will be in some random spot. However, even if the dial was moved since the last number was entered if it wasn't moved past the second number then you will still be able to get the second number. If it was in fact moved past the second number you should be able to know since the tap point will be where the dial was when you found it. You can "wiggle" the dial a bit when you start to tell if it is already at the tapping point. Even this however, is not foolproof as if the dial was spun several turns in one direction but then moved half a turn (or any amount less than a full turn) in the other direction it would give a false tapping point, wherever the dial had stopped being turned in the clearing direction. In practice though few people spin the dial several full turns when they lock the lock, and fewer still move the dial in the other direction after that. In my opinion this new method should be used to supplement the previous method.
Here is how I would use both methods on an unknown lock. First note the current dial position, this could be the last number. Now use the wiggling method described above to tell if the dial is already at its tapping point. If it is not then begin moving the dial to the left (counter clockwise, numbers going up), until you feel and hear the tap, confirm the tap by moving the dial right (clockwise, numbers going down), you should again feel and hear the tap, this time 2 or so spots before where it was before. Note where the spot was when you turned the dial to the left (counter clockwise, numbers going up).
Now, use the first method to determine the last number. Compare the result of the first method to where the dial was at the start. If the dial was at 21, and the first method tells us the last number is 23, then it is very likely that the dial wasn't moved. On the other hand if the dial was at 4 and the last number is 23, then that would be a good indicator that the dial had been turned. Keep in mind that the lock can be pretty flexible with the last number, and the dial can be moved a bit accidentally. However, also keep in mind that 5 numbers in either direction of the last number is 10 numbers total, or 1/4 of the whole dial. You could stop at any random number and have a 25% chance of being within 5 of the last number.
The key to using the two methods combined though is that finding the info from the lock doesn't take long (about a minute or two once you get good), the long part is trying all 64 combos. The way you use this new method is just by using what it says should be the second number as your starting point in trying the combos. If the last number was very close to where the dial was, and the tapping point is right on a possible second number (remember the groups from above), then you very likely know the second and third numbers and there are only eight possible first numbers. Even if it turns out those eight don't work no big deal, you had to try them anyway. Just keep moving from there, this new method just gives you a better spot to start your search of the 64 possible combos.
If our last number was 23, and the tapping point was 33, then I would start with the combos of XX-33-23. If none worked I'd move to XX-29-23. If they didn't work, I'd try XX-37-23, and then just move up through each possible second number (the next being 01). I've written a Perl program, it's similar to the above C++ program, except it asks for the second number, and lists the combos starting with that one. Also, I've made a PDF of the 4 sets of possible combos. It's as small as I could make it, and designed to be printed front and back. It should be about 2" x 3", or about credit card sized. I think it's easier just to remember the rules, but I was bored.