Hafeez, Afridi propel Pakistan to 293