diff --git a/App.config b/App.config new file mode 100644 index 0000000..5778fa5 --- /dev/null +++ b/App.config @@ -0,0 +1,33 @@ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..fd927ab --- /dev/null +++ b/Program.cs @@ -0,0 +1,228 @@ +using Nethereum.Hex.HexTypes; +using Nethereum.Web3; +using Nethereum.Web3.Accounts; +using System; +using System.Collections.Generic; +using System.Configuration; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +class Program +{ + // Data structure to store Ethereum addresses and balances + static Dictionary ethAddressBalanceMap; + + // Counter to track total statistics + static int totalKeyCount = 0; + + // Counter to track local statistics + static int localKeyCount = 0; + + // StreamWriter için bir kilit nesnesi + private static readonly object writerLock = new object(); + + // Interval to clean up memory + static int cleanupInterval = Convert.ToInt32(ConfigurationManager.AppSettings["CleanupInterval"]); + + // Max degree of parallelism + static int maxDegreeOfParallelism = Convert.ToInt32(ConfigurationManager.AppSettings["MaxDegreeOfParallelism"]); + + static void Main() + { + // Load eth_list.tsv file + LoadEthList(Environment.CurrentDirectory + "\\eth_list.tsv"); + + // Check if the data structure is loaded successfully + if (ethAddressBalanceMap != null && ethAddressBalanceMap.Any()) + { + Console.WriteLine("Data loaded successfully."); + Console.WriteLine($"Number of addresses in the loaded data: {ethAddressBalanceMap.Count}"); + } + else + { + Console.WriteLine("Error loading data or no addresses found."); + Console.ReadKey(); + } + + + + // Ethereum connection + //var web3 = new Web3(); + + // Start time + DateTime startTime = DateTime.Now; + + // Parallel options with max degree of parallelism + ParallelOptions parallelOptions = new ParallelOptions + { + MaxDegreeOfParallelism = maxDegreeOfParallelism + }; + + // StreamWriter for writing to a file + using (StreamWriter writer = new StreamWriter("export.txt")) + { + // Generate random private key and address in parallel with a limited number of threads + Parallel.ForEach(Enumerable.Range(0, int.MaxValue), parallelOptions, _ => + { + // Generate random private key and address in an infinite loop + while (true) + { + // Generate a random private key + var privateKey = GenerateRandomPrivateKey(); + + // Create an Ethereum account (address) from the private key + var account = new Account(privateKey); + + + + // Get the balance of the address + //var balance = GetBalance(web3, account.Address); + + // Increment local counter + localKeyCount++; + + // Increment total counter atomically + System.Threading.Interlocked.Increment(ref totalKeyCount); + + // Check the newly generated address + bool status = CheckEthAddress(account.Address); + + // Check if the balance is not zero + if (status == true) + { + // Write the results to the file + lock (writerLock) + { + // Write the results to the file + writer.WriteLine($"Private Key: {privateKey}"); + writer.WriteLine($"Address: {account.Address}"); + //writer.WriteLine($"Balance: {balance} wei"); + writer.WriteLine(); + } + + // Print the results to the console if desired + Console.WriteLine($"Private Key: {privateKey}"); + Console.WriteLine($"Address: {account.Address}"); + //Console.WriteLine($"Balance: {balance} wei"); + Console.WriteLine(); + + // Wait for a key press before generating the next key + Console.WriteLine("Press any key to generate the next key..."); + Console.ReadKey(true); + } + + // Print statistics when a certain number of keys have been generated + if (localKeyCount % 10000 == 0) + { + // End time + DateTime endTime = DateTime.Now; + + // Calculate elapsed time in seconds + double elapsedSeconds = (endTime - startTime).TotalSeconds; + + // Calculate total keys per second + double totalKeysPerSecond = totalKeyCount / elapsedSeconds; + + // Print total statistics to the console + Console.WriteLine($"Total Key Count: {totalKeyCount}"); + Console.WriteLine($"Total Keys Per Second: {totalKeysPerSecond:F2} keys/second"); + Console.WriteLine(); + // Check if elapsed time is greater than or equal to 60 seconds + //if (elapsedSeconds >= 60) + //{ + // End the program + //return; + //} + } + + // Check if it's time to clean up memory + if (localKeyCount % cleanupInterval == 0) + { + // Clean up memory + GC.Collect(); + GC.WaitForPendingFinalizers(); + Console.WriteLine("Memory cleaned up."); + } + } + }); + } + } + + // Function to load Ethereum addresses and balances from the file into a dictionary + static void LoadEthList(string filePath) + { + ethAddressBalanceMap = new Dictionary(); + + try + { + // Dosyanın var olup olmadığını kontrol et + if (!File.Exists(filePath)) + { + Console.WriteLine($"File not found: {filePath}"); + return; + } + + // Read the file line by line + foreach (var line in File.ReadLines(filePath).Skip(1)) // Skip the header line + { + // Split the line into parts + string[] parts = line.Split('\t'); + + // Extract the address and balance + string address = parts[0]; + double balance = double.Parse(parts[1]); + + // Add to the dictionary + ethAddressBalanceMap.Add(address, balance); + } + } + catch (Exception ex) + { + Console.WriteLine($"File loading error: {ex.Message}"); + } + } + + + // Function to generate a random Ethereum address (replace with your own implementation) + static string GenerateRandomEthAddress() + { + return "0x" + Guid.NewGuid().ToString("N").Substring(0, 40); + } + + // Function to check if an Ethereum address is in the loaded dictionary + static bool CheckEthAddress(string address) + { + if (ethAddressBalanceMap.ContainsKey(address)) + { + double balance = ethAddressBalanceMap[address]; + //Console.WriteLine($"Address found: {address}, Balance: {balance}"); + return true; + } + else + { + //Console.WriteLine($"Address not found: {address}"); + return false; + } + } + + // Function to generate a random private key + static string GenerateRandomPrivateKey() + { + var randomBytes = new byte[32]; + using (var rng = new System.Security.Cryptography.RNGCryptoServiceProvider()) + { + rng.GetBytes(randomBytes); + } + return "0x" + BitConverter.ToString(randomBytes).Replace("-", ""); + } + + // Function to get the balance of an Ethereum address + static ulong GetBalance(Web3 web3, string address) + { + // Call the web3.Eth.GetBalance.SendRequestAsync method to get the balance + var balanceTask = web3.Eth.GetBalance.SendRequestAsync(address); + + // Wait for the task to complete and return the result + return balanceTask.Result.ToUlong(); + } +} diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..0c9f103 --- /dev/null +++ b/Properties/AssemblyInfo.cs @@ -0,0 +1,20 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("WalletHunter")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("WalletHunter")] +[assembly: AssemblyCopyright("Copyright © 2025")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + + +[assembly: ComVisible(false)] + +[assembly: Guid("31F693EA-6119-4A7F-8BFF-F0C72FF921AC")] + +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WalletHunter.csproj b/WalletHunter.csproj new file mode 100644 index 0000000..9cc975d --- /dev/null +++ b/WalletHunter.csproj @@ -0,0 +1,184 @@ + + + + + + Debug + AnyCPU + {C46E6C45-6383-4071-8097-D20979F82816} + Exe + WalletHunter + WalletHunter + v4.7.2 + 512 + true + true + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + packages\ADRaffy.ENSNormalize.0.1.5\lib\net461\ADRaffy.ENSNormalize.dll + + + packages\BouncyCastle.1.8.2\lib\BouncyCastle.Crypto.dll + + + packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll + + + packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll + + + packages\ILGPU.1.5.1\lib\net471\ILGPU.dll + + + packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll + + + packages\Microsoft.Extensions.FileProviders.Abstractions.8.0.0\lib\net462\Microsoft.Extensions.FileProviders.Abstractions.dll + + + packages\Microsoft.Extensions.FileProviders.Physical.8.0.0\lib\net462\Microsoft.Extensions.FileProviders.Physical.dll + + + packages\Microsoft.Extensions.FileSystemGlobbing.8.0.0\lib\net462\Microsoft.Extensions.FileSystemGlobbing.dll + + + packages\Microsoft.Extensions.Logging.Abstractions.6.0.0\lib\net461\Microsoft.Extensions.Logging.Abstractions.dll + + + packages\Microsoft.Extensions.Primitives.8.0.0\lib\net462\Microsoft.Extensions.Primitives.dll + + + packages\Nethereum.ABI.4.18.0\lib\net461\Nethereum.ABI.dll + + + packages\Nethereum.Accounts.4.18.0\lib\net461\Nethereum.Accounts.dll + + + packages\Nethereum.BlockchainProcessing.4.18.0\lib\net461\Nethereum.BlockchainProcessing.dll + + + packages\Nethereum.Contracts.4.18.0\lib\net461\Nethereum.Contracts.dll + + + packages\Nethereum.Hex.4.18.0\lib\net461\Nethereum.Hex.dll + + + packages\Nethereum.JsonRpc.Client.4.18.0\lib\net461\Nethereum.JsonRpc.Client.dll + + + packages\Nethereum.JsonRpc.RpcClient.4.18.0\lib\net461\Nethereum.JsonRpc.RpcClient.dll + + + packages\Nethereum.KeyStore.4.18.0\lib\net461\Nethereum.KeyStore.dll + + + packages\Nethereum.Merkle.Patricia.4.18.0\lib\net461\Nethereum.Merkle.Patricia.dll + + + packages\Nethereum.Model.4.18.0\lib\net461\Nethereum.Model.dll + + + packages\Nethereum.RLP.4.18.0\lib\net461\Nethereum.RLP.dll + + + packages\Nethereum.RPC.4.18.0\lib\net461\Nethereum.RPC.dll + + + packages\Nethereum.Signer.4.18.0\lib\net461\Nethereum.Signer.dll + + + packages\Nethereum.Signer.EIP712.4.18.0\lib\net461\Nethereum.Signer.EIP712.dll + + + packages\Nethereum.Util.4.18.0\lib\net461\Nethereum.Util.dll + + + packages\Nethereum.Web3.4.18.0\lib\net461\Nethereum.Web3.dll + + + packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll + + + + packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + + + packages\System.Collections.Immutable.7.0.0\lib\net462\System.Collections.Immutable.dll + + + + + + packages\System.Memory.4.5.5\lib\net461\System.Memory.dll + + + + packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + + packages\System.Reflection.Metadata.7.0.2\lib\net462\System.Reflection.Metadata.dll + + + packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + + + packages\System.Text.Encodings.Web.8.0.0\lib\net462\System.Text.Encodings.Web.dll + + + packages\System.Text.Json.8.0.0\lib\net462\System.Text.Json.dll + + + packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll + + + packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WalletHunter.sln b/WalletHunter.sln new file mode 100644 index 0000000..9158abf --- /dev/null +++ b/WalletHunter.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.8.34309.116 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WalletHunter", "WalletHunter.csproj", "{C46E6C45-6383-4071-8097-D20979F82816}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C46E6C45-6383-4071-8097-D20979F82816}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C46E6C45-6383-4071-8097-D20979F82816}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C46E6C45-6383-4071-8097-D20979F82816}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C46E6C45-6383-4071-8097-D20979F82816}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {BCECA54D-CCD4-49A1-9E05-E854A4BA7630} + EndGlobalSection +EndGlobal diff --git a/packages.config b/packages.config new file mode 100644 index 0000000..e14cc06 --- /dev/null +++ b/packages.config @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ss.jpg b/ss.jpg new file mode 100644 index 0000000..74a86e0 Binary files /dev/null and b/ss.jpg differ diff --git a/ss2.gif b/ss2.gif new file mode 100644 index 0000000..176f8f3 Binary files /dev/null and b/ss2.gif differ