top of page

Dota 2 Overlay: Putting it all together

Retrieving data from the website:

We've covered everything that we need to create the overlay and extract data. The last piece of the puzzle is sending the hero IDs to a website and retrieving the results . I ended up choosing https://www.dotaedge.com/ since it has an easy format for sending arguments. e.g, https://dotaedge.com/edge/29,19,108,64,37/22/-1/edge/1000/9999/last_month will return an html page containing the counters to hero IDs 29,19,108,64 and 37. We need to parse this page to extract the needed data. The code is a little verbose so I will not post it here, you can view the function in question here.

Here is the application in action:

General overview of the program:

I've tried to chalk up a simple overview of the application. You can get the code from here

Debugging the program:

I copy my assets and the output d3d9.dll into the "build/$(Platform)/$(Configuration)" directory. (For e.g, build/x64/Release) through a custom build step. You could copy it to the game directory directly for convenience; I did not opt for that because I did not want to run the risk of having those files there when I was playing Dota on my main steam account. In order to debug the DLL like you would any executable application through Visual Studio, you can manually attach to dota2.exe after launching it, or you can go to your project properties and change the "Command" field under "Configuration Properties->Debugging" to point to the game executable.

Is it safe?

I've used it multiple times without repercussions, so I am fairly certain that it is safe to use. We're only reading memory, after all. That being said, I am no expert on anti-cheating measures, so use at your own risk.

Potential Improvements:

There is a lot of room for improvement.

- Address offsets need to be re-calculated after each patch. Could potentially be automated? Another alternative would be to use image processing to figure out the hero picks on the pick screen.

- I haven't messed around too much with the UI dimensions, placing UI elements is a very manual process at the moment.

- Animations could be added to the UI.

Final thoughts:

While this approach is great in order to learn more about the inner workings of programs, you have to do everything yourself. A more efficient alternative would be https://www.overwolf.com/ (haven't looked into it too well myself but it appears promising). It exposes game data to your application through logs and image processing, so you can use it without risking a ban.


Comments


bottom of page