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

Posts 16–30 of 131 · Page 2 of 9
So can I use it and have the trading bot too that you made with the less CPU , if so please tell me how? , Thanks m8
Quote Originally Posted by citydrifter View Post
So can I use it and have the trading bot too that you made with the less CPU , if so please tell me how? , Thanks m8
You'll have to either wait for the next release or add all the trading packets and functions yourself.
Quote Originally Posted by citydrifter View Post
So can I use it and have the trading bot too that you made with the less CPU , if so please tell me how? , Thanks m8
Even when i finished putting the rest of the packets into this project, no because that plugin was created for k-relay. Or you are talking about PKTINOS's clientless tradebot, which is still no because that uses k-relay as the core and im not making a substitute for k-relay.


A trade bot can be make with this once i add the rest of the packets, but it would be different the the k-relay plugin i created.
Small update today.

I havent had as much time as i'd like to work on this the past few days, been very busy with work and after 8-10 hours of programming for work i often dont feel the desire to go home and do any programming just for fun.

Whats added:
- Added a few additional packets, you can make it shoot now if you want to
- Added an xml parser that ive used in the past and its extremely lightweight/simple to use
- Moved account info + desired server to separate XML file, so you can change account info without having to recompile now
- Added curl to the project, it now downloads the server list + your account info


The settings.xml file is part of the project, it gets copied to to output directory with the exe, as the exe needs to read it when it runs. The layout is:
Code:
<?xml version="1.0" encoding="utf-8"?>
<Config>
  <Server>SERVER_NAME</Server>
  <GUID>YOUR_EMAIL</GUID>
  <Password>YOUR_PASSWORD</Password>
</Config>
The server name has to be the full name (case sensitive). The settings.xml file in the project has "USWest" in the <Server> field right now if you dont feel like changing it.

To get this to compile you will need to download and get curl set up. I went with curl because i figured it would allow this to be cross-compiled easier then if i used a window's specific function (i was going to use URLDownloadToFile), and because curl has a url encoding function ("+" to "%2b" and whatnot).

 
Setting up curl on windows
I'll briefly go over how i set up curl for use with visual stuidos incase anyone else needs to:
1) download source .zip from https://curl.hax*****/download.html (direct link to file i downloaded)
2) Extract it wherever you want, open the extracted filed and locate the folder "winbuild".
3) Open text file "BUILD.WINDOWS.txt"
4) follow directions in text file! But incase you are too lazy, keep following my directions
5) Open Visual Studio's Developer Command Prompt
6) Navigate to the "winbuild" folder from the Developer cmd
7) type "nmake /f Makefile.vc mode=dll"
8) after it finishes, go to the parent directory of "winbuild" and find the folder "builds"
9) There were 3 folders inside this for me, but the folder you want should be named something like "libcurl-vc-x86-release-dll-ipv6-sspi-winssl"
10) copy that entire folder somewhere that it wont get deleted. I just copied it to "C:\libcurl-vc-x86-release-dll-ipv6-sspi-winssl"
11) Open the project properties and add "C:\libcurl-vc-x86-release-dll-ipv6-sspi-winssl\include" to projects additional include directories, add "C:\libcurl-vc-x86-release-dll-ipv6-sspi-winssl\lib" to additional lib directories, and add "libcurl.lib" to additional dependencies
12) You're done


Heres a quick video i created showing the bot reply to being whispered "shoot". I didnt even know that you can shoot 1 single projectile as a wizard, though it was always 2. Does it just automatically send 2 when you shoot as a wizard normally? lol. (im aware you can see the names in this video, both these accounts i created specifically for this video so i really dont care if they get reported)

(i didnt include this in the source attached, but all the code needed to do it is).



No exe include in download again, but here are the scans:
https://virusscan.jotti.org/en-US/fi...job/8o4ad43nub
https://www.virustotal.com/en/file/0...is/1486508792/


Edit: oh and as far as goals, im still hoping to have the rest of the packet classes created and added to this by the end of the week/weekend. I also want to add the objects.xml file to the project and parse it so i can use it for whatever is needed. I really really really need to create a "client" class soon so i dont keep creating a bunch of global functions and make the code all messy!! Thats about it for what i hope to have done soon.
Approved and added to main page
Very cool project




BTW Does anybody else get this exception randomly?
Quote Originally Posted by ~V~ View Post
BTW Does anybody else get this exception randomly?
Same here, ran great the first time but running it again it just crashes immediately.


