If your cracked version of the game doesn't provide steam_api.dll, then you have to get it from the cracking group "eXe CORE". If you register, you can be immediately redirected to the section where you can download the steam_api.dll. Keep in mind that cracking software often modify the steam_api.dll (eg. by adding registry keys). You might need to register again (eg. if you have deleted your local profile directory).
I do not recommend using cracked versions of the game when downloading patches from GOG or Steam, since I can't verify the integrity of the files. Plug-ins (eg. font-tweaks) and the like might not work correctly with cracked versions of the game.
The steam_api.exe is an optional executable file. When installed it will register its EXE location with Steam setup, so that other third-party applications can make use of the steam API. When run, it will retrieve the required steam_api.dll.
If the steam_api.exe is missing or corrupted, Steam setup will register the game's executable with Steam setup. Steam setup will then make an attempt to install the steam_api.exe, but without the steam_api.dll. In this case, Steam setup will refuse to install the game (due to missing executable/DLL dependency).
When the steam_api.exe is missing but the steam_api.dll is present, it will check if Steam setup was added to the list of registered executables. If the steam_api.exe isn't on the list but the steam_api.
This error message may occur when the application believes it can be called with a different handle value than the existing handle. Please refer to the following page for more information related to handle values: d2c66b5586