C++: Making Bots

Sprouts

Regular Member
Joined
Mar 20, 2010
Messages
464
Reaction score
328
Can anyone recommend some books on learning how to make bots with C++. I've looked around and haven't found any good ones. I looked at tutorials on youtube but they mainly focus on console applications as oppose to using Visual Studio to create bots. The Visual Studio tutorials which do exist have very limited information on making bots and how to go about it.

Also, is C++ a fairly good language for creating bots - I want to automate web processes like making a bot which creates a squidoo lens for example. I'm quite familiar with PHP and someone I know suggested I look at C++ because the syntax is very similar.
 
Why on earth is everybody coming up with c++ for web related bots??
Always someone heared someone say this and that is best.
C++ is definately the wrong choice for MANY reasons.

Go for C#, get chilkat for socket based stuff and watin for browser based stuff, easypeasy.
 
I cant give any input on the first question but for:

Also, is C++ a fairly good language for creating bots

You can create bots in practically any language, from my experience I was able to get up and running small bots pretty fast with both c# and Java (both have a similar syntax to php) so unless there is a particular reason you want to use c++ I would have a look into them.

For my java bot I was using something called htmlunit which reduced the amount of development work I needed to do to considerably and I managed to get a basic register + post bot in a couple of hours.

Link for the htmlunit lib:
Code:
htmlunit.sourceforge (DOT) net/
 
Why on earth is everybody coming up with c++ for web related bots??
Always someone heared someone say this and that is best.
C++ is definately the wrong choice for MANY reasons.

Go for C#, get chilkat for socket based stuff and watin for browser based stuff, easypeasy.

How would you recommend starting out, is there a particular book you would recommend?
 
you can learn a programming language without spending money on a book. use google, and don't expect to find all the answers in once source/website. if your gonna spend money on a book, i would suggest a book that focuses more on programming methodologies instead of a specific language, because once you know how to use one language you can basically use them all.

learn how to program well, and your bots will be marketable and profitable as well as useful
 
I recommend one book that helped me greatly in my quest to learn about HTTP requests and responses from the programmer's point of view:
HTTP programming recipes for C# (Java) bots. However, it's available only for the C# and Java programming languages, but that's not necesarily a bad thing: C# and Java beat C/C++ any day of the week when it comes to designing web bots. All the examples in the book are clear and easy to understand, and you will find yourself progressing in the art of making web bots in no time.
 
IF you want to use c++ for creating bots, look on how to use winhttp library for the post and get. Trust me all those people that say, why use c++ dont know better. Sure development is faster, but once you can code in c++ you dont have all those annoying fucking dependencies issues. If you dont care about size and you want something that would run on any windows, then use code:blocks they compile everything you need inside and dont need any linked libraries like visual studio.
 
Do you intend to sell the bots? Or make them for your personal use?

In the second case PHP/Python are probably the best languages when it comes to learning curve.

If you want to sell them, however... Then coding in Java/C# will be faster, but reduce the price and the popularity of the software - people are picky when it comes to their CPU time, stability and security issues. Slower (code-wise) but better option is MFC - the learning curve will be slow, as in addition to C++ you'll need to learn the nuances of Microsoft Foundation Classes.
 
I created my bot using c++, it's not the best starting language but if you do learn it you should be able to understand other languages as well.
 
Do you intend to sell the bots? Or make them for your personal use?

In the second case PHP/Python are probably the best languages when it comes to learning curve.

If you want to sell them, however... Then coding in Java/C# will be faster, but reduce the price and the popularity of the software - people are picky when it comes to their CPU time, stability and security issues. Slower (code-wise) but better option is MFC - the learning curve will be slow, as in addition to C++ you'll need to learn the nuances of Microsoft Foundation Classes.

Actually if you intend to sell your bots DO NOT use java, it can easily be decompiled back into almost the original source code rendering any piracy countermeasures useless.
 
Actually if you intend to sell your bots DO NOT use java, it can easily be decompiled back into almost the original source code rendering any piracy countermeasures useless.

same goes for c# bots. if you are afraid of decompiling consider using native compiled language
 
I think to make a bot you should captalize on c# rather than c++. It's interface will be much more easier and also very user friendly too.
 
It is really good choice to use c# rather than c++ to do things like this. You will get some good environment and tools to use this.
 
Firstly I apologize for bumping this thread, but for the misinformation that is running rampant in this thread I feel it is justified.

Since it's much easier to get rid of the shortest list first, we will start with why C# is superior to C++ for this particular task: It takes less time to program a functional bot in C# than C++ (debugging in C++ is a pain in the ass). That is the only pro to choosing .NET over actual code.

Now for the part that will make you all mad:

C++ is faster (MUCH faster)
C++ isn't sandboxed
C++ can be used on any operating system (with different OS-specific API's, of course - and the problem with globalized code can be fixed easily with cross-platform frameworks such as QT by Nokia if you're concerned with a fancy GUI)
If you're doing any sort of memory reading or writing, C++ is superior since it has these fancy things called pointers. It also has support for inline assembly if you need to do any sort of low level stuff or are reversing a function and want to test pushing params to the stack to debug.
It is much easier to reverse any compiled application in .NET (C++ included), and C# is nothing BUT .NET. You can literally download a program and decompile someone else's application and view the raw source code.

The downside to C++ is that it takes a little bit of time to learn and can be exhausting to debug (I've spent HOURS debugging my code when all I was missing was a semi-colon!). However if you're committed to learning how to program in a low-level language, C++ is definitely the way to go. It's powerful, can be used in everything from console apps, server software, video games (and game hacks - which are fun as hell to make, by the way), and even native plugins for browsers (think Unity Player, Flash, DivX, etc).

I hope I've cleared some things up for you.

(Note to everyone reading this: If you feel I've provided false information in any way, shape, or form, please let me know. I try to be as unbiased as possible when giving advice to new programmers, however I personally favor C++ over ANYTHING .NET-related for the reasons stated above).
 
I also agree with you to some extent, c++ is indeed faster but it really depends on what you are doing as well, some things will have same performance, some awesome better performance and some will vary on a really small margin that won't even be a problem in most if not all cases.

C++ being cross plat ready is a plus but having it running on other plats is not as simple as it sounds either depends on modules youre using and other factors but in general compared to other languages its fairly easier to get a cross plat app done.

Reversing, I don't think harder or easier to decompile an application from asm to c# or w/e language, they can always be decompiled, read, cracked and what so ever.

In either cases, xor'ing, obfuscating, and several other ways will help you protect your IP however people with TIME, and I mean it PEOPLE with TIME on their hands can always crack, decompiile and whatever else with your application.

If your application is a hit, it may become target for the above mentioned and caution is never enough.
 
It's lot easier in C# /VB.net or in any higher level language than in C++. C++ is used for system side programming because of it's performance and lightning fast code execution. But for bots, all you need is a high level programs like C# because you'll get lot of libraries built-in and comes in handy for bots that works based on http request & response model. Though you can achieve the same using c++, it'll be lot harder to write everything from the scratch.
 
It's lot easier in C# /VB.net or in any higher level language than in C++. C++ is used for system side programming because of it's performance and lightning fast code execution. But for bots, all you need is a high level programs like C# because you'll get lot of libraries built-in and comes in handy for bots that works based on http request & response model. Though you can achieve the same using c++, it'll be lot harder to write everything from the scratch.

I am mainly a C# user however :P, C++ have plenty of libraries too do not underestimate it. For example you have libcURL with a c++ wrapper curlpp, cpp-netlib, you can make your own, POCO and more.
 
Back
Top