diff --git a/Dalamud/Util.cs b/Dalamud/Util.cs
index 14f96080b..9df4e5a53 100644
--- a/Dalamud/Util.cs
+++ b/Dalamud/Util.cs
@@ -1,4 +1,5 @@
using System;
+using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
@@ -13,11 +14,31 @@ namespace Dalamud
///
public static class Util
{
+ private static string gitHashInternal;
+
///
/// Gets the assembly version of Dalamud.
///
public static string AssemblyVersion { get; } = Assembly.GetAssembly(typeof(ChatHandlers)).GetName().Version.ToString();
+ ///
+ /// Gets the git hash value from the assembly
+ /// or null if it cannot be found.
+ ///
+ /// The git hash of the assembly.
+ public static string GetGitHash()
+ {
+ if (gitHashInternal != null)
+ return gitHashInternal;
+
+ var asm = typeof(Util).Assembly;
+ var attrs = asm.GetCustomAttributes();
+
+ gitHashInternal = attrs.FirstOrDefault(a => a.Key == "GitHash")?.Value;
+
+ return gitHashInternal;
+ }
+
///
/// Read memory from an offset and hexdump them via Serilog.
///