Bake a premade pie crust according to the directions.
Beat the egg yolks in a small bowl.
Add the sugar to a large mixing bowl.
Next, add the egg yolks to the sugar and mix.
Add the unsweetened cocoa, cornstarch, and salt and mix well.
Pour the milk into the bowl and mix until the lumps are gone.
Add the butter to a medium saucepan on medium heat.
Next, pour the chocolate filling into the saucepan and cook until thick and boiling, stirring often with a whisk.
Add the vanilla extract and mix.
Remove from heat and allow it to cool for a few minutes.
Pour the filling into the pie crust and refrigerate until cool.
Top with whipped topping.