public static string ToUnknownClassString(this byte[] buffer, UnknownPrefix prefix = UnknownPrefix.GClass, uint token = 0, int start = 0) { var hash = token * (uint)prefix; if (UnknownClassNameCache.ContainsKey(hash)) { return(UnknownClassNameCache[hash]); } var prefixName = Enum.GetName(typeof(UnknownPrefix), prefix); var str = $"{prefixName}{PrefixIndexer[prefixName ?? throw new InvalidOperationException()]++:0000}";
public static string ToUnknownClassString(this byte[] _, UnknownPrefix prefix, uint token) { var hash = (token - 0x2000000) * (uint)prefix; if (UnknownClassNameCache.ContainsKey(hash)) { return(UnknownClassNameCache[hash]); } var prefixName = Enum.GetName(typeof(UnknownPrefix), prefix); //var str = $"{prefixName}{PrefixIndexer[prefixName ?? throw new InvalidOperationException()]++:0000}"; var str = $"{prefixName}{hash:X4}"; UnknownClassNameCache.Add(hash, str); return(str); }