# SmokeAPI
_Legit DLC Unlocker for Steamworks._
## ✨ Features
* `🔓` Emulate DLC ownership in legitimately owned games
* `🛅` Emulate Inventory item ownership
## 🔗 Links
* `📥` [Download the latest release](https://github.com/acidicoala/SmokeAPI/releases/latest)
* `🪧` [SmokeAPI forum topic](https://cs.rin.ru/forum/viewtopic.php?p=2597932#p2597932)
* `🗂️` [DLC Database](https://steamdb.info/)
## 📖 Introduction
### ❓ What is SmokeAPI?
SmokeAPI is a DLC unlocker for games that are _legitimately_ owned in your Steam account.
It attempts to fool games that use Steamworks SDK (Steamworks) into thinking that you own the game's DLCs.
However, SmokeAPI does not modify the rest of the Steamworks, hence features like multiplayer, achievements, and so on remain fully functional.
### ❔ Which games are supported?
Only games that use Steamworks SDK for the DLC ownership verification are supported.
Hence, if a game's installation directory does not contain any `steam_api.dll` or `steam_api64.dll` files then it's definitely not supported.
Even if a game uses Steamworks DLL, it's not guaranteed to be supported because each game might implement additional custom verification checks.
Therefore, **you have to first research the game's topic**, to see if it supports unlocking.
Additionally, there are several points to bear in mind when it comes to unlocking DLCs with SmokeAPI:
* SmokeAPI most definitely will not work with games that use 3rd party DRM, such as games from Ubisoft, Rockstar, etc.* SmokeAPI most likely will not work with games that use Denuvo SecureDLC.
* SmokeAPI is unlikely to unlock anything in Free-To-Play games since they typically store all player data on the corresponding game server and hence all the checks are server-side.
* SmokeAPI will not work with games that employ additional ownership protection or if the game is using alternative DLC verification mechanism.
* SmokeAPI is unlikely to work with games that use an anti-cheat, since they typically detect any DLL/EXE that has been tampered with. Sometimes it is possible to disable an anti-cheat, but that typically entails the loss of online capabilities. Search in the respective game topic for more information about how to disable anti-cheat.
* Some games include DLC files in their base game, regardless of whether you own the DLC or not. However, some games download additional DLC files only after a user has bought the corresponding DLC. In this case, not only will you need to install SmokeAPI, but you also have to get the additional DLC files from somewhere else and put them into the game folder. Up-to-date DLC files often can be found in corresponding game topics.
* Some games don't use any DRM at all, in which case SmokeAPI is useless. All you need to do is to download the DLC files and place them in the game folder.
## :shipit: Usage
> [!WARNING]
> Please proceed with usage at your own risk.
> Usage of this unlocker entails breaking one or more terms of service,
> which might result in a permanent loss of your account.
To use SmokeAPI, you need to install it into the game folder following the instructions below.
Once installed, SmokeAPI is automatically loaded by a game every time you launch the game.
SmokeAPI supports **2** installation modes: _Hook mode_ and _Proxy mode_.
### ↔️ Mode comparison
#### 🪝 Hook mode
- **Advantages**:
- Persists after game updates
- Can be loaded by other injectors
- Can sometimes bypass DLL integrity checks
- **Disadvantages**:
- Might need an additional DLL to get injected (like [Koaloader])
#### 🔀 Proxy mode
- **Advantages**:
- Guaranteed to load
- **Disadvantages**:
- Might need reinstallation aftera game update
My advice is to try installing the unlocker in hook mode first.
If it doesn't work, try installing it in proxy mode instead.
If that didn't work, refer to the _Troubleshooting_ section below.
## 🛠 Installation instructions
> [!NOTE]
> To determine the bitness of a game you can open _Task Manager_, navigate to _Details_ tab,
> right-click on the column headers, click _Select columns_, tick checkbox next to _Platform_ and click _OK_.
> This will allow you to see a game's bitness in the _Details_ tab while a game is running.
### 🪝 Hook mode
- Download the [latest SmokeAPI release zip].
- From this downloaded zip extract `smoke_api32.dll` or `smoke_api64.dll`, depending on a game's bitness.
- Rename the unzipped DLL to `version.dll` or `winhttp.dll` or `winmm.dll`.
- Place this `version.dll` or `winhttp.dll` or `winmm.dll` next to the game's `.exe` file.
#### 🪝 Hook mode with Koaloader
If a game doesn't load `version.dll` or `winhttp.dll` or `winmm.dll`, you can use an alternative injector to load
SmokeAPI into the game process.
One such injector is [Koaloader], which supports different DLLs that a typical game might load.
For example, assuming that the game loads `d3d11.dll`:
- Install Koaloader:
- Download the [latest Koaloader release zip].
- From this downloaded zip extract `d3d11.dll` from `d3d11-32` or `d3d11-64`, depending on a game's bitness.
- Place `d3d11.dll` next to the game's `.exe` file.
- Install SmokeAPI
- Download the [latest SmokeAPI release zip].
- From this downloaded zip extract `smoke_api32.dll` or `smoke_api64.dll`, depending on a game's bitness.
- Place `smoke_api32.dll` or `smoke_api64.dll` next to the game's `.exe` file.
#### 🪝 Hook mode with Special K
There are games which have extra protections that break hook mode.
In such cases, it might be worth trying [Special K], which can inject SmokeAPI as a [custom plugin].
### 🔀 Proxy mode
- Find a `steam_api.dll` or `steam_api64.dll` file in game directory, and rename it to `steam_api_o.dll` or `steam_api64_o.dll`.
- Download the [latest SmokeAPI release zip].
- From this downloaded zip extract `smoke_api32.dll` or `smoke_api64.dll`, depending on a game's bitness.
- Rename this extracted DLL to `steam_api.dll` or `steam_api64.dll`, depending on a game's bitness.
- Place this renamed unlocker DLL next to the `steam_api_o.dll` or `steam_api64_o.dll` file.
[latest SmokeAPI release zip]: https://github.com/acidicoala/SmokeAPI/releases/latest
[latest Koaloader release zip]: https://github.com/acidicoala/Koaloader/releases/latest
[Special K]: https://www.special-k.info
[custom plugin]: https://wiki.special-k.info/en/SpecialK/Tools#custom-plugin
## ⚙ Configuration
SmokeAPI does not require any manual configuration.
By default, it uses the most reasonable options and tries to unlock all DLCs that it can.
However, there might be circumstances in which you need more custom-tailored behaviour, such as disabling certain DLCs, or selectively enabling just a few of them.
In this case you can use a configuration file [SmokeAPI.config.json](res/SmokeAPI.config.json) that you can find here in this repository or in the release zip.
To use it, simply place it next to the SmokeAPI DLL.
It will be read upon each launch of a game.
The config file is expected to conform to the JSON standard. It is recommended to use a text editor with JSON schema supports. This greatly assists with editing since it warns not just about syntax errors, but also about invalid values. One such editor is [Visual Studio Code](https://code.visualstudio.com/).
VS Code demo
This example showcases how VS code highlights an invalid value and displays a list of valid values that are accepted.

Below you can find the detailed description of each available config option. In the absence of the config file, default values specified below will be used.
| Option | Description | Type | Default | Valid values |
|--------|-------------|------|---------|--------------|
| `logging` | Enables logging to SmokeAPI.log.log file. | Boolean | `false` | `true` or `false`. |
| `log_steam_http` | Toggles logging of SteamHTTP traffic | Boolean | `false` | `true` or `false`. |
| `default_app_status` | Specifies default DLC status. | String | `"unlocked"` | `"unlocked"` or `"locked"` or `"original"`. |
| `override_app_status` | Overrides the status of all DLCs that belong to a specified app ID. | Object | `{}` | An object with `"key": "value"` pairs, where key is App ID and value is App status. |
| `override_dlc_status` | Overrides the status of individual DLCs, regardless of the corresponding app status. | Object | `{}` | An object with `"key": "value"` pairs, where key is DLC ID and value is DLC status. |
| `auto_inject_inventory` | Specifies whether SmokeAPI should automatically inject a list of all registered inventory items, when a game queries user inventory | Boolean | `true` | `true` or `false`. |
| `extra_inventory_items` | A list of inventory item IDs that will be added in addition to the automatically injected items. | Array | `[]` | An array of integer App IDs. |
| `extra_dlcs` | See [Extra info](#-how-smokeapi-works-in-games-with-large-number-of-dlcs) to understand the use case for this option. | Object | `{}` | An object with `"key": "value"`, where the key is App ID and value is an object with `"dlcs"` property. See the complete example for more. |
Advanced options
[//]: # (Admonitions don't work inside collapsible spoilers on GitHub :/)
**NOTE**: These options do not affect the unlocker, and should be left unmodified. They serve as utilities for text or GUI editors.
| Option | Description | Type | Default | Valid values |
|--------|-------------|------|---------|--------------|
| `$schema` | URL of a JSON Schema that corresponds to this config. | String | [SmokeAPI.schema.json](res/SmokeAPI.schema.json) | URL to a valid SmokeAPI config JSON schema. |
| `$version` | Reserved for use by tools like GUI config editors. | Integer | `4` | Integer numbers from 1 and beyond. |
---
Below you can find an example config where nearly every option has been customized.
Complete example
```json
{
"$schema": "https://raw.githubusercontent.com/acidicoala/SmokeAPI/refs/tags/v3.1.5/res/SmokeAPI.schema.json",
"$version": 4,
"logging": true,
"log_steam_http": true,
"default_app_status": "unlocked",
"override_app_status": {
"1234": "original",
"4321": "unlocked"
},
"override_dlc_status": {
"1234": "original",
"4321": "unlocked",
"5678": "locked"
},
"auto_inject_inventory": true,
"extra_inventory_items": [
9876,
8765,
7654
],
"extra_dlcs": {
"1234": {
"dlcs": {
"56789": "Example DLC 1"
}
},
"4321": {
"dlcs": {
"98765": "Example DLC 2",
"98766": "Example DLC 3"
}
}
}
}
```
## 🎓 Extra info
### 🔑 How SmokeAPI works in games with large number of DLCs
Some games that have a large number of DLCs begin ownership verification by querying the Steamworks API for a list of all available DLCs.
Once the game receives the list, it will go over each item and check the ownership.
The issue arises from the fact that response from Steamworks SDK may max out at 64, depending on how much unowned DLCs the user has.
To alleviate this issue, SmokeAPI will make a web request to Steam API for a full list of DLCs, which works well most of the time.
Unfortunately, even the web API does not solve all of our problems, because it will return only DLCs that are available in Steam store.
This means that DLCs without a dedicated store offer, such as pre-order DLCs will be left out.
That's where the `extra_dlcs` config option comes into play.
You can specify those missing DLC IDs there, and SmokeAPI will make them available to the game.
However, this introduces the need for manual configuration, which goes against the ideals of this project.
To remedy this issue SmokeAPI will also fetch a manually maintained list of [extra DLCs] stored in a GitHub repository.
The purpose of that JSON file is to contain all the DLC IDs that are lacking a Steam store page.
This enables SmokeAPI to unlock all DLCs without any config file at all.
Feel free to report in the {forum-topic} games that have more than 64 DLCs,
_and_ have DLCs without a dedicated store page.
They will be added to the list of missing DLC IDs to facilitate config-less operation.
[extra DLCs]: https://github.com/acidicoala/public-entitlements/blob/main/steam/v2/dlc.json
## 🔧 Troubleshooting
### 🔐 DLCs are not unlocked
There are many reasons why the DLCs remain locked. In some games DLC unlocking is inherently impossible because of online-only state, profile, etc. In other cases it may be possible, but only after dealing with custom game checks. To learn about the specifics, consult the corresponding game topic in [the forum].
If you are sure that DLC unlocking in a targeted game is inherently possible, then you have to verify that installation was successful. To do that, add the unlocker's config file next to the unlocker DLL and enable logging in it. You should see a `*.log` file being generated upon the game launch, which could provide insight into what went wrong. Use this log file when requesting support in the forum. If after launching the game no `*.log` file was generated, then it means that installation was not performed correctly.
If you installed the unlocker via proxy mode, then make sure that you have renamed the unlocker DLL exactly like the original DLL and placed it exactly in its place. Also verify that the original DLL was renamed by adding `_o` at the end of the filename. Notice that the second symbol is a literal `o` (short for original), not a numeral zero `0`.
If you installed the unlocker via hook mode, then make sure that you have picked a compatible Koaloader DLL. Not all games will try to load `version.dll`, hence you need will need to try another. You can use [Process Monitor] to find out which Koaloader DLL is supported by a game, and where to place it. Click on the cyan funnel icon on the top to open filter editor, and add 3 filters (Process name, Result, and Path), as shown in the screenshot below. Launch the game with the Process Monitor active, and you should see DLLs that a game was trying to load from its directory.
Process Monitor screenshot

[the forum]: https://cs.rin.ru/forum/viewforum.php?f=10
[Process Monitor]: https://docs.microsoft.com/en-us/sysinternals/downloads/procmon
If you have made sure that you picked the right DLL for Koaloader, then try adding Koaloader's config file and enable logging in it. The log file from Koaloader can show if it was able to successfully load the unlocker DLL.
### 💥 The game is crashing
If the game is crashing or not opening as expected after installing an unlocker, then try to download and install the latest [Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017, 2019, and 2022](https://support.microsoft.com/en-gb/help/2977003/the-latest-supported-visual-c-downloads)
Download page

## 🏗️ Building from source
### ✔️ Requirements
- [CMake] v3.24 or newer (Make sure that cmake is available from powershell)
- [Visual Studio Build Tools 2022] with `Desktop Development for C++` workload installed
- Tested on Windows 11 SDK (10.0.26100.4188)
### 👨💻 Commands
Build the project
```powershell
.\build.ps1 $arch $config
```
where
| Variable | Valid values |
|----------|----------------------|
| $arch | `32` or `64` |
| $config | `Debug` or `Release` |
For example:
```powershell
.\build.ps1 64 Release
```
[Visual Studio Build Tools 2022]: https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022
[CMake]: https://cmake.org/
## 📚 Acknowledgments
This project makes use of the following open source projects:
- [richgel999/miniz](https://github.com/richgel999/miniz)
- [libcpr/cpr](https://github.com/libcpr/cpr)
- [nlohmann/json](https://github.com/nlohmann/json)
- [stevemk14ebr/PolyHook_2_0](https://github.com/stevemk14ebr/PolyHook_2_0)
- [gabime/spdlog](https://github.com/gabime/spdlog)
- [nsumner/cpp-tree-sitter](https://github.com/nsumner/cpp-tree-sitter)
- [tree-sitter/tree-sitter-cpp](https://github.com/tree-sitter/tree-sitter-cpp)
- [nemtrif/utfcpp](https://github.com/nemtrif/utfcpp)
- [microsoft/wil](https://github.com/microsoft/wil)
- [p-ranav/glob](https://github.com/p-ranav/glob)
- [pantor/inja](https://github.com/pantor/inja)
- [bshoshany/thread-pool](https://github.com/bshoshany/thread-pool)
- [batterycenter/embed](https://github.com/batterycenter/embed)
- [serge1/ELFIO](https://github.com/serge1/ELFIO)
## 📄 License
This software is licensed under the [Unlicense](https://unlicense.org),
terms of which are available in [UNLICENSE.txt](UNLICENSE.txt).
[Koaloader]: https://github.com/acidicoala/Koaloader