# plexmediaserver_crack

Unlocking *most features* on (hardware transcoding, intro/credit detection, HEVC transcoding, etc..) on Plex Media Server. Including Plex Pass features without a required subscription, and including early-access/development/Plex Ninja features. Some features are exempt (check the Windows source code for reference).

# Installation

## Windows

Note: x86-64 only. If your Plex Media Server is in "Program Files (x86)", it's an indicator of running the 32-bit version of Plex Media Server, which is not supported.

1. Download `IPHLPAPI.dll` from [the latest release](https://gitgud.io/yuv420p10le/plexmediaserver_crack/-/raw/master/binaries/IPHLPAPI.dll) and put it in your Plex Media Server's installation folder. (e.g. `C:\Program Files\Plex\Plex Media Server`)
2. Restart Plex Media Server. All features will be unlocked.
3. For persistence with updates (as long as the crack doesn't break as a result of them), set the file as read-only.

## Linux

x86-64 only.

### Native

Install `patchelf`. Can be done either via `pip` or your distribution's package manager.

```sh
sudo apt update && sudo apt install patchelf # Debian/Ubuntu/etc
sudo pacman -S patchelf # Arch
sudo yum install patchelf # Fedora/RHEL/Centos/Rocky/OpenSUSE/etc
sudo apk update && apk add --upgrade patchelf # Alpine
sudo pip install patchelf # pip; you might need --break-system-packages if installing if you're on an externally managed environment
```

The script assumes Plex Media Server is currently running.

Run the following command:

```bash
sudo sh -c "$(curl -sSL https://gitgud.io/yuv420p10le/plexmediaserver_crack/-/raw/master/scripts/crack_native.sh)"
```

Your Plex Media Server should now be restarted with all features unlocked.

For persistance with Plex updates, create the above as a bash script (run as root!) and run it manually (or, trigger it) after updates or run it as a daily cronjob.

### Docker

First, install a static build of `patchelf`:

```bash
sudo pip install patchelf # pip; you might need --break-system-packages if installing if you're on an externally managed environment

# Install from provided binaries
wget https://github.com/NixOS/patchelf/releases/download/0.18.0/patchelf-0.18.0-x86_64.tar.gz -O /tmp/patchelf.tar.gz && \
    mkdir /tmp/patchelf && \
    tar -xvzf /tmp/patchelf.tar.gz -C /tmp/patchelf && \
    sudo cp -r /tmp/patchelf/ / && \
    rm -rf /tmp/patchelf
```

Installing `patchelf` from your distribution's package manager will provide you with a dynamically linked binary, which may fail if your Docker image has a too old version of glibc/glibcxx. You can try going with that approach, but do not ask for support if it doesn't work.

Tested on [linuxserver/docker-plex](https://github.com/linuxserver/docker-plex), but should work for all Docker setups.

The script assumes Plex Media Server is currently running, that you have a mounted `/config` volume in the container, and that your container is named `plex`.  
If your container is named differently or if your external volume is mounted elsewhere, change it at the top of the script instead of running it through this command.

Run the following command: (you can emit `sudo` if the executing user is in the `docker` group)

```bash
sudo sh -c "$(curl -sSL https://gitgud.io/yuv420p10le/plexmediaserver_crack/-/raw/master/scripts/crack_docker.sh)"
```

Your Plex Media Server should now be restarted with all features unlocked.

This will NOT persist through Docker image updates, as rebuilding the container will copy libraries freshly from the image.  
Setup the above commands as a script for an easy installation, and optionally, set it as a cronjob to run daily.

### Building

#### Windows

Build using Visual Studio 2022, C++20. You need [Zydis](https://github.com/zyantific/zydis).

#### Linux

[linuxserver/docker-plex](https://github.com/linuxserver/docker-plex)'s image uses GLIBC 2.35, and Debian stable (bookworm, as of now) is at 2.36. Use a host with an older version to build (e.g. Debian Bullseye.. or an Alpine container with older glibc such as 2.26).

`git` `cmake` `make` and a C++ compiler (tested with clang++) required.

```bash
git clone https://gitgud.io/yuv420p10le/plexmediaserver_crack.git && \
    cd plexmediaserver_crack/linux && \
    cmake . && \
    make
```

Alpine:

```Dockerfile
FROM alpine:3.18
RUN apk --no-cache add wget ca-certificates libstdc++
ARG APK_GLIBC_VERSION=2.26-r0
ARG APK_GLIBC_FILE="glibc-${APK_GLIBC_VERSION}.apk"
ARG APK_GLIBC_BIN_FILE="glibc-bin-${APK_GLIBC_VERSION}.apk"
ARG APK_GLIBC_BASE_URL="https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${APK_GLIBC_VERSION}"
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \
    && wget "${APK_GLIBC_BASE_URL}/${APK_GLIBC_FILE}" \
    && apk --force-overwrite --no-cache add "${APK_GLIBC_FILE}" \
    && wget "${APK_GLIBC_BASE_URL}/${APK_GLIBC_BIN_FILE}" \
    && apk --no-cache add "${APK_GLIBC_BIN_FILE}" \
    && rm glibc-*
RUN apk add --no-cache cmake make gcc g++ bash
WORKDIR /src
```

```bash
docker build -t glibc .
docker run --rm -v plexmediaserver_crack/linux:/src:rw glibc bash -c "mkdir -p build && cd build && cmake .. && make && chmod -R 777 /src/build"
# Binary will be in plexmediaserver_crack/linux/build/plexmediaserver_crack.so
```

`plexmediaserver_crack.so` should now appear in the same directory. Refer to the `scripts/crack_native.sh` or `scripts/crack_docker.sh` scripts to see how it's installed.

### Troubleshooting

* For intro/credit detection, go to Settings -> Library -> Marker source; and select the "local detection only" option.
* If hardware transcoding (or any other feature) does not work, it should not be related to this repository. Use Google to troubleshoot why said feature doesn't work on your setup specifically.
* The "Skip Intro" button will not be displayed on clients that don't have the Plex Pass. It's a client sided limitation. I wrote a crack for the Plex client on Windows to circumvent it, at [plexpass_hook](https://gitgud.io/yuv420p10le/plexpass_hook). The "Skip Credits" button will appear on all clients, including the free ones.

### Screenshots

![](https://i.imgur.com/6LGkLcm.png) ![](https://i.imgur.com/su02dh3.png)  
![](https://i.imgur.com/sSysxcq.png)