Skip to content
This repository has been archived by the owner on Jun 11, 2022. It is now read-only.
bpm edited this page Dec 16, 2016 · 8 revisions

Welcome to the node-dota2 wiki!

Steps for approaching a problem

  1. Check the README to see if the action you wish to perform has documented methods
  2. If there are no documented methods, perform the action in the client to see if it is possible. (e.g. If you wanted to make a party, try doing it manually in the client first) If you can't do it manually, then it is extremely unlikely that you will be able to do it with this library.
  3. If you can do this action manually, run Nethook and reproduce the action manually. Somewhat like wireshark, Nethook records the messages sent between your client and Valve servers. Dota2 uses protobuf messages, so you must use Nethook to record these in a usable form. Skip down to the Nethook section to read about its usage.
  4. Record your list of messages, and match them up to library functions. If your messages do not match up to anything, then you will probably need to extend the library. Making a new issue in our github with the Nethook dump and a description of the messages used, will go a long way towards someone else deciding to help you implement them.

Using Nethook

Our thanks go to SteamRE and their wonderful project that makes this project easier / possible to maintain. Parts of the guide below are copied from their guide.

  1. Grab a copy of Nethook from https://github.com/SteamRE/SteamKit/tree/master/Resources/NetHook2 You will need to compile it yourself, or rely on their appveyor (refer to using appveyor section below) or this old pre-compiled version.
  2. Ensure Steam and Dota2 are running. (Additionally, make sure you're prepared for the possibility for Steam to crash. Using NetHook2 isn't an exact science, and sometimes things break.)
  3. Execute the following in an elevated command prompt: rundll32 "<Path To NetHook2.dll>",Inject
  4. If all goes well, you should see a console window appear with CCrypto lines, etc. If instead you see a failure message or your Steam process crashes, it's possible that an update to Steam may have broken one of NetHook2's binary signature scans and they will require updating. If you're on the beta branch of Steam, try using the non-beta version and vice versa. Additionally check to see if there's any recent NetHook2 related commits on our steamclient-beta branch. Provided everything successfully injected and hooked, NetHook2 will now begin dumping every message to file. You can locate the dumps in your Steam install, under the nethook directory. The directories are numbered with the unix time that dumping began.
  5. Manually perform the action you wish to use this library for. You should see something like nethook dumping
  6. Execute rundll32 "<Path To NetHook2.dll>",Eject. The console window will disappear and NetHook2 will eject itself from the running Steam instance.

Using Appveyor

Appveyor is a handy site that compiles projects. To grab a compiled Nethook2:

  1. Go to the latest build page latest_build
  2. Click on the "Configuration: Release" config_release
  3. Click on artifacts artifacts
  4. Click on the zip the_zip

Dealing with integers split between low and high values

You may encounter instances where the returned value arrives in the form of ["low":"12321312312,"high":"12312412414","signed":true]. Refer to this issue for instructions on dealing with them.

Clone this wiki locally