[c/c++] Clientless (Work in Progress)

Posts 1–15 of 131 · Page 1 of 9
[c/c++] Clientless (Work in Progress)
Ive been interested in making something clientless for awhile now, and i also wanted to get back to my preferred language of C/C++ instead of C# or all the Java ive seen around.

Wasnt really sure where to post this, but just wanted to throw what i have sofar up here incase anyone else is interested.

So just to go over some things here:
- This is no where near completed. It is still missing a bunch of the packets and there is almost no functionality to it at the moment other then logging in.
- No config file/runtime input right now (plan to do this in the future). Right now it requires the email/password AND characterId to be hardcoded into the source. Oh and server ip.
- I went with the OpenSSL library to handle all the encryption related functions (RSA/Base64/RC4), it seems to be the standard and was pretty easy to setup compared to some of the other 3rd party libraries i saw out there.
- I believe the only acknowledgement packets this doesnt send right now are related to enemyshoot/allyshoot or whatever it is. It does send updateack/gotoack/move/aoeack/pong packets right now whenever it gets their counterpart packet.
- Still a long way to go before this will really do anything fun, it is a work in progress though.
- I havent tried to leave this running for more then 10 minutes currently, obviously it might get dc'ed if it doesnt sent all the acknowledgements packets when it is suppose too, so if you do get this running (as is) it probably will dc'd eventually.


Anyways, ive been working on this in my spare time while at work for the past week or so. My main resource has been just decompiling the game client and looking over that to see how it handles thing. If i wasnt sure of something i would then go to the k-relay source. Unfortunately there hasnt been any c/c++ stuff for rotmg for a long long time. The only c/c++ resource i found was Oryx-Hates-C, and that was 1) horribly outdated, and 2) didnt really see anything useful in it.

I did attempt to look over the code released by BotMaker, but that euphoria language is...not euphoric lol. It did help me a little bit though at understanding how to get started.


If you do get this running, the only thing it does right now other then connect to the server and login currently is auto-reply "it works!" if you whisper the bot.




I also left it running for about 10 minutes and monitored the cpu&memory from the task manager (i use a laptop, so no fancy hardware or anything):


Over the 10 minute period the cpu % would go as high as %0.3 and i even saw it drop down to %0.0 a few times lol. The memory seemed to fluctuate between 1.2MB and 1.3MB, HOPEFULLY that means there arent any memory leaks...which memory leaks are a pain in the ass with c/c++ so it would be great if ive managed to avoid them sofar.




Well thats all for now. Ill continue to update this post as i get more stuff added to this. It will be a long long time before any sort of public program is released with this source (im not even sure what i want to make this do yet). If anyone has questions feel free to ask, ill do my best to answer!

ps: no exe in attached source, just visual studio's project file + source. But just incase here are the scans:
https://virusscan.jotti.org/en-US/fi...job/8o4ad43nub
https://www.virustotal.com/en/file/0...is/1486508792/
20170207_Clientless_mpgh.net_mpgh.net.zip107 KB · 198 downloads Clean
Seems interesting, I'll definitely take a look at this
Looks good.

Approved
Is this native Cpp? or Visual Cpp?
Since you already implemented most of the important acknowledgements, why not reply to enemyshoot with shootack, to be ready to enter realms without dc'ing after a couple seconds?

Also dc'ing and sending hello to a new IP when reconnect is received is useful if you havent already set that up.

Other than that, nice job.
Quote Originally Posted by New View Post
Is this native Cpp? or Visual Cpp?
Since you already implemented most of the important acknowledgements, why not reply to enemyshoot with shootack, to be ready to enter realms without dc'ing after a couple seconds?

Also dc'ing and sending hello to a new IP when reconnect is received is useful if you havent already set that up.

Other than that, nice job.
If by Visual Cpp you mean MFC or whatever, no. This is regular old C/C++. I programmed it on windows using Visual Studios, but it can be compiled with any compiler and would be extremely simple to allow it to be cross-compiled with linux as well. I would just have to change the winsock header to be <sys/socket.h> or whatever linux is (havent done c/c++ on linux in awhile), and a few other small tweaks.
I dont think ive ever actually looked into Visual C++/MFC, it always seemed....wrong....to me.


As far as the enemyshoot/shootack goes, right now it doesnt have either of those packets programmed in yet. It doesnt take very long to get it added though. Once i got the first few packets created, and then after changing the way i wanted to handle packets a few times, i can now setup a packet structure pretty fast. I was going to add all the packets before releasing this, but i figured i might as well release now and update as i go since this is just a side project im playing around with on my free time. It could be a few days or it could be a week before i have time to work on this again, it just depends on how busy i am. So i wanted to get this posted so other can play around/look at it in the meantime.


I havent set up reconnect handling yet, so thanks! Ill have to keep that in mind when im working on that part of everything
Quote Originally Posted by toddddd View Post
If by Visual Cpp you mean MFC or whatever, no.
I mean C++/CLI. Which isn't terrible, it has garbage collection amongst other things, but if you would aim for garbage collection, you would as well go for clientless with C#/VB.NET
Quote Originally Posted by New View Post
I mean C++/CLI.
Interesting, the name CLI sounds familiar, but i have never looked at it or know anything about it. Judging from the wiki link, no i am not using CLI or anything like that. Just your standard c++.


Quote Originally Posted by New View Post
it has garbage collection amongst other things, but if you would aim for garbage collection, you would as well go for clientless with C#/VB.NET
Yeah having to handle garbage collection is one of the most annoying aspects of c/c++.

