Unit 1: Part 1 Introduction and initial setup!
Before we start we need to ensure we have a few tools ready to use.. namely visual studio 2010!
Express is free but you can just as easily download the ultimate trial and then google a cd key (there i an unlimited use master key leaked)
Now, we have our editor that we can use but this won't help us unless we know what we're doing!
Visual studio allows you to open project files and then browse, edit and compile them into a working exe file to execute your code. I've posted the initial source code which will save you all LOTS of time and knowledge and start diving right into the 'good stuff'.
Now, for those who haven't done anything with coding before, you should read a few links or else you will run into all sorts of issues.
ASK YOURSELF THESE QUESTIONS BEFORE YOU CONTINUE!
-What types of data is there? (ints, bools, strings, etc... no fine knowledge needed)
-What is a loop (while/for loops)
-What is an if statement (if, else if, else)
-What is a switch statement (not high importance but nice knowledge
-What is a collection (array, list, dictionary, etc)
-What is a method
-What is a return type
-What is enumeration
-What is a packet
There are a few other questions we could add to this list but these are terms you should be at least generally familiar with.
If you have no idea what we're talking about for any of the above questions... read some of these threads.
-Coding guides by the fantastic Hybrid
-C# for dummies e-book
-Introduction and links related to proxies/packets
I strongly recommend having a quick read through all of the above links even if you already have some basic knowledge, it will just give you that bit of extra 'edge' when it comes to understanding what comes next.
Now, we're ready to open up our project file!
Extract the uploaded source and simply run ProxyParadise.sln in order to load up visual studio and load the solution. We now have access to all the .cs files that it contains which will allow us to view what's already written!
I've written a very basic windows form into the proxy for convenience but right now it doesn't actually 'do' anything. What we DO have though is full solutions for sockets and encryption which allows us to fully log into tq servers using conquerloader.
<<SETUP>>
Right click on GUI.cs and click 'view code' or double click it to view the designer and then push F7. All the main code is inside this file right now. This could be organized in a much nicer way but for now it's a small enough program that it doesn't make much difference.
WHEN DESIGNING PROGRAMS YOU SHOULD BE THINKING OF LONG TERM ORGANIZATION RATHER THAN SHORT TERM READABILITY.
Something may be very simple to find and edit when your project consists of say... 500 lines but try finding the same method when you reach 20,000 lines of code.... it becomes incredibly annoying very quickly. You can mitigate this challenge by creating well named folders and sub folders to keep your cs files organized and by splitting up all your handlers, calculations, packet structures and bot codes into their own .cs files.
Now, back to the setup! Right now it's using my own information and not loading anything from external... so why don't we start by configuring it manually and then for our first mini project we'll deal with external configuration files.
[INSIDE GUI.CS]
//We read this from returned packets, this is why it's blank
public static string GameIP = "";
//This could be read from returned packets but for now I hard coded it
public static ushort GamePort = 5816;
//This is the TQLOGIN server ip address. I found this by using a simple network trafic monitor to see where the client tried to connect to first.
public static string AuthIP = "208.96.34.46";
//This is the PROXY ip, we modify the auth response packet so that the client will connect to the PROXY rather then the server.
public static string ProxyIP = "5.1.98.6";
//We can find this from the client quite simply but it hasn't changed in many, many patches. If you want to bot on a pserver, try pulling this first!
public static string EncryptionKey = "DR654dt34trg4UI6";
All you really need to edit for this is the ProxyIP.
[WARNING] Do NOT use 127.0.0.1 as your proxy ip, it will crash the client! You should be using a hamachi, network or external ip address (hamachi is the most foolproof method)
Now, lets do a quick test to make sure we can login before we do anything further.
Edit the ProxyIP as needed and debug the source to make it build a new .exe file. F6 works just fine. We should now see a nice GUI window as well as a debugging console (not needed, just makes testing things much simpler. I despise always having to deal with GUI input/output just for simple tests.)
If you're using windows XP I strongly recommend just... throwing out your ancient computer and get a new one... I've heard nothing but issues with people using conquerloader on windows xp. Download and extract conquerloader into your conquer install directory.
NOTE: some virus scanners won't like it... make sure you add an exception (this is important, if not it won't work)
Now you want to open up your Loader settings and edit the ip address to your proxy ip. Load up Conquerloader.exe and try logging in. it should work just fine but if you experience any issues (not related to loaders or anything like that) then feel free to post in the thread and I will add to this section... It's a very simple setup process though and I doubt anyone will have serious issues.
If you can fully log into the server just double check the bot console window just to double check that the loader is working correctly (it should show Connection/Disconnection msgs in the window, nothing fancy but lets you know things are working properly)
Now we can worry about continuing on to more advanced stuff.
Topics for Unit 1 Part 2:
(feel free to suggest more)
-Reading external data! (Settings files!)
-Writing to external files (Saving logs!)
-Setting up new functional GUI features!
This will take us through some basic programming concepts and get us ready for starting in on packets knowledge (structuring and eventually using packets to perform bot actions)