JetBrains.FormatRipper 3.0.0

Prefix Reserved
dotnet add package JetBrains.FormatRipper --version 3.0.0
                    
NuGet\Install-Package JetBrains.FormatRipper -Version 3.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="JetBrains.FormatRipper" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="JetBrains.FormatRipper" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="JetBrains.FormatRipper" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add JetBrains.FormatRipper --version 3.0.0
                    
#r "nuget: JetBrains.FormatRipper, 3.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package JetBrains.FormatRipper@3.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=JetBrains.FormatRipper&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=JetBrains.FormatRipper&version=3.0.0
                    
Install as a Cake Tool

Usage

Following types of executable files are supported:

  • for Portable executable (PE) files use JetBrains.FormatRipper.Pe.PeFile
  • for Compound files or MS Windows Installer compound (MSI) files use JetBrains.FormatRipper.Compound.CompoundFile
  • for ELF files use JetBrains.FormatRipper.Elf.ElfFile
  • for Mach-O/Fat-Mach-O use JetBrains.FormatRipper.MachO.MachOFile

The client code should detect the file type and create an appropriate object to use.

File type detection

In order to detect the file type JetBrains.FormatRipper.FileExplorer.FileTypeExplorer can be used.

using var stream = File.OpenRead(pathToFile);
var res = stream.DetectFileType();
System.Console.WriteLine($"{res.FileType}: {res.FileProperties}"); // Pe: SharedLibraryType, Managed, Signed

Signature verification

Signature verification parameters

In order to verify the signature of any supported executable the client code should create the SignatureVerificationParams object and pass is to the call of VerifySignatureAsync method.

SignatureVerificationParams constructor apply following parameters:

  • signRootCertStore - Stream of PKCS #7 store with CA certificates for which a chain will be build and validate
  • timestampRootCertStore - Stream of PKCS #7 store with a timestamp CA certificates for which a chain will be build and validate
  • buildChain - If true, build and verify a certificates chain (by default true)
  • withRevocationCheck - If true, verify a revocation status for certificates in all chains (apply if buildChain is true, by default true)
  • ocspResponseTimeout - Timeout for OCSP request (5 sec. by default, apply if withRevocationCheck is true)
  • signatureValidationTimeMode - Mode of selection time which is used for certificates and CRLs validation (Timestamp by default)
  • signatureValidationTime - Time which is used when signatureValidationTimeMode has SignValidationTime value

The timestamp CA certificates may be included in the separate PKCS#7 store file, and passed to the timestampRootCertStore parameter.

Certificate revocation status checking is performed when withRevocationCheck is true. The check is based on CRLs, but if it is not available, OCSP is used.

Example

static Task Main(string[] args)
{
    var pathToMachO = args[0];
    var pathToPe = args[1];
    var logger = new SimpleConsoleLogger();
    return ResourceUtil.OpenDefaultRoots(async defaultRootsStream =>
        {
            var verificationParams = new SignatureVerificationParams(
                signRootCertStore: defaultRootsStream,
                timestampRootCertStore: null,
                buildChain: true,
                withRevocationCheck: false);
            await VerifyMachO(logger, pathToMachO, verificationParams);
            await VerifyPe(logger, pathToPe, verificationParams);
        });
}

static async Task VerifyMachO(ILogger logger, string path, SignatureVerificationParams verificationParams)
{
    using var stream = File.OpenRead(path);
    var file = MachOFile.Parse(stream, MachOFile.Mode.SignatureData);
    foreach (var section in file.Sections)
    {
        var result = await VerifySignature(logger, section.SignatureData, verificationParams);
        DisplayResult(logger, result);
    }
}

static async Task VerifyPe(ILogger logger, string path, SignatureVerificationParams verificationParams)
{
    using var stream = File.OpenRead(path);
    var file = PeFile.Parse(stream, PeFile.Mode.SignatureData);
    VerifySignatureResult result = await VerifySignature(logger, file.SignatureData, verificationParams);
    DisplayResult(logger, result);
}

static async Task<VerifySignatureResult> VerifySignature(ILogger logger, SignatureData signatureData, SignatureVerificationParams verificationParams)
{
    var signedMessage = SignedMessage.CreateInstance(signatureData);
    var signedMessageVerifier = new SignedMessageVerifier(logger);
    return await signedMessageVerifier.VerifySignatureAsync(signedMessage, verificationParams);
}

static void DisplayResult(ILogger logger, VerifySignatureResult result)
{
    if (result.Status == VerifySignatureStatus.Valid)
        logger.Info("Signature is VALID!");
    else
        logger.Error($"Signature is INVALID! {result.Message}");
}

Hash computing

Following hashing algorithms are supported:

  • MD5
  • SHA1
  • SHA256
  • SHA384
  • SHA512