My only C# experience has been playing around with k-relay/plugins recently, before any of those i had only glanced over a few tutorials of C#. It looked fairly similar to C++ so seemed like it would be pretty easy to pick up if i ever needed to, and from what i have done recently its been pretty simple. VB.NET i believe i took a year of that when i was a freshmen in highschool 10ish year ago, such a simple language. But i am not a fan of it at all. C/C++ i am all self taught, i got interested in it when i was about 8 or 9, would go checkout books at the library on it, did any and every tutorial i could find online, i love c/c++. It can be a pain in the ass, but that just makes it feel all the more rewarding when you actually get something to work the way you planned.
Quote Originally Posted by toddddd View Post
Interesting, the name CLI sounds familiar, but i have never looked at it or know anything about it. Judging from the wiki link, no i am not using CLI or anything like that. Just your standard c++.




Yeah having to handle garbage collection is one of the most annoying aspects of c/c++.

My only C# experience has been playing around with k-relay/plugins recently, before any of those i had only glanced over a few tutorials of C#. It looked fairly similar to C++ so seemed like it would be pretty easy to pick up if i ever needed to, and from what i have done recently its been pretty simple. VB.NET i believe i took a year of that when i was a freshmen in highschool 10ish year ago, such a simple language. But i am not a fan of it at all. C/C++ i am all self taught, i got interested in it when i was about 8 or 9, would go checkout books at the library on it, did any and every tutorial i could find online, i love c/c++. It can be a pain in the ass, but that just makes it feel all the more rewarding when you actually get something to work the way you planned.
C++/CLI is just a c++ specification that compiles down to IL and runs on the CLR (the same runtime as C#, F#, VB). It's cool in the sense that it's managed C++, but I don't know why you would bother if you can just use C# or F# and have it run on the same runtime.

About your project, this is cool
You should make it a library for the core networking and object structures so people can make easy use of it if they prefer the native approach
Thanks for the release. I'm currently working on my own proxy in pure C and this will help me out a lot.

Would be neat if you threw this onto a github repo and let other people do some pr's.
Quote Originally Posted by krazyshank View Post
You should make it a library for the core networking and object structures so people can make easy use of it if they prefer the native approach
Thats something i could look into in the future i suppose, thanks!



Quote Originally Posted by Kushala Daora View Post
Thanks for the release. I'm currently working on my own proxy in pure C and this will help me out a lot.

Would be neat if you threw this onto a github repo and let other people do some pr's.
Cool its nice to hear there are other C/C++ projects going on. One of the reasons i wanted to get this posted so soon before its finished is to help anyone who is trying to figure out how to do some of the harder/less common thing in C/C++ that tend to be easy in other languages, like the RSA/base64/rc4 encryptions took me awhile to get working correctly. And other languages these days seem to have most of these encryptions built in, or easy to use lol.

As for github, i do plan to put this up on github once i have a little more done. I wanted to get the rest of the packet classes built before i put this on github, im aiming for sometime next week on that.
Quote Originally Posted by toddddd View Post
I did attempt to look over the code released by BotMaker, but that euphoria language is...not euphoric lol.
Made me smile. I took a look at it as well and almost instantly scrapped the idea of getting anything out of it.
Quote Originally Posted by CrazyJani View Post
Made me smile. I took a look at it as well and almost instantly scrapped the idea of getting anything out of it.
Yup that was pretty much the same thing i did. Im pretty sure those files have "ew" as a suffix for a reason, maybe its some cruel joke by the language creator: "Im going to make a language so ugly and horrific that all the files will end with 'ew', but ill trick people by calling it Euphoria!" lol
Damn man! Im inpressed. I wanted to get into c++ but just couldnt be bothered. I might expand this. I recommend you opening a github repository, so cummunity ( if there is people that are willing to help ( which is rare these days)) could cntribute.

Edit: me trying to get this working

Edit2: can you help me with OpenSSL? Where did you download it from? Did you install it? How do i make it work :P
it says that im missing file "openssl/opensslconf.h"

Edit3: Thanks to @Kushala Daora i got openssl to work!
If anyone else is having issues with openssl, follow along.

First, google "windows openssl" and click the result from shining light productions.
Next, download the 32 and 64 bit installers for openssl 1.0.2 as 1.1.0 has different binaries. (download the 20+mb installers)
Install both and try recompiling with visual studio, it should automatically link with openssl.
Yes thank you Kushala Daora for posting how to download OpenSSL. OpenSSL is needed for all the encryption in this project.


Just to put down some updates and plans:
- ive added a few more packet classes and will probably get that up for download soon so other people can use them (though if you look over the code, it should be fairly easy to see how to put the packet classes together)
- I played around with movement and watched as my bot moved around the game, dc'ing when he tried to walk into a wall lol. But for anyone who is playing with this code, at this stage it can easily be used as a spam bot (ewww) or you can have it move around screen. When i release the next packet classes you would be able to make it shoot as well.
- Im hoping to get the rest of the packets finished in this upcoming week, and try to handle all ack packets correctly
- I also am going to add a xml parser to the project so i can download the server/list character info, as well as allowing resources/config to be external instead of internal (ive used tinyxml in the past and will probably use that as long as it does everything i need)

Once i get the packet classes finished i will throw this up on my github (i have one right now but nothing related to rotmg at all on it).

If anyone has question feel free to ask/post/whatever. Im just glad to see this project has interest, that will keep me from dropping it.
Posts 1–15 of 131 · Page 1 of 9

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?