I've never really considered taking painkillers before druring a walk - for some reason I instinctively dislike the idea, though couldn't really give you any reason as to why.
Whichever way you look at it, walking 100km is going to hurt, it's a plan, physical fact. The only real thing you can do is find small, simple steps to ease the pain. Are you walking with someone? If so then perhaps, you could help each other out by massaging the painful areas? (Even that does raise a wry smile on my face, the local farmer looking over his wall at the two lone hikers rubbing each other in the middle of one of his fields, lol
)
Try talking to other people who have completed the trek and see what steps they took, I'm sure there's a foum somewhere for those who have completed the similar challenge, the Lyke Wake Walk - forty miles in under 24 hours, across the North Yorkshire Moors.
Above all, do that which makes
you most comfortable, and remember to have fun!