At lunch, Pakistan were 72 for one in reply to England's first innings 297 -- a deficit of 225 runs.
Aslam, playing his first match of the series, was 27 not out and Azhar 38 not out after Hafeez had fallen for a fourth-ball duck to leave Pakistan none for one.
Pakistan suffered a setback just four balls into their innings on Thursday when Hafeez lazily guided a short and wide delivery from James Anderson straight to Gary Ballance at point.
Now all eyes were on Aslam, also playing just his third Test, after the 20-year-old had been brought in to replace struggling opener Shan Masood.
Left-hander Aslam guided Stuart Broad wide of gully for the first four of Pakistan's innings in the fifth over.
His only prior innings this tour had seen Aslam make just 17 against Worcestershire last week in a two-day warm-up match.
Azhar showed his class by calmly turning Anderson off his legs for four.
And when all-rounder Chris Woakes overpitched on his Warwickshire home ground, Azhar elegantly drove him through the covers for another boundary.
The stylish 31-year-old was equally severe when fast bowler Steven Finn dropped short, cutting him for four over point to bring up a fifty partnership with Aslam in 21 overs.
Off-spinner Moeen Ali received similar treatment, with Azhar cutting a rank short ball for four.
Yesterday saw Sohail justify both his inclusion, and Pakistan captain Misbah-ul-Haq's decision to field first, by taking a Test-best five for 96.
