In this work, we calculate the trace of a Hecke correspondance composed with a power of the Frobenius endomorphism on the fibre of the intersection complexes of the Baily-Borel compactification of a Siegel modular variety. Our main tool is Pink’s theorem about the restriction to the strata of the Baily-Borel compactification of the direct image of a local system on the Shimura variety. To use this theorem, we give a new construction of the intermediate extension of a pure perverse sheaf as a weight truncation of the full direct image. More generally, we are able to define analogs in positive characteristic of the weighted cohomology complexes introduced by Goresky, Harder and MacPherson.