Proving P=NP would not necessarily give you an algorithm, because there are many different methods to prove something (i.e. Direct proof, Proof by contradiction, etc.).
But it is shown that if you were to find ana polynomial time algorithm to solve a NP-problemcomplete problem that you could modify that algorithm to solve all NP-problems, including the Integer factorization problem.