SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > Silent Hunter III
Forget password? Reset here

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 04-03-24, 03:37 AM   #7
Hooston
Medic
 
Join Date: Jun 2020
Posts: 159
Downloads: 15
Uploads: 0
Default wild guesses

See this on GWX but not on NYGM, which has shorter messages.
Never delved into SH3 code, but it looks like a buffer overflow.
At some point the game reads in the mission startup text from a file and sticks it in an area of memory. It saves the address of the start of this to use later. This "buffer" is not big enough for GWX, so either the program keeps writing over the next chunk of memory or it correctly stops reading when the buffer end is reached but the coder has forgotten to add a "null" character to signal the end of the string.
There's a slight chance it is caused by a consistent typo in the GWX campaign file, like missing quotation marks, in which case it would be an easy fix. I have no idea where these messages are loaded from, so I can't check them or compare with NYGM. Any ideas?
At some point the game saves the latest save game filename, which happens to be after the mission startup text in memory. This ends with a null character to show the end of the string.
When the game wants to display the startup text it says "output text starting at this address and ending in a null character" so you get the startup text and then whatever is after it until a zero byte is reached - which just happens to be the latest save game fileneme.
It's just luck that this does not cause a crash, but then if it caused a crash it would have been caught during testing. This is the sort of horrible hidden bug that leaps out and bites you on the bum years later.

Unless of course the Allied situation really was un220424...

Last edited by Hooston; 04-03-24 at 04:22 AM.
Hooston is offline   Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 10:31 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 1995- 2024 Subsim®
"Subsim" is a registered trademark, all rights reserved.