Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create fixed #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
using System;
using System;
using System.Text;
using Microsoft.Win32;

@@ -26,6 +26,9 @@ public static bool Spoof()
{
Log.Clear();
string oldValue = GetValue();
Console.WriteLine("Old Value {0}", oldValue);
Console.WriteLine("New value: {0}", Guid.NewGuid().ToString());

bool result = SetValue("{" + Guid.NewGuid().ToString() + "}");
if (result)
{
@@ -107,7 +110,7 @@ public static bool Spoof()

public static class ProductId
{
public static Regedit regeditOBJ = new Regedit(@"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion");
public static Regedit regeditOBJ = new Regedit(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion");
public static readonly string Key = "ProductID";

public static string GetValue()
@@ -150,7 +153,7 @@ public string Read(string keyName)
{
try
{
using (RegistryKey key = Registry.LocalMachine.OpenSubKey(regeditPath))
using (RegistryKey key = Registry.LocalMachine.OpenSubKey(regeditPath, RegistryKeyPermissionCheck.ReadSubTree))
{
if (key != null)
{
@@ -174,7 +177,7 @@ public bool Write(string keyName, object value)
{
try
{
using (RegistryKey key = Registry.LocalMachine.OpenSubKey(regeditPath))
using (RegistryKey key = Registry.LocalMachine.OpenSubKey(regeditPath, RegistryKeyPermissionCheck.ReadWriteSubTree))
{
if (key != null)
{
key.SetValue(keyName, value);
return true;
}
else
{
//Console.WriteLine(" [Regedit] SubKey Doesn't founded!");
return false;
}
}
}
catch (Exception ex)
{
//Console.WriteLine(" [Regedit] Error accessing the Registry... Maybe run as admin? -" + ex.ToString());
return false;
}
}
}
public static class Utilities
{
private static Random rand = new Random();
public const string Alphabet = "ABCDEF0123456789";
private static Random random = new Random();
public const string Alphabet1 = "abcdef0123456789";
public static string GenerateString(int size)
{
char[] array = new char[size];
for (int i = 0; i < size; i++)
{
array[i] = Alphabet[rand.Next(Alphabet.Length)];
}
return new string(array);
}
}
}
}