commit 8b48fdeb8d4a068accf87a6a13435cd55ddf3b61 Author: zontreck Date: Fri Mar 8 16:17:09 2024 -0700 Add a old code project diff --git a/.vs/EagleEye/DesignTimeBuild/.dtbcache.v2 b/.vs/EagleEye/DesignTimeBuild/.dtbcache.v2 new file mode 100755 index 0000000..ff119fc Binary files /dev/null and b/.vs/EagleEye/DesignTimeBuild/.dtbcache.v2 differ diff --git a/.vs/EagleEye/FileContentIndex/608a60ce-298f-47b6-821b-e124afa1c1f1.vsidx b/.vs/EagleEye/FileContentIndex/608a60ce-298f-47b6-821b-e124afa1c1f1.vsidx new file mode 100755 index 0000000..8541f23 Binary files /dev/null and b/.vs/EagleEye/FileContentIndex/608a60ce-298f-47b6-821b-e124afa1c1f1.vsidx differ diff --git a/.vs/EagleEye/FileContentIndex/68fb5ab0-eead-4feb-b078-14645092c967.vsidx b/.vs/EagleEye/FileContentIndex/68fb5ab0-eead-4feb-b078-14645092c967.vsidx new file mode 100755 index 0000000..5266028 Binary files /dev/null and b/.vs/EagleEye/FileContentIndex/68fb5ab0-eead-4feb-b078-14645092c967.vsidx differ diff --git a/.vs/EagleEye/FileContentIndex/read.lock b/.vs/EagleEye/FileContentIndex/read.lock new file mode 100755 index 0000000..e69de29 diff --git a/.vs/EagleEye/v17/.futdcache.v2 b/.vs/EagleEye/v17/.futdcache.v2 new file mode 100755 index 0000000..3ecce19 Binary files /dev/null and b/.vs/EagleEye/v17/.futdcache.v2 differ diff --git a/.vs/EagleEye/v17/.suo b/.vs/EagleEye/v17/.suo new file mode 100755 index 0000000..70e5a5a Binary files /dev/null and b/.vs/EagleEye/v17/.suo differ diff --git a/.vs/ProjectEvaluation/eagleeye.metadata.v5.2 b/.vs/ProjectEvaluation/eagleeye.metadata.v5.2 new file mode 100755 index 0000000..9b9627e Binary files /dev/null and b/.vs/ProjectEvaluation/eagleeye.metadata.v5.2 differ diff --git a/.vs/ProjectEvaluation/eagleeye.projects.v5.2 b/.vs/ProjectEvaluation/eagleeye.projects.v5.2 new file mode 100755 index 0000000..816cb39 Binary files /dev/null and b/.vs/ProjectEvaluation/eagleeye.projects.v5.2 differ diff --git a/EagleEye.csproj b/EagleEye.csproj new file mode 100755 index 0000000..4f16891 --- /dev/null +++ b/EagleEye.csproj @@ -0,0 +1,16 @@ + + + + Exe + net7.0 + enable + enable + + + + + + + + + diff --git a/EagleEye.sln b/EagleEye.sln new file mode 100755 index 0000000..a4b83cc --- /dev/null +++ b/EagleEye.sln @@ -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 diff --git a/Program.cs b/Program.cs new file mode 100755 index 0000000..af76a82 --- /dev/null +++ b/Program.cs @@ -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(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")); + } + } +} \ No newline at end of file