I don't know how you would hack the save file since I generally start a new career instead, my experience with hacking save files is that it sometimes works without crashing, then when you return to port and start a new patrol the game resets to default or even screws it up so you have no deck gun at all.
Look at this again;
http://www.subsim.com/radioroom/show...8&postcount=22
For the GATO class the deck gun upgrade is listed (in stock game, dunno about TMO, RSRDC, or RFB since I don't use them) as;
[UserPlayerUnit 1.UpgradePackSlot 3]
ID= UpgDeckGun
NameDisplayable= Deck Gun
Type=NULL
AcceptedTypes=USDeckGunBasic, USDeckGunAdv
UserCustomizable=Yes
IDLinkUpgradePackSlots= BowDeckGun, SternDeckGun
IDLinkUpgradePackSlotsIntervalDefault1= NULL, 1942-12-31, Upack3in50calDGStern
IDLinkUpgradePackSlotsIntervalDefault2= 1943-01-01, 1943-12-31, Upack3in50calDGBow
IDLinkUpgradePackSlotsIntervalDefault3= 1944-01-01, 1944-08-19, Upack4in50calDGBow
IDLinkUpgradePackSlotsIntervalDefault4= 1944-08-20, NULL, Upack5in25calDGBow
So what you're looking at there is the 4 inch 50 isn't available at all in stock until New Years Day 1944. Change them all to Upack4in50calDGBow (or 5 inch 25 if you prefer) or change all the dates to NULL so you can pick whatever you want whenever. Then delete all your save game files and start a new career, otherwise you'll be dealing with more complication.