In fw_all.bin, my code does the same as you've described.
But to change the FW version does not only mean to change it in fw_all.bin, but also in all other subfiles in GCD container.
So it's necessary to enumerate them all and to change their headers in GCD.