The structural identification of shallow defects and the control of their concentration is one of the key ingredients in semiconductor technology. Electron paramagnetic resonance (EPR) is the most sensitive experimental technique to address this problem, but requires comparative theoretical simulation of the microscopic structures. Whereas the standard supercell approach provides an accurate first principles analysis of localized deep defects, the wave function of shallow dopants often extends over several thousands of atoms and has to be treated in an empirical one-particle approach, the effective mass approximation (EMA). We report that modelling the shallow defects via a Green's functions approach allows an ab inito description of the so-called central-cell correction to EMA that accounts for the specific local part of the potential. The spatial distribution of the donor wave functions comes out within an accuracy that allows a prediction of hyperfine interactions including the Kohn-Luttinger oscillations within the ligand hyperfine structure -an effect that in quantum computing plays a key role in the control of the exchange coupling of qubits in semiconductors. For phosphorus in silicon, we show that in strained material these Kohn-Luttinger oscillations are partially suppressed. Our results indicate that in contrast to the prediction of the EMA, there exists no high-stress limit for the reduction of the central P-related hf splitting. The application of the approach onto donors in SiC confirms an incorporation of the P atoms onto both, the silicon as well as the carbon sublattice, if the donors are incorporated far away from thermal equilibrium.