M.F.
Hold her ankles, instead of her legs. They're thinner, so you can get a good grip. Then, before you open the diaper, gather her hands together and hold them, by the wrists, with the same hand that has her ankles. I joke that it's like a baby hog-tie. This way you have a firm grip on both ands and legs, keep the hands out of the mess, and still have a free hand to do the clean-up. While she's confined, keep telling her you have to hold her hands because she keeps putting them in her poop and how gross that is and how that's not allowed.