[Bug 48970] GVMP-Launcher crashes with Wine-Mono (fails to generate user key using WMI ManagementObjectEnumerator)

WineHQ Bugzilla wine-bugs at winehq.org
Sun Apr 19 17:15:05 CDT 2020


https://bugs.winehq.org/show_bug.cgi?id=48970

Anastasius Focht <focht at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|GVMP-Launcher: not starting |GVMP-Launcher crashes with
                   |                            |Wine-Mono (fails to
                   |                            |generate user key using WMI
                   |                            |ManagementObjectEnumerator)
                 CC|                            |focht at gmx.net

--- Comment #5 from Anastasius Focht <focht at gmx.net> ---
Hello folks,

the corresponding decompiled C# code that Wine-Mono fails on:

--- snip ---
// Type: GVMP_Launcher.Functionality.Keygen
// Assembly: GVMP-Launcher, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null
// MVID: 6CDBBCAC-058D-4670-8736-86E3F4358FEC
// Assembly location: Z:\home\focht\.wine\drive_c\Program Files (x86)\GVMP -
Launcher\GVMP-Launcher.exe

using System.Management;
using System.Security.Cryptography;
using System.Text;

namespace GVMP_Launcher.Functionality
{
  public class Keygen
  {
    public string GenerateKey(string p_ForumID, string p_Name)
    {
      ManagementObjectCollection objectCollection = new
ManagementObjectSearcher("Select ProcessorId From Win32_processor").Get();
      string str = "";
      using (ManagementObjectCollection.ManagementObjectEnumerator enumerator =
objectCollection.GetEnumerator())
      {
        if (enumerator.MoveNext())
          str = enumerator.Current["ProcessorId"].ToString();
      }
      using (SHA256 shA256 = SHA256.Create())
      {
        byte[] hash = shA256.ComputeHash(Encoding.UTF8.GetBytes(str + p_ForumID
+ p_Name));
        StringBuilder stringBuilder = new StringBuilder();
        for (int index = 0; index < hash.Length; ++index)
          stringBuilder.Append(hash[index].ToString("x2"));
        return stringBuilder.ToString();
      }
    }

    public Keygen()
    {
      base.\u002Ector();
    }
  }
}
--- snip ---

--- snip ---
        if (ConfigurationManager.AppSettings["user_key"] == null)
        {
          configuration.AppSettings.Settings.Remove("user_key");
          configuration.AppSettings.Settings.Add("user_key",
keygen.GenerateKey(ConfigurationManager.AppSettings["forum_id"],
ConfigurationManager.AppSettings["name"]));
        }
--- snip ---

There is an update of Wine-Mono from 4.9.4 to 5.0.0 in upcoming Wine 5.7
release.

https://www.winehq.org/pipermail/wine-devel/2020-April/164776.html

You might want to recheck then.

Regards

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list