Disclaimer
This method does not work for all plugins and patched plugins might result in unexpected behavior and client crashes.
0. Prerequisites
I will use Ghidra in this tutorial.
1. Acquire the plugin
Download the correct version of the plugin you want to patch. If the plugin is distributed as .ts3_plugin
, rename that to .zip
and extract it. You will need one of the following files:
.dll
(Windows).dylib
(MacOS).so
(Linux)
2. Load the Plugin in Ghidra
Open Ghidra and if you don’t have one create a new project.
Drag and drop the plugin file onto the project to import it using the default values.
When you see the import results click OK
.
Open the plugin with a double click.
When asked whether to analyze the file accept Yes
, keep the Standard Defaults
, and click Analyse
.
Wait for the analysis to finish. There is a progress bar in the bottom right. Depending on binary size it might take a couple of minutes.
3. Patch the correct function.
Using the default layout of Ghidra there should be the Symbol Tree
on the left side.
Expand
Exports
and locate the function ts3plugin_apiVersion
.By clicking on it you can jump to it in the Listing.
Then in the
Decompile
view click on the return value to follow any internal function calls.Now right-click the value in the Listing and select
Patch Instruction
. You might see a popup telling you the x86 processors are gold-rated, just close that.Enter the new value you need in hexadecimal (API version 26 = 0x1a) and press Enter to accept.
Then you can export the changes. Simply keep the format as
Original File
and select a suitable output location.
Congratulations! You just patched your first plugin!
4. Repackage the plugin.
If you want to use the automatic TeamSpeak plugin installation process you can simply repackage the plugin the same way you extracted it.
In the end, you need a file that looks like this:
<plugin_name>.ts3_plugin (renamed zip file)
├─ plugins/
│ └─ <plugin_name>_win64.dll (or .so or .dylib)
└─ package.ini