I have studied Physics (Diploma) and since 3 years I work as a Software Engineer.
But I am starting to miss the high degree of intellectual challenge. So I am thinking to go back to academia. Unfortunately my Diploma grade was B (German 2), likewise the grade of my in-depth elective Theoretical Particle Physics. I think I could have done better, but my mother died of cancer during my Diploma thesis and this didn't leave much focus and time for me. Plus I started working on a Web App in the last 2 months of my studies. Other grades were better, my Math elective (Functional Analysis) was A+, likewise Theoretical Physics. My undergraduate studies' grades were mixed, between A+ and B-.
My thesis also does not look so well. Because of a lack of time it has orthographic errors, discussion of results is too short and the source code snippets in it look ugly. Once I applied for a job through a head hunter and after they saw my thesis they completely lost interest in me as a candidate.
So question: how hard is it in such a situation to apply for a PhD Programme and is it a good idea at all? What would be a good strategy when applying? I am interested in Mathematics, Theoretical Physics, Mathematical Physics or Computer Science.