Preheat your oven to 350°F (175°C) and grease a 9x13 inch baking pan.
In a large bowl, melt the butter and mix in the granulated sugar until well combined.
Add in the eggs, one at a time, mixing well after each addition. Stir in the vanilla extract.
Sift together the flour and cocoa powder, then fold into the wet mixture until just combined.
In a separate bowl, combine the shredded kunafa dough with melted butter and sugar.
Spread half of the brownie batter evenly in the greased pan, then layer the kunafa mixture on top.
Sprinkle the chopped pistachios over the kunafa layer and then cover with the remaining brownie batter.
Bake for about 30-35 minutes, or until a toothpick inserted in the center comes out with moist crumbs.
Let the brownies cool completely in the pan before cutting into squares.