Looks like it's trying to read from a null location even though the settings file is there. (Might be because the appspot xml is online rather than local, and settings can be different among accounts, ect)
Quote Originally Posted by Kushala Daora View Post
(Might be because the appspot xml is online rather than local, and settings can be different among accounts, ect)
You would think so, but the line you guys are both showing an error at is actually related to checking if the returned xml is an error message ("<Error>message</Error>") instead of a normal account xml. Which to mean would indicate the returned data isnt actually xml.

What is strange for me is ive run the code with a bunch of different account details (various mules) and havent had it crash for me on that line ever. I even tested with invalid details just now and it worked as it is meant to work, didnt crash.

If you want to debug, the first thing i would check is the url curl is trying to grab. Locate the curl_get function and add something like this above the curl_easy_perform():
Code:
printf("curl url = %s\n", url.c_str());
Then you can take the url it spits out and pull it up in your web browser. Id be interested to see what is getting returned.


edit: i guess the proper thing for me to do there would be to validate that it is xml being returned before attempting to read from that xml. So ill add that check in there now, but it still doesnt make too much sense that it wouldnt be xml getting returned.

edit2: so this would be the fix to prevent the program from crashing on you, but it still has me wondering what the url or the returned data you both got was. This fix just makes sure it is actual xml before it attempts to read it:
Code:
	IXMLResults xe;
	ICXMLNode xNode = IXMLDomParser().parseStringNonT(rawxml.c_str(), NULL, &xe);

	if (xe.errorCode != 0)
	{
		// Error parsing the xml
		printf("XML Parse Error: %s\n", IXMLPullParser::getErrorMessage(xe.errorCode));
		return;
	}

	// Check if the returned xml is an error
	if (strcmp(xNode.getName(), "Error") == 0)
	{
		printf("Error: %s\n", xNode.getText());
		return;
	}


edit3: Progress is slowly being made, handles reconnections now:
Quote Originally Posted by toddddd View Post
If you want to debug, the first thing i would check is the url curl is trying to grab. Locate the curl_get function and add something like this above the curl_easy_perform():
Code:
printf("curl url = %s\n", url.c_str());
Then you can take the url it spits out and pull it up in your web browser. Id be interested to see what is getting returned.
It sends request to /char/list with proper parameters and returns valid XML
Quote Originally Posted by ~V~ View Post
It sends request to /char/list with proper parameters and returns valid XML
Have it output the returned data as well, as a browser does a lot of things the curl request doesnt. Right below the curl_get call, do printf("rawxml = %s\n", rawxml.c_str());
Quote Originally Posted by toddddd View Post
Have it output the returned data as well, as a browser does a lot of things the curl request doesnt. Right below the curl_get call, do printf("rawxml = %s\n", rawxml.c_str());
It outputs valid XML (same as I get it in the browser) but for some reason xNode is null when crash happens

You can add me on D i s c o r d VoOoLoX#6237 so we don't spam this thread
Quote Originally Posted by ~V~ View Post


It outputs valid XML (same as I get it in the browser) but for some reason xNode is null when crash happens

You can add me on D i s c o r d VoOoLoX#6237 so we don't spam this thread
Thats really strange. I have no idea why that would be crashing then. I dont use disc or skype or anything really, but pm me if you need any help debugging it. I suggest adding the code in that i edited my post with, see if it outputs an error message and exits or if it doesnt flag an error at all.
Quote Originally Posted by toddddd View Post
Thats really strange. I have no idea why that would be crashing then. I dont use disc or skype or anything really, but pm me if you need any help debugging it. I suggest adding the code in that i edited my post with, see if it outputs an error message and exits or if it doesnt flag an error at all.
Ok I think I found what the issue is:

'PaymentData' tag has a line break just after the '<' on the closing tag

Quote Originally Posted by ~V~ View Post


Ok I think I found what the issue is:

'PaymentData' tag has a line break just after the '<' on the closing tag

Hmm try adding "#define APPROXIMATE_PARSING" to the top of the "IXMLParser.cpp" file. That is suppose to attempt to clean up bad xml (but it may end up creating more errors). Add that and recompile, and see if that fixes things or not.

edit: if that doesnt fix it, ill just add something to remove line-breaks since it should all be 1 line like you pointed out.
Quote Originally Posted by toddddd View Post
try adding "#define APPROXIMATE_PARSING"
That just makes it even worse, at least for me,
Posts 16–30 of 131 · Page 2 of 9

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?