Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

Interacting with Dota2Cheat

ExistedGit edited this page Jun 6, 2023 · 5 revisions

Updating

There may come a time where I won't update this cheat/SDK anymore. Or not that quick, at least. That is when YOU'll need to take the responsibility and make a change! Let's go over the steps on your way to greatness:

Signatures & vtable indices

I usually leave a note near the signature/index constant that tells how to find it. I recommend preserving the IDA database for the previous version of a DLL to have something for comparison(sometimes you just don't have xrefs).

The signatures in the cheat are based. JSON-based.

The format of the JSON signatures is as such:

  "CDOTAGCClientSystem__SendReadyUpMessageForCurrentLobby": { // Signature name as defined in SDK/Signatures.h (needs to be bound in code)
    "signature": "E8 ? ? ? ? 48 8B D7 48 8B CB E8 ? ? ? ? 48 8D 8B", // signature itself
    "module": "client.dll", // DLL in which it's scanned for
    "steps": [ // optional array of two-element arrays that tell to do additional operations on the found address
      // The first number is the operation type, the second one is the value
      [ 0, 1 ], // 0 is GetAbsoluteAddress, this one will result in addr.GetAbsoluteAddress(1, 5)
      [ 1, 638 ], // 1 is Offset, will result in addr.Offset(638)
      [ 0, 1 ]
    ]
  }

So, in essence, it means "Scan for CDOTAGCClientSystem__SendReadyUpMessageForCurrentLobby in client.dll with the specified signature, then get the absolute address at offset 1(call opcode), go 638 bytes forward and get the absolute address with offset 1 again".

If you want to also make them, so to say, cloud-based, uncomment the #define D2C_USE_CLOUD_SIGNATURES in dllmain.cpp. With it, the cheat will download the signatures.json from the main branch of this very repository. Not particularly convenient, but when did I ever ask "why not"?

Structures

Here I can't do anything for you, you'd have to figure out which structure broke and what changed. Use ReClass.NET and may the Force be with you.

Protobufs

Put this PowerShell script into a .ps1 file, edit variables inside to appropriate paths and execute(if it doesn't copy the compiled files to $LibraryPath, copy them manually)

Netvars

This repo includes a project called PudgeDumper. Build in any configuration and use some injector to inject DLL. It will dump everything to Documents/PudgeDumper, where there will be the full class dump sorted by DLLs. Also Netvars.h will be generated.

Replace Netvars.h in Dota2Cheat with the generated one. Sometimes netvars get removed and you'll have to fix errors regarding that.

If you want to add a class to Netvars.h, simply add another SchemaDumpToMap argument in Source.cpp

Assets

Dota2Cheat uses a ghetto method for drawing ability/item icons, loading them from files that are extracted from VPK. Open pak01_dir.vpk(in steamapps\common\dota 2 beta\game\dota) in Valve Resource Viewer and Extract & Decompile the the needed folders. Then put the contents of the decompiled folders tto assets/ in this repo's folder according to the following map. Dota2Loader will update them when launched

Which VPKs correspond to which assets/ entries:

  • panorama/images/items => items
  • panorama/images/spellicons => spellicons
  • panorama/images/heroes/icons => heroicons
Clone this wiki locally