Brook's century guides England home in chase of 165, with Pakistan staring at the prospect of a tournament exit.