Skip to content

Instantly share code, notes, and snippets.

@jaredpar
Created January 13, 2021 22:32
Show Gist options
  • Save jaredpar/3b07653bfbc7633f987d45f6d366f575 to your computer and use it in GitHub Desktop.
Save jaredpar/3b07653bfbc7633f987d45f6d366f575 to your computer and use it in GitHub Desktop.
Program to check if files were compiled with the determinism flag
using System;
using System.IO;
using System.Linq;
using System.Reflection.PortableExecutable;
foreach (var filePath in args)
{
using var stream = File.OpenRead(filePath);
var peReader = new PEReader(stream);
var any = peReader.ReadDebugDirectory().Any(x => x.Type == DebugDirectoryEntryType.Reproducible);
var not = any ? "" :"not ";
Console.WriteLine($"{filePath} is {not}reproducible");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment