Add a old code project

This commit is contained in:
zontreck 2024-03-08 16:17:09 -07:00
commit 8b48fdeb8d
11 changed files with 197 additions and 0 deletions

Binary file not shown.

View file

BIN
.vs/EagleEye/v17/.futdcache.v2 Executable file

Binary file not shown.

BIN
.vs/EagleEye/v17/.suo Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

16
EagleEye.csproj Executable file
View file

@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BitCoinSharp" Version="0.2.166.49" />
<PackageReference Include="NBitcoin" Version="7.0.22" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="7.0.0" />
</ItemGroup>
</Project>

25
EagleEye.sln Executable file
View file

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33122.133
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EagleEye", "EagleEye.csproj", "{79EE707A-955B-44C2-9899-592B02DF5FB1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{79EE707A-955B-44C2-9899-592B02DF5FB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{79EE707A-955B-44C2-9899-592B02DF5FB1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{79EE707A-955B-44C2-9899-592B02DF5FB1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{79EE707A-955B-44C2-9899-592B02DF5FB1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {20BCCC0C-8D9E-4DDB-94A9-743E8F673BAB}
EndGlobalSection
EndGlobal

156
Program.cs Executable file
View file

@ -0,0 +1,156 @@
using BitCoinSharp;
using NBitcoin;
using System.Numerics;
using System.Xml.Linq;
namespace EagleEye
{
internal class Program
{
public static string search;
public static BigInteger point = BigInteger.Zero;
public static Wallet wallet = null;
static void Main(string[] args)
{
//args = new string[] { "1HLoD9E4SDFFPDiYfNYnkBLQ85Y51J3Zb1" };
Console.WriteLine("\n \n* WELCOME TO EAGLE EYE *\n \n[ Checking for required parameters ]");
if(args.Length >= 1)
{
Console.WriteLine($"[ Scanning for {args[0]} ]");
search = args[0];
wallet = new Wallet(NetworkParameters.ProdNet());
}else
{
if (!File.Exists("resume.bin"))
{
Console.WriteLine($"[ Please provide the address to search for ]");
return;
}
else Load();
}
Key privkey = new();
//byte[] bits = new byte[32];
bool bSearch = true;
BigInteger big = point;
if(search != "")
{
args = new string[] { search };
}
Console.WriteLine();
Console.WriteLine();
Console.CancelKeyPress += Console_CancelKeyPress;
int lastSave = 0;
while (bSearch)
{
byte[] bits = big.ToByteArray();
Array.Resize<byte>(ref bits, 32);
Array.Reverse(bits);
big++;
point = big;
//big.ToByteArray().CopyTo(bits, 0);
try
{
privkey = new Key(bits);
}
catch
{
continue;
}
string hex = string.Join("", bits.Select(b => string.Format("{0:X2}", b)));
//privkey = Key.Parse(hex, Network.Main);
BitcoinSecret btcpriv = privkey.GetWif(Network.Main);
BitcoinAddress legacy = btcpriv.PubKey.GetAddress(ScriptPubKeyType.Legacy, Network.Main);
BitcoinAddress segwit = btcpriv.PubKey.GetAddress(ScriptPubKeyType.Segwit, Network.Main);
BitcoinAddress segwit2 = btcpriv.PubKey.GetAddress(ScriptPubKeyType.SegwitP2SH, Network.Main);
BitcoinAddress taproot = btcpriv.PubKey.GetAddress(ScriptPubKeyType.TaprootBIP86, Network.Main);
if (args[0] == legacy.ToString() || args[0] == segwit.ToString() || args[0] == segwit2.ToString() || args[0] == taproot.ToString())
{
Console.WriteLine($"\n\nPRIVATE KEY FOUND : {btcpriv}\n\n");
//bSearch = false;
Save();
}
else Console.Write($"\rSearching for private key [{btcpriv}] [{lastSave}] [{wallet.Keychain.Count}] \r");
if (lastSave >= 2000)
{
Save();
lastSave = 0;
}
else lastSave++;
try
{
Org.BouncyCastle.Math.BigInteger pk = new Org.BouncyCastle.Math.BigInteger(hex, 16);
wallet.AddKey(new EcKey(pk));
}
catch { }
}
}
private static void Console_CancelKeyPress(object? sender, ConsoleCancelEventArgs e)
{
Console.WriteLine("Saving state...");
Save();
Environment.Exit(0);
}
private static void Save()
{
try
{
Thread tx = new Thread(() =>
{
BinaryWriter bw = new BinaryWriter(new FileStream("resume.bin", FileMode.OpenOrCreate, FileAccess.ReadWrite));
bw.Write(search);
byte[] arr = point.ToByteArray();
bw.Write(arr.Length);
bw.Write(arr);
try
{
FileInfo fi = new FileInfo("wallet.dat");
wallet.SaveToFile(fi);
}
catch { }
bw.Close();
});
tx.Start();
}
catch { }
}
private static void Load()
{
BinaryReader br = new BinaryReader(new FileStream("resume.bin", FileMode.Open, FileAccess.Read));
search = br.ReadString();
point = new BigInteger(br.ReadBytes(br.ReadInt32()));
br.Close();
Console.WriteLine("[ Loaded saved state ]");
wallet = Wallet.LoadFromFile(new FileInfo("wallet.dat"));
}
}
}