File tree Expand file tree Collapse file tree 1 file changed +10
-14
lines changed
BinaryObjectScanner/Protection Expand file tree Collapse file tree 1 file changed +10
-14
lines changed Original file line number Diff line number Diff line change 22using System . Collections . Generic ;
33using System . Text ;
44using BinaryObjectScanner . Interfaces ;
5+ using SabreTools . Data . Models . PKZIP ;
56using SabreTools . IO ;
67using SabreTools . IO . Extensions ;
78using SabreTools . IO . Matching ;
@@ -277,23 +278,18 @@ public List<string> CheckDirectoryPath(string path, List<string>? files)
277278 if ( ! found )
278279 return null ;
279280
280- // Read the version starting 4 bytes after the signature
281- index += 8 ;
282- char major = ( char ) overlayData [ index ] ;
283- index += 2 ;
284-
285- string minor = Encoding . ASCII . GetString ( overlayData , index , 2 ) ;
286- index += 3 ;
287-
288- string patch = Encoding . ASCII . GetString ( overlayData , index , 2 ) ;
289- index += 3 ;
290-
291- string revision = Encoding . ASCII . GetString ( overlayData , index , 4 ) ;
281+ // Deserialize the AddD header
282+ var reader = new SabreTools . Serialization . Readers . SecuROMAddD ( ) ;
283+ var addD = reader . Deserialize ( overlayData , index ) ;
284+ if ( addD == null )
285+ return null ;
292286
293- if ( ! char . IsNumber ( major ) )
287+ // Format the version
288+ string version = $ "{ addD . Version } .{ addD . Build } ";
289+ if ( ! char . IsNumber ( version [ 0 ] ) )
294290 return "(very old, v3 or less)" ;
295291
296- return $ " { major } . { minor } . { patch } . { revision } " ;
292+ return version ;
297293 }
298294
299295 /// <summary>
You can’t perform that action at this time.
0 commit comments