Skip to content

Making the gamedata file using Automatic Sigscanning (linux)

dani edited this page Apr 16, 2022 · 2 revisions

If the Source Mod you're developing for, has function or symbol names, you can take advantage of a neat Source Mod feature that automatically gets the signatures for you.

Here's an example:

"Games"
{
  "cstrike"
  {
    "Signatures"
    {
      "RoundRespawn"
      {
        "library" "server"
        "windows" "\x56\x8B\xF1\x8B\x06\xFF\x90*\x04\x00\x00\x8B\x86*\x0D\x00"
        "linux"   "@_ZN9CCSPlayer12RoundRespawnEv"
      }
    }
  }
}

Making a gamedata file

In the directory sourcemod/gamedata/ make a file called abbrievation-of-your-mod.txt

  • For Pre-Fortress 2 we use pf2.txt
  • For Team Fortress 2 Classic they use tf2c.txt

The format should look like this:

"Games"
{
  "abbrievation-of-your-mod"
  {
    "Signatures"
    {

    }
  {
{

This should also be the same library name you use for making source mods like from the example on the PF2-Tools usage section

Retrieving the function names

To get function names you must first do a binary dump by doing the following command on Linux

objdump -d server.so > server.so.objdump

Open the .objdump file with a text editor and look for the function names you want to use.

Adding the function names for Linux/Mac/Posix

Once you find the function, copy and paste its name into the signature's area.

Write an @ followed by pasting in the signature.

  • Make sure it follows this structure below
"Signatures"
    {
      "FunctioNameYouWant"
      {
        "library" "server"
        "windows" "\x56\x8B\xF1\x8B\x06\xFF\x90*\x04\x00\x00\x8B\x86*\x0D\x00"
        "linux"   "@_ZN9CCSPlayer12FunctioNameYouWantEv"
      }
      "SomeOtherFunction"
      {
        "junkData" "dataJunk"
      }
    }

Additional reading

https://wiki.alliedmods.net/SDKTools_(SourceMod_Scripting)