Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! 2.6/7 » The Bar » New (?) Stars! Bug: 32k orders
New (?) Stars! Bug: 32k orders Wed, 13 May 2020 14:20 Go to next message
ricks03 is currently offline ricks03

 
Chief Warrant Officer 3

Messages: 196
Registered: January 2012
Location: NC
I've been trying to untangle the Stars! blocks, and have found a bug I don't think I've seen reported before.

The .x file is blocks of orders. I've been trying to add/remove blocks from my .x file but always having the file corrupt. I tracked the issue down to Block 9.

Block 9 is the FileHashblock. The first two bytes are a checksum for the .x file. Each block in the file (typically one "order") is summed for this checksum, where the value of a block is the number of bytes in the block (which is also the two bytes of the header + the number of bytes that are decrypted).

Two bytes means the checksum can be a maximum of 32767 (which if you're trying you can reach quickly by splitting and merging large fleets).

When the checksum reaches 32767 (ish) you get a warning: "Log file has reached the maximum allowable size. Commands will not be recorded."

If you happen to be, perhaps, stressing the limits of this by splitting and merging fleets such that you've submitted far more orders, you will be warned again but then Stars! will crash. In my case with "STARS! caused a General Protection Fault in module STARS.EXE at 0024:0ED0. Chose close. STARS! will close. "

The .x file itself isn't corrupted, just stopped saving changes just before the last save. If you haven't saved at all, you won't have a .x file. And if somehow you've submitted some 30000 orders, you'll be sad.



https://www.irelandbybicycle.com
http://totalhost.sinister.net:999
https://github.com/ricks03/TotalHost

Report message to a moderator

Re: New (?) Stars! Bug: 32k orders Tue, 14 July 2020 05:31 Go to previous messageGo to next message
russl5445 is currently offline russl5445

 
Crewman 3rd Class

Messages: 5
Registered: September 2008
Location: Tucson, AZ
I didn't realize that anybody was doing ongoing work to decode the Stars! files ... I thought I was the only one. Smile

I was just looking at the FileHashBlock last night, and the conclusion I came to is basically the same as you: that the first 2 bytes hold the length of the section(s) that follow. I wouldn't call that a "checksum," but that's just semantics. Smile

My assumption is that this was to solve races when a client might be trying to write out an update .X file, and the host might be looking for one. If the file length doesn't match the value predicted right up near the top of the file, then the host knows not to use the file (yet). I did some (very) quick experiments, and it seems like the rest of the block (15 bytes more) are constant - at least on a single machine. They seem not to change from turn to turn, or game to game. (Though I haven't done extensive testing yet.) I'm guessing that this must be where the "machine fingerprint" is stored.

Report message to a moderator

! Tue, 18 May 2021 04:35 Go to previous messageGo to next message
ricks03 is currently offline ricks03

 
Chief Warrant Officer 3

Messages: 196
Registered: January 2012
Location: NC
Thanks! I was thinking about the .x checksum (semantics!) being the next thing I needed to dig back into. I think I have the basics of building/checking the fingerprint, but I wasn't thinking about it in this context. That would be a problem tho if I wanted to build a .x file on a different machine. But if it's always the same, then I could probably strip it out of an earlier .x file. Knowing it's likely the fingerprint hopefully helps prevent me from making the mistake of assuming it's the same for everyone.

What I want is a way to create a .x file. Not because I want to write automation (a cool project for someone else) but because I want to create another path for getting back into a Stars! game. Create a .x file with a password reset included (which is also proof of concept that I _can_ modify/add/change .x files). Also the ability to strip a password change completely out of an .x file, so a host can prevent someone from locking up a game that's not supposed to be locked.

(And thanks for your work on the .r file checksum - it was the key for us figuring it out).



https://www.irelandbybicycle.com
http://totalhost.sinister.net:999
https://github.com/ricks03/TotalHost

Report message to a moderator

Re: ! Wed, 19 May 2021 00:32 Go to previous message
ricks03 is currently offline ricks03

 
Chief Warrant Officer 3

Messages: 196
Registered: January 2012
Location: NC
Looking at those 15 bytes...

For games hosted on TH, that I played on TH, it looks like my .x files across games have the same 15 bytes.
StarsByte.pl "d:\seasons\2410\SEASONS.X7"
BLOCK:9,Offset:18,Bytes:17 DATA DECRYPTED:98 1 231 7 52 2 165 220 166 89 122 197 97 8 0 0 170

Other players (playing on their own machines) each have a different 15 bytes on their .x file.

But they're not completely different, the last 5 bytes are the same:
StarsByte.pl "d:\seasons\2410\SEASONS.X2" 
BLOCK:9,Offset:18,Bytes:17      DATA DECRYPTED:62  0 179  59  52   2 165 220 166 89 122 197   165 220 166 122 160

StarsByte.pl "d:\seasons\2410\SEASONS.X3" 
BLOCK:9,Offset:18,Bytes:17      DATA DECRYPTED:  0 0  34 155 120   0  82  19  0   0   0   0   165 220 166 122 160

StarsByte.pl "d:\seasons\2410\SEASONS.X4" 
BLOCK:9,Offset:18,Bytes:17      DATA DECRYPTED:104 0 235   8  52   2 165 220 166 89 122 197   165 220 166 122 160

StarsByte.pl "d:\seasons\2410\SEASONS.X5" 
BLOCK:9,Offset:18,Bytes:17      DATA DECRYPTED: 86 5 68   67  52   2 165 220 166 89 122 197   165 220 166 122 160

StarsByte.pl "d:\seasons\2410\SEASONS.X6" 
BLOCK:9,Offset:18,Bytes:17      DATA DECRYPTED:112 2 148 109 103   0  96  88  16 73   0   0 165 220 166 122 160


The other players are each playing on their own systems. But three of them 7 bytes match! Weird.


[Updated on: Wed, 19 May 2021 00:34]




https://www.irelandbybicycle.com
http://totalhost.sinister.net:999
https://github.com/ricks03/TotalHost

Report message to a moderator

Previous Topic: rec.games.computer.stars or yahoo groops
Next Topic: Stars! Official Strategy Guide - uptodate links to other sites
Goto Forum:
  


Current Time: Tue Jun 22 09:38:52 EDT 2021