In order to compute hash of the executable call the HashUtil.ComputeHash() method.

Example

using var stream = File.OpenRead(pathToFile);
var file = PeFile.Parse(stream, PeFile.Mode.ComputeHashInfo);
var hash = HashUtil.ComputeHash(stream, file.ComputeHashInfo, HashAlgorithmName.SHA512);

Additional

Example of logger

class SimpleConsoleLogger : ILogger
{
   public void Info(string str) => System.Console.WriteLine($"INFO: {str}");
   public void Warning(string str) => System.Console.Error.WriteLine($"WARNING: {str}");
   public void Error(string str) => System.Console.Error.WriteLine($"ERROR: {str}");
   public void Trace(string str) => System.Console.Error.WriteLine($"TRACE: {str}");
}

Default CA certificates

The library contains the JetBrains.SignatureVerifier.ResourceUtil.OpenDefaultRoots() method which returns the stream of the PKCS#7 store with following root certificates:

Issuer Serial number Not valid before Not valid after Thumbprint
CN=Apple Root CA, OU=Apple Certification Authority, O=Apple Inc., C=US 02 26.04.2006 1:40 10.02.2035 0:40 611E5B662C593A08FF58D14AE22452D198DF6C60
CN=Certum Trusted Network CA, OU=Certum Certification Authority, O=Unizeto Technologies S.A., C=PL 0444C0 22.10.2008 16:07 31.12.2029 15:07 07E032E020B72C3F192F0628A2593A19A70F069E
CN=Go Daddy Root Certificate Authority - G2, O="GoDaddy.com, Inc.", L=Scottsdale, S=Arizona, C=US 00 01.09.2009 4:00 01.01.2038 2:59 47BEABC922EAE80E78783462A79F45C254FDE68B
CN=Microsoft Root Certificate Authority 2010, O=Microsoft Corporation, L=Redmond, S=Washington, C=US 28CC3A25BFBA44AC449A9B586B4339AA 24.06.2010 1:57 24.06.2035 1:04 3B1EFD3A66EA28B16697394703A72CA340A05BD5
CN=Microsoft Root Certificate Authority 2011, O=Microsoft Corporation, L=Redmond, S=Washington, C=US 3F8BC8B5FC9FB29643B569D66C42E144 23.03.2011 1:05 23.03.2036 1:13 8F43288AD272F3103B6FB1428485EA3014C0BCFE
CN=Microsoft Root Certificate Authority, DC=microsoft, DC=com 79AD16A14AA0A5AD4C7358F407132E65 10.05.2001 3:19 10.05.2021 2:28 CDD4EEAE6000AC7F40C3802C171E30148030C072
CN=USERTrust RSA Certification Authority, O=The USERTRUST Network, L=Jersey City, S=New Jersey, C=US 01FD6D30FCA3CA51A81BBC640E35032D 01.02.2010 3:00 19.01.2038 2:59 2B8F1B57330DBBA2D07A6C51F70EE90DDAB9AD8E
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp1.0 was computed.  netcoreapp1.1 was computed.  netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard1.0 is compatible.  netstandard1.1 was computed.  netstandard1.2 was computed.  netstandard1.3 was computed.  netstandard1.4 was computed.  netstandard1.5 was computed.  netstandard1.6 was computed.  netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net20 is compatible.  net35 is compatible.  net40 was computed.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen30 was computed.  tizen40 was computed.  tizen60 was computed. 
Universal Windows Platform uap was computed.  uap10.0 was computed. 
Windows Phone wp8 was computed.  wp81 was computed.  wpa81 was computed. 
Windows Store netcore was computed.  netcore45 was computed.  netcore451 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 2.0

    • No dependencies.
  • .NETFramework 3.5

    • No dependencies.
  • .NETStandard 1.0

  • .NETStandard 2.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on JetBrains.FormatRipper:

Package Downloads
JetBrains.HabitatDetector

The cross-platform open-source library for detecting habitat information.

JetBrains.SignatureVerifier

The cross-platform open-source library for performing cryptography signature checks.

JetBrains.Rider.Rider.Backend

JetBrains Rider Rider Backend Package Version 233.0.20240606.114412

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on JetBrains.FormatRipper:

Repository Stars
JetBrains/resharper-unity
Unity support for both ReSharper and Rider
Version Downloads Last Updated
3.0.0 0 10/20/2026
2.4.0 4,365,423 4/10/2025
2.3.0 3,131 3/28/2025
2.2.2 2,599,346 9/6/2024
2.2.1 410,226 6/14/2024
2.2.0 168,303 4/8/2024
2.1.0 150,061 1/26/2024
2.0.1 1,801,480 4/12/2023
2.0.0 841 4/3/2023
1.1.1 27,415 3/11/2024
1.1.0 218,674 9/26/2022
1.0.0 116,982 3/26/2022