Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
ca115c0
Initial implementation
HeroponRikiBestest Jan 5, 2026
1499c84
Commit to the right branch this time
HeroponRikiBestest Jan 5, 2026
be8519a
Use newtonsoft instead of System.Text.Json
HeroponRikiBestest Jan 6, 2026
9481dd5
Don't parse constant strings
HeroponRikiBestest Jan 6, 2026
e20ed73
Add comments for documentation
HeroponRikiBestest Jan 6, 2026
2e7f9e1
Add reader and wrapper tests
HeroponRikiBestest Jan 6, 2026
9f98ef3
Fix Naming
HeroponRikiBestest Jan 23, 2026
2e5c5b3
Extract Ms-cabs while reading instead of loading all datablocks into …
HeroponRikiBestest Jan 24, 2026
6bfe68b
Formatting and comment cleanup
mnadareski Jan 24, 2026
f16ed97
Support WoD info CMP block type
mnadareski Jan 24, 2026
695fc4b
Change mscab extraction to use state handling, break into more helper…
HeroponRikiBestest Jan 25, 2026
4bfaf36
Formatting cleanup
mnadareski Jan 25, 2026
7f7d0f8
Re-enable stream extraction for MScab (#58)
HeroponRikiBestest Jan 25, 2026
5dfe6ae
Convert Installshield Executable code to use proper reader/wrapper in…
HeroponRikiBestest Jan 25, 2026
2959d82
Formatting cleanup
mnadareski Jan 25, 2026
ee85a84
Use newer "is null" syntax
mnadareski Jan 25, 2026
4300d94
Use newer "is not null" syntax
mnadareski Jan 25, 2026
a35e58e
Fix some errant formatting
mnadareski Jan 25, 2026
344132b
Add editorconfig, fix issues
mnadareski Jan 25, 2026
59b918c
Apparently didn't rename this
mnadareski Jan 26, 2026
69b6595
Missed this one too
mnadareski Jan 26, 2026
527b09c
Add debug flag to interface definitions (fixes #60)
mnadareski Jan 26, 2026
ecca11e
Flush before closing in microsoftcabinet.extraction (#61)
HeroponRikiBestest Jan 26, 2026
8f8d86d
Clean up some formatting things
mnadareski Jan 27, 2026
07cc01d
Extract Ms-cabs while reading instead of loading all datablocks into …
HeroponRikiBestest Jan 24, 2026
2d751e6
Formatting and comment cleanup
mnadareski Jan 24, 2026
d4090b1
Support WoD info CMP block type
mnadareski Jan 24, 2026
e16d112
Change mscab extraction to use state handling, break into more helper…
HeroponRikiBestest Jan 25, 2026
b50ebff
Formatting cleanup
mnadareski Jan 25, 2026
7213762
Re-enable stream extraction for MScab (#58)
HeroponRikiBestest Jan 25, 2026
57765c4
Convert Installshield Executable code to use proper reader/wrapper in…
HeroponRikiBestest Jan 25, 2026
2eecbdb
Formatting cleanup
mnadareski Jan 25, 2026
27684a4
Use newer "is null" syntax
mnadareski Jan 25, 2026
8be8e69
Use newer "is not null" syntax
mnadareski Jan 25, 2026
12232fa
Fix some errant formatting
mnadareski Jan 25, 2026
2d31caa
Add editorconfig, fix issues
mnadareski Jan 25, 2026
5a37906
Apparently didn't rename this
mnadareski Jan 26, 2026
58a72f4
Missed this one too
mnadareski Jan 26, 2026
b20af52
Add debug flag to interface definitions (fixes #60)
mnadareski Jan 26, 2026
73cb695
Flush before closing in microsoftcabinet.extraction (#61)
HeroponRikiBestest Jan 26, 2026
e809bb4
Clean up some formatting things
mnadareski Jan 27, 2026
50c266b
Apply reformat
HeroponRikiBestest Jan 27, 2026
b5ca082
Initial round of fixes
HeroponRikiBestest Jan 27, 2026
74e3bb4
Initial implementation
HeroponRikiBestest Jan 5, 2026
1479f85
Commit to the right branch this time
HeroponRikiBestest Jan 5, 2026
025e4d8
Use newtonsoft instead of System.Text.Json
HeroponRikiBestest Jan 6, 2026
b5d9bd1
Don't parse constant strings
HeroponRikiBestest Jan 6, 2026
f513fe4
Add comments for documentation
HeroponRikiBestest Jan 6, 2026
10e6f66
Add reader and wrapper tests
HeroponRikiBestest Jan 6, 2026
85713ae
Fix Naming
HeroponRikiBestest Jan 23, 2026
74ae0dc
Apply reformat
HeroponRikiBestest Jan 27, 2026
bd87c5c
Initial round of fixes
HeroponRikiBestest Jan 27, 2026
e54f12f
Merge remote-tracking branch 'origin/skusis-addition' into skusis-add…
HeroponRikiBestest Jan 27, 2026
1deb04f
Fix
HeroponRikiBestest Jan 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
167 changes: 167 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
# top-most EditorConfig file
root = true

# C# files
[*.cs]

# Indentation and spacing
charset = utf-8
indent_size = 4
indent_style = space
tab_width = 4
trim_trailing_whitespace = true

# New line preferences
end_of_line = lf
insert_final_newline = true
max_line_length = unset

# using directive preferences
csharp_using_directive_placement = outside_namespace
dotnet_diagnostic.IDE0005.severity = error

# Code-block preferences
csharp_style_namespace_declarations = block_scoped
csharp_style_prefer_method_group_conversion = true
csharp_style_prefer_top_level_statements = false

# Expression-level preferences
csharp_prefer_simple_default_expression = true
csharp_style_inlined_variable_declaration = true
csharp_style_unused_value_assignment_preference = discard_variable
csharp_style_unused_value_expression_statement_preference = discard_variable
dotnet_diagnostic.IDE0001.severity = warning
dotnet_diagnostic.IDE0002.severity = warning
dotnet_diagnostic.IDE0004.severity = warning
dotnet_diagnostic.IDE0010.severity = error
dotnet_diagnostic.IDE0051.severity = warning
dotnet_diagnostic.IDE0052.severity = warning
dotnet_diagnostic.IDE0072.severity = warning
dotnet_diagnostic.IDE0080.severity = warning
dotnet_diagnostic.IDE0100.severity = error
dotnet_diagnostic.IDE0110.severity = error
dotnet_diagnostic.IDE0120.severity = warning
dotnet_diagnostic.IDE0121.severity = warning
dotnet_diagnostic.IDE0240.severity = error
dotnet_diagnostic.IDE0241.severity = error
dotnet_style_coalesce_expression = true
dotnet_style_namespace_match_folder = false
dotnet_style_null_propagation = true
dotnet_style_prefer_auto_properties = true
dotnet_style_prefer_collection_expression = when_types_loosely_match
dotnet_style_prefer_is_null_check_over_reference_equality_method = true
dotnet_style_prefer_compound_assignment = true
csharp_style_prefer_simple_property_accessors = true
dotnet_style_prefer_simplified_interpolation = true
dotnet_style_prefer_simplified_boolean_expressions = true
csharp_style_prefer_unbound_generic_type_in_nameof = true

# Field preferences
dotnet_diagnostic.IDE0044.severity = warning
dotnet_style_readonly_field = true

# Language keyword vs. framework types preferences
dotnet_diagnostic.IDE0049.severity = error
dotnet_style_predefined_type_for_locals_parameters_members = true
dotnet_style_predefined_type_for_member_access = true

# Modifier preferences
csharp_prefer_static_local_function = true
csharp_style_prefer_readonly_struct = true
dotnet_diagnostic.IDE0036.severity = warning
dotnet_diagnostic.IDE0040.severity = error
dotnet_diagnostic.IDE0380.severity = error
dotnet_style_require_accessibility_modifiers = always

# New-line preferences
dotnet_diagnostic.IDE2000.severity = warning
dotnet_diagnostic.IDE2002.severity = warning
dotnet_diagnostic.IDE2003.severity = warning
dotnet_diagnostic.IDE2004.severity = warning
dotnet_diagnostic.IDE2005.severity = warning
dotnet_diagnostic.IDE2006.severity = warning
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = false
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = false
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = false
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false
dotnet_style_allow_multiple_blank_lines_experimental = false
dotnet_style_allow_statement_immediately_after_block_experimental = false

# Null-checking preferences
csharp_style_conditional_delegate_call = true

# Parameter preferences
dotnet_code_quality_unused_parameters = all
dotnet_diagnostic.IDE0280.severity = error

# Parentheses preferences
dotnet_diagnostic.IDE0047.severity = warning
dotnet_diagnostic.IDE0048.severity = warning
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
dotnet_style_parentheses_in_other_operators = always_for_clarity
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity

# Pattern-matching preferences
dotnet_diagnostic.IDE0019.severity = warning
dotnet_diagnostic.IDE0020.severity = warning
dotnet_diagnostic.IDE0038.severity = warning
dotnet_diagnostic.IDE0066.severity = none
dotnet_diagnostic.IDE0083.severity = warning
dotnet_diagnostic.IDE0260.severity = warning
csharp_style_pattern_matching_over_as_with_null_check = true
csharp_style_pattern_matching_over_is_with_cast_check = true
csharp_style_prefer_not_pattern = true
csharp_style_prefer_pattern_matching = true

# this. and Me. preferences
dotnet_style_qualification_for_event = false
dotnet_style_qualification_for_field = false
dotnet_style_qualification_for_method = false
dotnet_style_qualification_for_property = false

# var preferences
csharp_style_var_for_built_in_types = false
csharp_style_var_when_type_is_apparent = true

# .NET formatting options
dotnet_separate_import_directive_groups = false
dotnet_sort_system_directives_first = true

# C# formatting options
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = false
csharp_indent_labels = one_less_than_current
csharp_indent_switch_labels = true
csharp_new_line_before_catch = true
csharp_new_line_before_else = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_open_brace = all
csharp_new_line_between_query_expression_clauses = true
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = true
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_after_semicolon_in_for_statement = true
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false
2 changes: 1 addition & 1 deletion ExtractionTool/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static void Main(string[] args)
var commandSet = CreateCommands(mainFeature);

// If we have no args, show the help and quit
if (args == null || args.Length == 0)
if (args is null || args.Length == 0)
{
commandSet.OutputAllHelp();
return;
Expand Down
32 changes: 16 additions & 16 deletions InfoPrint/Features/MainFeature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ private void PrintFileInfo(string file)
if (Hash)
{
var hashBuilder = PrintHashInfo(file);
if (hashBuilder != null)
if (hashBuilder is not null)
{
// Create the output data
string hashData = hashBuilder.ToString();
Expand Down Expand Up @@ -172,7 +172,7 @@ private void PrintFileInfo(string file)
var wrapper = WrapperFactory.CreateWrapper(ft, stream);

// If we don't have a wrapper
if (wrapper == null)
if (wrapper is null)
{
Console.WriteLine($"Either {ft} is not supported or something went wrong during parsing!");
Console.WriteLine();
Expand All @@ -195,7 +195,7 @@ private void PrintFileInfo(string file)

// Create the output data
var builder = wrapper.ExportStringBuilder();
if (builder == null)
if (builder is null)
{
Console.WriteLine("No item information could be generated");
return;
Expand Down Expand Up @@ -235,37 +235,37 @@ private void PrintFileInfo(string file)
{
// Get all file hashes for flexibility
var hashes = HashTool.GetFileHashes(file);
if (hashes == null)
if (hashes is null)
{
if (Debug) Console.WriteLine($"Hashes for {file} could not be retrieved");
return null;
}

// Output subset of available hashes
var builder = new StringBuilder();
if (hashes.TryGetValue(HashType.CRC16, out string? crc16) && crc16 != null)
if (hashes.TryGetValue(HashType.CRC16, out string? crc16) && crc16 is not null)
builder.AppendLine($"CRC-16 checksum: {crc16}");
if (hashes.TryGetValue(HashType.CRC32, out string? crc32) && crc32 != null)
if (hashes.TryGetValue(HashType.CRC32, out string? crc32) && crc32 is not null)
builder.AppendLine($"CRC-32 checksum: {crc32}");
if (hashes.TryGetValue(HashType.CRC64, out string? crc64) && crc64 != null)
if (hashes.TryGetValue(HashType.CRC64, out string? crc64) && crc64 is not null)
builder.AppendLine($"CRC-64 checksum: {crc64}");
if (hashes.TryGetValue(HashType.MD2, out string? md2) && md2 != null)
if (hashes.TryGetValue(HashType.MD2, out string? md2) && md2 is not null)
builder.AppendLine($"MD2 hash: {md2}");
if (hashes.TryGetValue(HashType.MD4, out string? md4) && md4 != null)
if (hashes.TryGetValue(HashType.MD4, out string? md4) && md4 is not null)
builder.AppendLine($"MD4 hash: {md4}");
if (hashes.TryGetValue(HashType.MD5, out string? md5) && md5 != null)
if (hashes.TryGetValue(HashType.MD5, out string? md5) && md5 is not null)
builder.AppendLine($"MD5 hash: {md5}");
if (hashes.TryGetValue(HashType.RIPEMD128, out string? ripemd128) && ripemd128 != null)
if (hashes.TryGetValue(HashType.RIPEMD128, out string? ripemd128) && ripemd128 is not null)
builder.AppendLine($"RIPEMD-128 hash: {ripemd128}");
if (hashes.TryGetValue(HashType.RIPEMD160, out string? ripemd160) && ripemd160 != null)
if (hashes.TryGetValue(HashType.RIPEMD160, out string? ripemd160) && ripemd160 is not null)
builder.AppendLine($"RIPEMD-160 hash: {ripemd160}");
if (hashes.TryGetValue(HashType.SHA1, out string? sha1) && sha1 != null)
if (hashes.TryGetValue(HashType.SHA1, out string? sha1) && sha1 is not null)
builder.AppendLine($"SHA-1 hash: {sha1}");
if (hashes.TryGetValue(HashType.SHA256, out string? sha256) && sha256 != null)
if (hashes.TryGetValue(HashType.SHA256, out string? sha256) && sha256 is not null)
builder.AppendLine($"SHA-256 hash: {sha256}");
if (hashes.TryGetValue(HashType.SHA384, out string? sha384) && sha384 != null)
if (hashes.TryGetValue(HashType.SHA384, out string? sha384) && sha384 is not null)
builder.AppendLine($"SHA-384 hash: {sha384}");
if (hashes.TryGetValue(HashType.SHA512, out string? sha512) && sha512 != null)
if (hashes.TryGetValue(HashType.SHA512, out string? sha512) && sha512 is not null)
builder.AppendLine($"SHA-512 hash: {sha512}");

return builder;
Expand Down
2 changes: 1 addition & 1 deletion InfoPrint/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static void Main(string[] args)
var commandSet = CreateCommands(mainFeature);

// If we have no args, show the help and quit
if (args == null || args.Length == 0)
if (args is null || args.Length == 0)
{
commandSet.OutputAllHelp();
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public void RoundTripTest()
Data.Models.ArchiveDotOrg.Files files = Build();

// Serialize to generic model
SabreTools.Data.Models.Metadata.MetadataFile? metadata = serializer.Serialize(files);
Data.Models.Metadata.MetadataFile? metadata = serializer.Serialize(files);
Assert.NotNull(metadata);

// Serialize back to original model
Expand Down
19 changes: 19 additions & 0 deletions SabreTools.Serialization.Test/CrossModel/ClrMameProTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public void RoundTripGameTest()
Assert.NotNull(newMf.Game);
var newGame = Assert.Single(newMf.Game);
Validate(newGame);
Validate(newMf.Info);
}

[Fact]
Expand All @@ -51,6 +52,7 @@ public void RoundTripMachineTest()
Assert.NotNull(newMf.Game);
var newGame = Assert.Single(newMf.Game);
Validate(newGame);
Validate(newMf.Info);
}

/// <summary>
Expand Down Expand Up @@ -229,10 +231,16 @@ private static Data.Models.ClrMamePro.MetadataFile Build(bool game)
gameBase.DipSwitch = [dipswitch];
gameBase.Driver = driver;

var info = new Data.Models.ClrMamePro.Info
{
Source = ["XXXXXX"],
};

return new Data.Models.ClrMamePro.MetadataFile
{
ClrMamePro = cmp,
Game = [gameBase],
Info = info,
};
}

Expand Down Expand Up @@ -501,5 +509,16 @@ private static void Validate(Data.Models.ClrMamePro.Driver? driver)
Assert.Equal("XXXXXX", driver.PaletteSize);
Assert.Equal("XXXXXX", driver.Blit);
}

/// <summary>
/// Validate a ClrMamePro
/// </summary>
private static void Validate(Data.Models.ClrMamePro.Info? info)
{
Assert.NotNull(info);
Assert.NotNull(info.Source);
string source = Assert.Single(info.Source);
Assert.Equal("XXXXXX", source);
}
}
}
4 changes: 3 additions & 1 deletion SabreTools.Serialization.Test/CrossModel/HashfileTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ public void RoundTripSpamSumTest()
/// </summary>
private static Data.Models.Hashfile.Hashfile Build(HashType hashType)
{
#pragma warning disable IDE0072
return hashType switch
{
HashType.CRC32 => new Data.Models.Hashfile.Hashfile { SFV = [new Data.Models.Hashfile.SFV { File = "XXXXXX", Hash = "XXXXXX" }] },
Expand All @@ -230,8 +231,9 @@ private static Data.Models.Hashfile.Hashfile Build(HashType hashType)
HashType.SHA384 => new Data.Models.Hashfile.Hashfile { SHA384 = [new Data.Models.Hashfile.SHA384 { Hash = "XXXXXX", File = "XXXXXX" }] },
HashType.SHA512 => new Data.Models.Hashfile.Hashfile { SHA512 = [new Data.Models.Hashfile.SHA512 { Hash = "XXXXXX", File = "XXXXXX" }] },
HashType.SpamSum => new Data.Models.Hashfile.Hashfile { SpamSum = [new Data.Models.Hashfile.SpamSum { Hash = "XXXXXX", File = "XXXXXX" }] },
_ => throw new ArgumentOutOfRangeException(),
_ => throw new ArgumentOutOfRangeException(nameof(hashType)),
};
#pragma warning restore IDE0072
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using SabreTools.Data.Models.ASN1;
using Xunit;

#pragma warning disable IDE0230 // Use UTF-8 string literal
namespace SabreTools.Serialization.Test.Extensions
{
public class TypeLengthValueTests
Expand Down Expand Up @@ -31,7 +32,7 @@ public void Format_ZeroLength()
public void Format_InvalidConstructed()
{
string expected = "Type: V_ASN1_OBJECT, V_ASN1_CONSTRUCTED, Length: 1, Value: [INVALID DATA TYPE]";
var tlv = new Data.Models.ASN1.TypeLengthValue { Type = ASN1Type.V_ASN1_OBJECT | ASN1Type.V_ASN1_CONSTRUCTED, Length = 1, Value = (object?)false };
var tlv = new Data.Models.ASN1.TypeLengthValue { Type = ASN1Type.V_ASN1_OBJECT | ASN1Type.V_ASN1_CONSTRUCTED, Length = 1, Value = false };
string actual = tlv.Format();
Assert.Equal(expected, actual);
}
Expand All @@ -50,7 +51,7 @@ public void Format_ValidConstructed()
public void Format_InvalidDataType()
{
string expected = "Type: V_ASN1_OBJECT, Length: 1, Value: [INVALID DATA TYPE]";
var tlv = new Data.Models.ASN1.TypeLengthValue { Type = ASN1Type.V_ASN1_OBJECT, Length = 1, Value = (object?)false };
var tlv = new Data.Models.ASN1.TypeLengthValue { Type = ASN1Type.V_ASN1_OBJECT, Length = 1, Value = false };
string actual = tlv.Format();
Assert.Equal(expected, actual);
}
Expand Down
Loading