The Nuremburg Principles declared such wars a crime against peace.
The crimes hereinafter set out are punishable as crimes under international law:
(a) Crimes against peace:
(i) Planning, preparation, initiation or waging of a war of aggression or a war in violation of international treaties, agreements or assurances
This was codified by the International Law Commission at the behest of the United Nations General Assembly in 1950 as the Principles of International Law Recognized in the Charter of the Nüremberg Tribunal and in the Judgment of the Tribunal. However, it is based on the activities and findings of the International Military Tribunal between 1945-6, which is itself concerned with the crimes of the Nazis committed up to and including 1945.
Customary international law does not need to be codified, but are instead general principles accepted by the international community. The fact that such rulings were made in 1945 shows that by that point, the international consensus was that aggressive wars are no longer allowed.
Therefore it is accurate to say that international law had changed by 1945. Moreover, this change was at least two decades in the making. A significant previous milestone was the General Treaty for Renunciation of War as an Instrument of National Policy of 1928.