In this work the characterization of CMOS diodes with Electron Beam Induced Current (EBIC) measurements in a Scanning Electron Microscope (SEM) are presented. Three-dimensional Technology Computer Aided Design (TCAD) simulations of the EBIC measurement were performed for the first time to help interpret the experimental results. The TCAD simulations provide direct access to the spatial distribution of physical quantities (like mobility, lifetime etc.) which are very difficult to obtain experimentally. For the calibration of the simulation to the experiments, special designs of vertical p-n diodes were fabricated. These structures were investigated with respect to doping concentration, beam energy, and biasing. A strong influence of the surface preparation on the measurements and the extracted diffusion lengths are shown.