![]() |
|
[.NET] How to write a silent miner and code a builder for it - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [.NET] How to write a silent miner and code a builder for it (/showthread.php?tid=4126792) Pages: Pages
1
2
|
How to write a silent miner and code a builder for it - Statement - Mar 21, 2014 Welcome. Today I will show you how to write your own silent bitcoin miner. Also I will show you how to code a builder for this miner, so that you don't need to recode every single bin. Please note, that we'll not code a miner itself. We'll write an application which downloads CGMiner and launches it with the appropiate commands. Everything happens silent. My previous tutorials Spoiler (Click to View) How2: Writing a Silent Bitcoin Miner + Builder At first I want to say, that I don't want to see and silent bitcoin miners out there on the marketplace with this source code. Just don't do it. Please. Anyways, I assume that you all have Visual Basic.NET (everything above 2005) installed and know how to do at least basic stuff with it. Otherwise, you may not understand this tutorial. So, let's begin. Create a new project (windows forms) for your miner, as you would do it for every other application. Then, add the following elements to it: • Button (Text: "Build") • TextBox (Text: "Pool + Port") • TextBox (Text: "Worker Username") • TextBox (Text: "Worker Password") • Everything other, what you'd like to add to your layout. This will do the basic layout for our application. ![]() Now we gonna code the source code for the silent miner itself. You'll need a webspace (+ FTP) for this. If you don't have a FTP, please get a free webspace at SPAM or other free hosting companies. For tutorials on FTP servers please refer to other tutorials. Also, you can find the CGMiner files here. Just download the newest version (4.1 at the moment). We won't write this code into our 'normal' code tab. As we want to do a builder for our silent miner, we have to write the code external. To do so, click on Project on the very top, then on (Your project name) properties. Now click on Ressources on the left. Press CTRL + 5 (this will switch to the file ressources), then click on the arrow on the right to "Add a resource", then on "Add a textfile". Name it "Source". Here we will write our code. I'll provide you the full code, it's commented. Code Imports Microsoft.VisualBasicIf you have any questions about this code, feel free to ask. Now you have a layout of your builder and a textfile filled with code - but they don't have any connections! Let's change this. Get back to your windows form (the builder) and doubleclick on the "Build" button. Insert this code, it's commented too. You'll get errors, no worry, we'll fix them in a few minutes! Code Dim Pool$ = poolTxt.Text 'Defines our pool & portNow you will most likely get an error on "Compile". That's because we did not write this function yet! Insert this code after "Public Class Form!": Code Private Sub Compile(ByVal ExecutableName As String, ByVal SourceCode As String)Code Imports System.CodeDom.CompilerYou may have noticed, you may have not, but we're done now! Launch your application by pressing F5 and insert your pool + worker info. Then click on "Build". The My Miner.exe will be at the location where your project files are stored (if you can't find it, just search for the file My Miner.exe with the Windows search function) Done! Save everything and you'll have your very own silent bitcoin miner! * - Nikey646 - Mar 21, 2014 Fairly sure this won't work...lol Code Shell(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\cgminer.exe -o " & URL & " -u " & Pass & " -p " & Pass, AppWinStyle.Hide)Also, do everyone a favor, and remove the center alignment? That was PAINFUL to read, because it was center aligned.... Also, didn't look very hard, but it appears that you do not mention how to find the files that need to be downloaded.... * - Cesar Morales - Mar 21, 2014 I like the idea behind this thread; unfortunately this would be considered a, "dropper" though. Which is highly detected at todays' standards in the AV world. Things that would be needed to make this capable of being sold would be things such as, RunPE, encryption, FUD, persistence, Preferably a language that is not .NET *, Ufasoft mining engine, a single executable file, etc. Nonetheless, this is still a great thread for those whom need a place to start. -Astro * - nathan72389 - Mar 21, 2014 oh look, another noob kid using a console application then just hiding the window. how about this.... since you dont need a console window, MAKE AN APP WITHOUT THE WINDOW!@!!!!@@!@ ps, all that shit at the start of your thread is so fucking small its barely readable. and the center alignment makes this whole thread look retarded. * - Statement - Mar 21, 2014 (Mar 21, 2014 08:43 AM)Aѕtro Wrote: I like the idea behind this thread; unfortunately this would be considered a, "dropper" though. Which is highly detected at todays' standards in the AV world. NeonMine (my free silent miner on here) uses the same code and it's fully undetected. And yea, that's just an example of how something like this works and how a builder is made. (Mar 21, 2014 08:40 AM)Nikey646 Wrote: Fairly sure this won't work...lol To the last point: Yep, whoops, forgot to provide a link to CGMiner lol. Will edit the post in a few minutes. And why shouldn't this work? It works fine for me. (Mar 21, 2014 08:57 AM)nathan72389 Wrote: oh look, another noob kid using a console application then just hiding the window. oh look, another bullshitter member hating on other people's code. Why should I make an application without a window? It works and is silent. Everythings works as it should. So I don't see a reason in going detours when I just could do it like this. ps, I edited it already. I can do the text xx-large for you if you want to. Seriously, don't flame on the thread, give constructive critism instead on just hating. * - Nikey646 - Mar 21, 2014 (Mar 21, 2014 08:58 AM)Clanky Wrote: To the last point: Yep, whoops, forgot to provide a link to CGMiner lol. Will edit the post in a few minutes. And why shouldn't this work? It works fine for me. Oh, it may have something to do with <_< >_> Code "-u " + Pass + " -p " + Pass* - Statement - Mar 21, 2014 Lol. Fucked that up, now I see it haha! I'll change it tomorrow on OP, I'm on my mobile atm. * - Yui Asuna - Mar 21, 2014 (Mar 21, 2014 08:58 AM)Clanky Wrote: Why should I make an application without a window? It works and is silent You just loose all credibility as a programmer. Your code sucks so bad, it shouldn't even be posted here ._. You are just teaching bad habits. It's not only because it works that way that it should be done that way... "CheckForIllegalCrossThreadsCall = false" works. Good ? NO "On Error Resume Next" works. Good ? NO ! "Msgbox" works. Good ? NO !!1!!1 * - Statement - Mar 23, 2014 These are my coding habits and I never wanted to learn other habits, as it works. I mean, do you really think, that i.e. big companies want to have the best code style? The end customer does not look for code styles, he's looking for a working application. And that's the same here. "On Error Resume Next" might be not the best solution, that's true, but the other stuff is just coding style. * - Vysse - Mar 23, 2014 I really wanted to say good things about this thread but your arrogance prevents me from doing so. * - Statement - Mar 23, 2014 Sorry if I'm appearing arrogant for you, that's just my opinion on this. It's okay if you think that these are bad habits, but I never told anyone that he should copy my code completely. It was supposed as a tutorial, not as a code dump or something. * - Qmz_ - Mar 23, 2014 NO NO NO NO NO. This is not how to code a silent miner. This is how you download a file to HDD, and execute it with arguments. Anyone who does it like this is a moron. * - Cesar Morales - Mar 23, 2014 (Mar 23, 2014 12:14 PM)Qmz_ Wrote: NO NO NO NO NO. I partially agree with this statement... I don't agree with the "moron" part though. The tutorial itself is decent - the fact that it is a copy and paste format I don't like. If anything, it being a dropper is not very good. Your executable may be FUD/UD, but the files that it (the .exe) drops are not going to be FUD, and highly detected... thus removed. Making the miner itself not functional. -Astro (Mar 23, 2014 12:09 PM)Clanky Wrote: Sorry if I'm appearing arrogant for you, that's just my opinion on this. It's okay if you think that these are bad habits, but I never told anyone that he should copy my code completely. It was supposed as a tutorial, not as a code dump or something. It is okay that it is your opinion... everyone it entitled to one no matter what. It is good to be open-minded though... and that is not arguable. -Astro * - Kruimeltaart - Mar 23, 2014 I know have a better concept of things, thanks bro and the people that commented. Im taking notes :) * - palkarz - Apr 28, 2014 Code is more than shtty talk :) - good job man !!!! |