File magic for Hugo executables

Does anyone here have anything on file magic for identifying Hugo executables? I’m trying to figure out something to cleanly distinguish between these and other random binaries.

Unfortunately, Hugo doesn’t use a file header. Byte 0 is the required engine version, and that’s about it. After that, the various tables are stored which differ between games.

If you want to take a look yourself, the code that loads game files is in:

in the LoadGame() function.

Looking at the compiler source, in hcpass.c, it appears that the 4th through 11th characters in the file contain a date in the following format “%m-%d-%y” so you might be able to match on that. It also looks like the two characters before that are either “$$” for an intermediate link file, or two random characters in the range of 0 to 127. Not sure if that is enough to uniquely identify the file.

1 Like

This seems to work for some hugo files I have laying around…

#Hugo files
5   byte    45
>8   byte    45
>>3     regex [0-1][0-9]-[0-3][0-9]-[0-9][0-9]
>>>1 beshort&0x8080 0
>>>5 byte 45 Hugo game file
>>>0 byte/10 x  version %d.
>>>0 byte%10 x  \b%d
>>>3 string >\0 Date %.8s