From 622f36b056f1b658802b5dc88b88cd4a3ed3aeb7 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Wed, 13 Nov 2024 04:26:24 -0500 Subject: [PATCH] Add .NET 9 to target frameworks --- .github/workflows/build_nupkg.yml | 2 +- .github/workflows/build_programs.yml | 6 +- .github/workflows/check_pr.yml | 2 +- .vscode/launch.json | 4 +- .../BinaryObjectScanner.csproj | 188 ++++++++++-------- BinaryObjectScanner/FileType/LDSCRYPT.cs | 2 +- BinaryObjectScanner/FileType/PLJ.cs | 2 +- .../FileType/RealArcadeInstaller.cs | 2 +- .../FileType/RealArcadeMezzanine.cs | 2 +- BinaryObjectScanner/FileType/SFFS.cs | 2 +- BinaryObjectScanner/Scanner.cs | 2 +- ExtractionTool/ExtractionTool.csproj | 48 ++--- ProtectionScan/ProtectionScan.csproj | 40 ++-- publish-nix.sh | 12 +- publish-win.ps1 | 12 +- 15 files changed, 170 insertions(+), 156 deletions(-) diff --git a/.github/workflows/build_nupkg.yml b/.github/workflows/build_nupkg.yml index 23b274bf..5fb9939b 100644 --- a/.github/workflows/build_nupkg.yml +++ b/.github/workflows/build_nupkg.yml @@ -16,7 +16,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.x + dotnet-version: 9.0.x - name: Restore dependencies run: dotnet restore diff --git a/.github/workflows/build_programs.yml b/.github/workflows/build_programs.yml index 84a7bcf7..51be173e 100644 --- a/.github/workflows/build_programs.yml +++ b/.github/workflows/build_programs.yml @@ -12,7 +12,7 @@ jobs: matrix: project: [ExtractionTool, ProtectionScan] runtime: [win-x86, win-x64, win-arm64, linux-x64, linux-arm64, osx-x64] - framework: [net8.0] #[net20, net35, net40, net452, net472, net48, netcoreapp3.1, net5.0, net6.0, net7.0, net8.0] + framework: [net9.0] #[net20, net35, net40, net452, net472, net48, netcoreapp3.1, net5.0, net6.0, net7.0, net8.0, net9.0] conf: [Debug] #[Release, Debug] steps: @@ -23,13 +23,13 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.x + dotnet-version: 9.0.x - name: Restore dependencies run: dotnet restore - name: Build - run: dotnet publish ${{ matrix.project }}/${{ matrix.project }}.csproj -f ${{ matrix.framework }} -r ${{ matrix.runtime }} -c ${{ matrix.conf == 'Release' && 'Release -p:DebugType=None -p:DebugSymbols=false' || 'Debug'}} --self-contained true --version-suffix ${{ github.sha }} ${{ (startsWith(matrix.framework, 'net5') || startsWith(matrix.framework, 'net6') || startsWith(matrix.framework, 'net7') || startsWith(matrix.framework, 'net8')) && '-p:PublishSingleFile=true' || ''}} + run: dotnet publish ${{ matrix.project }}/${{ matrix.project }}.csproj -f ${{ matrix.framework }} -r ${{ matrix.runtime }} -c ${{ matrix.conf == 'Release' && 'Release -p:DebugType=None -p:DebugSymbols=false' || 'Debug'}} --self-contained true --version-suffix ${{ github.sha }} ${{ (startsWith(matrix.framework, 'net5') || startsWith(matrix.framework, 'net6') || startsWith(matrix.framework, 'net7') || startsWith(matrix.framework, 'net8') || startsWith(matrix.framework, 'net9')) && '-p:PublishSingleFile=true' || ''}} - name: Archive build run: | diff --git a/.github/workflows/check_pr.yml b/.github/workflows/check_pr.yml index bba92af8..fad7fe24 100644 --- a/.github/workflows/check_pr.yml +++ b/.github/workflows/check_pr.yml @@ -11,7 +11,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.x + dotnet-version: 9.0.x - name: Build run: dotnet build \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index 57c2cdf4..912c395b 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,7 +10,7 @@ "request": "launch", "preLaunchTask": "build", // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/ProtectionScan/bin/Debug/net8.0/ProtectionScan.dll", + "program": "${workspaceFolder}/ProtectionScan/bin/Debug/net9.0/ProtectionScan.dll", "args": [], "cwd": "${workspaceFolder}/ProtectionScan", // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console @@ -23,7 +23,7 @@ "request": "launch", "preLaunchTask": "build", // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/ExtractionTool/bin/Debug/net8.0/ExtractionTool.dll", + "program": "${workspaceFolder}/ExtractionTool/bin/Debug/net9.0/ExtractionTool.dll", "args": [], "cwd": "${workspaceFolder}/ExtractionTool", // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console diff --git a/BinaryObjectScanner/BinaryObjectScanner.csproj b/BinaryObjectScanner/BinaryObjectScanner.csproj index cb73b5ed..ff6ca280 100644 --- a/BinaryObjectScanner/BinaryObjectScanner.csproj +++ b/BinaryObjectScanner/BinaryObjectScanner.csproj @@ -1,97 +1,111 @@ - - - net20;net35;net40;net452;net462;net472;net48;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 - win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64 - true - false - false - latest - enable - true - true - 3.1.16 - - CS0162;CS0612;CS8600;CS8601;CS8602;CS8603;CS8604;CS8605;CS8618;CS8625;CS8634;CS8765;IL3000;NU5100 - - - Matt Nadareski - Protection scanning library - Copyright (c)2018-2024 Matt Nadareski - https://github.com/SabreTools/ - https://github.com/SabreTools/BinaryObjectScanner - git - protection copy-protection scanning packer - MIT - + + + net20;net35;net40;net452;net462;net472;net48;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0 + true + false + false + latest + enable + true + true + 3.1.16 + + CS0162;CS0612;CS8600;CS8601;CS8602;CS8603;CS8604;CS8605;CS8618;CS8625;CS8634;CS8765;IL3000;NU5100 - - - $(DefineConstants);WIN - + + Matt Nadareski + Protection scanning library + Copyright (c)2018-2024 Matt Nadareski + https://github.com/SabreTools/ + https://github.com/SabreTools/BinaryObjectScanner + git + protection copy-protection scanning packer + MIT + - - - - $(DefaultItemExcludes); - **\AssemblyInfo.cs; - _EXTERNAL\LessIO\src\LessIO.Tests\**; - _EXTERNAL\libmspack4n\lib\**; - _EXTERNAL\libmspack4n\libmspack4ntest\**; - _EXTERNAL\stormlibsharp\lib\**; - _EXTERNAL\stormlibsharp\src\TestConsole\** - - + + + win-x86;win-x64 + + + win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64 + + + win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64 + + + net6.0;net7.0;net8.0;net9.0 + - - - - $(DefaultItemExcludes); - _EXTERNAL\stormlibsharp\src\** - - + + + $(DefineConstants);WIN + - - - - $(DefaultItemExcludes); - _EXTERNAL\** - - + + + + $(DefaultItemExcludes); + **\AssemblyInfo.cs; + _EXTERNAL\LessIO\src\LessIO.Tests\**; + _EXTERNAL\libmspack4n\lib\**; + _EXTERNAL\libmspack4n\libmspack4ntest\**; + _EXTERNAL\stormlibsharp\lib\**; + _EXTERNAL\stormlibsharp\src\TestConsole\** + + - - - - true - contentFiles;content - true - true - Content - true - Always - Always - - + + + + $(DefaultItemExcludes); + _EXTERNAL\stormlibsharp\src\** + + - - - - - - - - + + + + $(DefaultItemExcludes); + _EXTERNAL\** + + - - - - - - - - - - + + + + true + contentFiles;content + true + true + Content + true + Always + Always + + - + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BinaryObjectScanner/FileType/LDSCRYPT.cs b/BinaryObjectScanner/FileType/LDSCRYPT.cs index e61ca540..f778bc4c 100644 --- a/BinaryObjectScanner/FileType/LDSCRYPT.cs +++ b/BinaryObjectScanner/FileType/LDSCRYPT.cs @@ -26,7 +26,7 @@ namespace BinaryObjectScanner.FileType try { byte[] magic = new byte[16]; - stream.Read(magic, 0, 16); + int read = stream.Read(magic, 0, 16); if (magic.StartsWith(new byte?[] { 0x4C, 0x44, 0x53, 0x43, 0x52, 0x59, 0x50, 0x54 })) return "Link Data Security encrypted file"; diff --git a/BinaryObjectScanner/FileType/PLJ.cs b/BinaryObjectScanner/FileType/PLJ.cs index 1361c3d3..b159f39b 100644 --- a/BinaryObjectScanner/FileType/PLJ.cs +++ b/BinaryObjectScanner/FileType/PLJ.cs @@ -26,7 +26,7 @@ namespace BinaryObjectScanner.FileType try { byte[] magic = new byte[16]; - stream.Read(magic, 0, 16); + int read = stream.Read(magic, 0, 16); if (magic.StartsWith(new byte?[] { 0xFF, 0x9D, 0x53, 0x4B })) return "PlayJ Audio File"; diff --git a/BinaryObjectScanner/FileType/RealArcadeInstaller.cs b/BinaryObjectScanner/FileType/RealArcadeInstaller.cs index 39601e2b..b6bd79aa 100644 --- a/BinaryObjectScanner/FileType/RealArcadeInstaller.cs +++ b/BinaryObjectScanner/FileType/RealArcadeInstaller.cs @@ -28,7 +28,7 @@ namespace BinaryObjectScanner.FileType try { byte[] magic = new byte[16]; - stream.Read(magic, 0, 16); + int read = stream.Read(magic, 0, 16); // RASGI2.0 // Found in the ".rgs" files in IA item "Nova_RealArcadeCD_USA". diff --git a/BinaryObjectScanner/FileType/RealArcadeMezzanine.cs b/BinaryObjectScanner/FileType/RealArcadeMezzanine.cs index ad51adba..3cabc04e 100644 --- a/BinaryObjectScanner/FileType/RealArcadeMezzanine.cs +++ b/BinaryObjectScanner/FileType/RealArcadeMezzanine.cs @@ -28,7 +28,7 @@ namespace BinaryObjectScanner.FileType try { byte[] magic = new byte[16]; - stream.Read(magic, 0, 16); + int read = stream.Read(magic, 0, 16); // XZip2.0 // Found in the ".mez" files in IA item "Nova_RealArcadeCD_USA". diff --git a/BinaryObjectScanner/FileType/SFFS.cs b/BinaryObjectScanner/FileType/SFFS.cs index f568b1ad..6a41f9cc 100644 --- a/BinaryObjectScanner/FileType/SFFS.cs +++ b/BinaryObjectScanner/FileType/SFFS.cs @@ -27,7 +27,7 @@ namespace BinaryObjectScanner.FileType try { byte[] magic = new byte[16]; - stream.Read(magic, 0, 16); + int read = stream.Read(magic, 0, 16); if (magic.StartsWith(new byte?[] { 0x53, 0x46, 0x46, 0x53 })) return "StarForce Filesystem Container"; diff --git a/BinaryObjectScanner/Scanner.cs b/BinaryObjectScanner/Scanner.cs index a7cc5296..bfa8c02b 100644 --- a/BinaryObjectScanner/Scanner.cs +++ b/BinaryObjectScanner/Scanner.cs @@ -248,7 +248,7 @@ namespace BinaryObjectScanner byte[] magic = new byte[16]; try { - stream.Read(magic, 0, 16); + int read = stream.Read(magic, 0, 16); stream.Seek(0, SeekOrigin.Begin); } catch (Exception ex) diff --git a/ExtractionTool/ExtractionTool.csproj b/ExtractionTool/ExtractionTool.csproj index 5a1dfdd5..88109b1e 100644 --- a/ExtractionTool/ExtractionTool.csproj +++ b/ExtractionTool/ExtractionTool.csproj @@ -1,42 +1,42 @@ - + - net20;net35;net40;net452;net462;net472;net48;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 - Exe - false - false - latest - enable - true - true + net20;net35;net40;net452;net462;net472;net48;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0 + Exe + false + false + latest + enable + true + true - + - win-x86;win-x64 + win-x86;win-x64 - win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64 + win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64 - - win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64 + + win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64 - net6.0;net7.0;net8.0 + net6.0;net7.0;net8.0;net9.0 - + - $(DefineConstants);WIN + $(DefineConstants);WIN - + - + - + - - + + - - \ No newline at end of file + + \ No newline at end of file diff --git a/ProtectionScan/ProtectionScan.csproj b/ProtectionScan/ProtectionScan.csproj index 20bfda3c..ba0d819a 100644 --- a/ProtectionScan/ProtectionScan.csproj +++ b/ProtectionScan/ProtectionScan.csproj @@ -1,37 +1,37 @@  - net20;net35;net40;net452;net462;net472;net48;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0 - Exe - false - false - latest - enable - true - true + net20;net35;net40;net452;net462;net472;net48;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0 + Exe + false + false + latest + enable + true + true - + - win-x86;win-x64 + win-x86;win-x64 - win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64 + win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64 - - win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64 + + win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64 - net6.0;net7.0;net8.0 + net6.0;net7.0;net8.0;net9.0 - + - $(DefineConstants);WIN + $(DefineConstants);WIN - + - + - - \ No newline at end of file + + \ No newline at end of file diff --git a/publish-nix.sh b/publish-nix.sh index 99c866ef..bab74de8 100644 --- a/publish-nix.sh +++ b/publish-nix.sh @@ -1,7 +1,7 @@ #!/bin/bash # This batch file assumes the following: -# - .NET 8.0 (or newer) SDK is installed and in PATH +# - .NET 9.0 (or newer) SDK is installed and in PATH # - zip is installed and in PATH # - Git is installed and in PATH # @@ -44,18 +44,18 @@ echo " No archive (-a) $NO_ARCHIVE" echo " " # Create the build matrix arrays -FRAMEWORKS=("net8.0") +FRAMEWORKS=("9.0") RUNTIMES=("win-x86" "win-x64" "win-arm64" "linux-x64" "linux-arm64" "osx-x64" "osx-arm64") # Use expanded lists, if requested if [ $USE_ALL = true ]; then - FRAMEWORKS=("net20" "net35" "net40" "net452" "net462" "net472" "net48" "netcoreapp3.1" "net5.0" "net6.0" "net7.0" "net8.0") + FRAMEWORKS=("net20" "net35" "net40" "net452" "net462" "net472" "net48" "netcoreapp3.1" "net5.0" "net6.0" "net7.0" "net8.0" "net9.0") fi # Create the filter arrays -SINGLE_FILE_CAPABLE=("net5.0" "net6.0" "net7.0" "net8.0") -VALID_APPLE_FRAMEWORKS=("net6.0" "net7.0" "net8.0") -VALID_CROSS_PLATFORM_FRAMEWORKS=("netcoreapp3.1" "net5.0" "net6.0" "net7.0" "net8.0") +SINGLE_FILE_CAPABLE=("net5.0" "net6.0" "net7.0" "net8.0" "net9.0") +VALID_APPLE_FRAMEWORKS=("net6.0" "net7.0" "net8.0" "net9.0") +VALID_CROSS_PLATFORM_FRAMEWORKS=("netcoreapp3.1" "net5.0" "net6.0" "net7.0" "net8.0" "net9.0") VALID_CROSS_PLATFORM_RUNTIMES=("win-arm64" "linux-x64" "linux-arm64" "osx-x64" "osx-arm64") NON_DLL_FRAMEWORKS=("net20" "net35" "net40") NON_DLL_RUNTIMES=("win-x64" "win-arm64" "linux-x64" "linux-arm64" "osx-x64" "osx-arm64") diff --git a/publish-win.ps1 b/publish-win.ps1 index ec436f38..0078ca0b 100644 --- a/publish-win.ps1 +++ b/publish-win.ps1 @@ -1,5 +1,5 @@ # This batch file assumes the following: -# - .NET 8.0 (or newer) SDK is installed and in PATH +# - .NET 9.0 (or newer) SDK is installed and in PATH # - 7-zip commandline (7z.exe) is installed and in PATH # - Git for Windows is installed and in PATH # @@ -35,18 +35,18 @@ Write-Host " No archive (-NoArchive) $NO_ARCHIVE" Write-Host " " # Create the build matrix arrays -$FRAMEWORKS = @('net8.0') +$FRAMEWORKS = @('net9.0') $RUNTIMES = @('win-x86', 'win-x64', 'win-arm64', 'linux-x64', 'linux-arm64', 'osx-x64', 'osx-arm64') # Use expanded lists, if requested if ($USE_ALL.IsPresent) { - $FRAMEWORKS = @('net20', 'net35', 'net40', 'net452', 'net462', 'net472', 'net48', 'netcoreapp3.1', 'net5.0', 'net6.0', 'net7.0', 'net8.0') + $FRAMEWORKS = @('net20', 'net35', 'net40', 'net452', 'net462', 'net472', 'net48', 'netcoreapp3.1', 'net5.0', 'net6.0', 'net7.0', 'net8.0', 'net9.0') } # Create the filter arrays -$SINGLE_FILE_CAPABLE = @('net5.0', 'net6.0', 'net7.0', 'net8.0') -$VALID_APPLE_FRAMEWORKS = @('net6.0', 'net7.0', 'net8.0') -$VALID_CROSS_PLATFORM_FRAMEWORKS = @('netcoreapp3.1', 'net5.0', 'net6.0', 'net7.0', 'net8.0') +$SINGLE_FILE_CAPABLE = @('net5.0', 'net6.0', 'net7.0', 'net8.0', 'net9.0') +$VALID_APPLE_FRAMEWORKS = @('net6.0', 'net7.0', 'net8.0', 'net9.0') +$VALID_CROSS_PLATFORM_FRAMEWORKS = @('netcoreapp3.1', 'net5.0', 'net6.0', 'net7.0', 'net8.0', 'net9.0') $VALID_CROSS_PLATFORM_RUNTIMES = @('win-arm64', 'linux-x64', 'linux-arm64', 'osx-x64', 'osx-arm64') $NON_DLL_FRAMEWORKS = @('net20', 'net35', 'net40') $NON_DLL_RUNTIMES = @('win-x64', 'win-arm64', 'linux-x64', 'linux-arm64', 'osx-x64', 'osx-arm64')