So when I flashed my phone the GDFS got overwritten since my old security code is also not working.

Who uploaded the firmwares by the way? Perhaps he/she would know the correct security code embedded in the firmware.