holy moly cracked davinci 3.1 WITH THE FFMPEG ENCODER

This commit is contained in:
2026-06-25 13:24:40 +01:00
parent 9956f91fce
commit 96f546b1b4
3 changed files with 49 additions and 58 deletions

1
.gitignore vendored
View File

@@ -1 +1,2 @@
/result /result
/.session

33
flake.lock generated
View File

@@ -1,56 +1,39 @@
{ {
"nodes": { "nodes": {
"mesa-davinci": {
"locked": {
"lastModified": 1754501210,
"narHash": "sha256-ahTHrGs72TLVcNUR2VHckEx+t6frke0e/Ptk6AaEINk=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "599ddd2b79331c1e6153e1659bdaab65d62c4c82",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "599ddd2b79331c1e6153e1659bdaab65d62c4c82",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1770841267, "lastModified": 1782233679,
"narHash": "sha256-9xejG0KoqsoKEGp2kVbXRlEYtFFcDTHjidiuX8hGO44=", "narHash": "sha256-QyuGP5+QOtmXpy4i2X4DhBVBaySBdDKQEhqKcphcp34=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "ec7c70d12ce2fc37cb92aff673dcdca89d187bae", "rev": "667d5cf1c59585031d743c78b394b0a647537c35",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixos-26.05",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "ec7c70d12ce2fc37cb92aff673dcdca89d187bae",
"type": "github" "type": "github"
} }
}, },
"nixpkgs-pinned": { "nixpkgs-pinned": {
"locked": { "locked": {
"lastModified": 1760578826, "lastModified": 1772567409,
"narHash": "sha256-xOV1r5omtsfyPqlgxgDDuO0szHuj9BBTbaTQHgF+CAY=", "narHash": "sha256-qspxGige37s/66q9sptyG5VA/l2IOmMMZVJ4Xhta2wU=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "497ee3c70707fd71b45c37d48ae1d45e79751047", "rev": "e4ec59bc1152b09a4843702e4a49381194f065a2",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "497ee3c70707fd71b45c37d48ae1d45e79751047", "rev": "e4ec59bc1152b09a4843702e4a49381194f065a2",
"type": "github" "type": "github"
} }
}, },
"root": { "root": {
"inputs": { "inputs": {
"mesa-davinci": "mesa-davinci",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-pinned": "nixpkgs-pinned" "nixpkgs-pinned": "nixpkgs-pinned"
} }

View File

@@ -2,14 +2,14 @@
description = "A flake for DaVinci Resolve Studio with FFmpeg encoder plugin and patches"; description = "A flake for DaVinci Resolve Studio with FFmpeg encoder plugin and patches";
inputs = { inputs = {
# Main nixpkgs input # Main nixpkgs input (NixOS 26.05)
nixpkgs.url = "github:NixOS/nixpkgs/ec7c70d12ce2fc37cb92aff673dcdca89d187bae"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
# Pinned nixpkgs input for DaVinci Resolve Studio # Pinned nixpkgs input exclusively for the raw DaVinci Resolve Studio binary
nixpkgs-pinned.url = "github:NixOS/nixpkgs/497ee3c70707fd71b45c37d48ae1d45e79751047"; nixpkgs-pinned.url = "github:NixOS/nixpkgs/e4ec59bc1152b09a4843702e4a49381194f065a2";
# Custom mesa input # Custom mesa input
mesa-davinci.url = "github:nixos/nixpkgs?ref=599ddd2b79331c1e6153e1659bdaab65d62c4c82"; # mesa-davinci.url = "github:nixos/nixpkgs?ref=599ddd2b79331c1e6153e1659bdaab65d62c4c82";
}; };
outputs = outputs =
@@ -17,27 +17,28 @@
self, self,
nixpkgs, nixpkgs,
nixpkgs-pinned, nixpkgs-pinned,
mesa-davinci, # mesa-davinci,
... ...
}@inputs: }@inputs:
let let
system = "x86_64-linux"; system = "x86_64-linux";
lib = nixpkgs.lib; lib = nixpkgs.lib;
# Import main pkgs with unfree allowed # Import main pkgs (NixOS 26.05)
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
config.allowUnfree = true; config.allowUnfree = true;
}; };
# Import pinned pkgs with unfree allowed # Import pinned pkgs (Used *only* to fetch the unpatched binary)
pkgs-pinned = import nixpkgs-pinned { pkgs-pinned = import nixpkgs-pinned {
inherit system; inherit system;
config.allowUnfree = true; config.allowUnfree = true;
}; };
mesa-good-pkg = mesa-davinci.legacyPackages.${system}.mesa; # mesa-good-pkg = mesa-davinci.legacyPackages.${system}.mesa;
# Built using NixOS 26.05
ffmpeg-encoder-plugin = pkgs.stdenv.mkDerivation (finalAttrs: { ffmpeg-encoder-plugin = pkgs.stdenv.mkDerivation (finalAttrs: {
pname = "ffmpeg-encoder-plugin"; pname = "ffmpeg-encoder-plugin";
version = "1.2.1"; version = "1.2.1";
@@ -62,11 +63,13 @@
let let
davinci-patched = davinci-patched =
let let
# ONLY this specific line touches the pinned repository
davinci-locked = pkgs-pinned.davinci-resolve-studio; davinci-locked = pkgs-pinned.davinci-resolve-studio;
in in
davinci-locked.davinci.overrideAttrs (old: { davinci-locked.davinci.overrideAttrs (old: {
postInstall = '' postInstall = ''
${old.postInstall or ""} ${old.postInstall or ""}
# Patched using 26.05 perl tools
${lib.getExe pkgs.perl} -pi -e 's/\x74\x11\xe8\x21\x23\x00\x00/\xeb\x11\xe8\x21\x23\x00\x00/g' $out/bin/resolve ${lib.getExe pkgs.perl} -pi -e 's/\x74\x11\xe8\x21\x23\x00\x00/\xeb\x11\xe8\x21\x23\x00\x00/g' $out/bin/resolve
${lib.getExe pkgs.perl} -pi -e 's/\x03\x00\x89\x45\xFC\x83\x7D\xFC\x00\x74\x11\x48\x8B\x45\xC8\x8B/\x03\x00\x89\x45\xFC\x83\x7D\xFC\x00\xEB\x11\x48\x8B\x45\xC8\x8B/' $out/bin/resolve ${lib.getExe pkgs.perl} -pi -e 's/\x03\x00\x89\x45\xFC\x83\x7D\xFC\x00\x74\x11\x48\x8B\x45\xC8\x8B/\x03\x00\x89\x45\xFC\x83\x7D\xFC\x00\xEB\x11\x48\x8B\x45\xC8\x8B/' $out/bin/resolve
${lib.getExe pkgs.perl} -pi -e 's/\x74\x11\x48\x8B\x45\xC8\x8B\x55\xFC\x89\x50\x58\xB8\x00\x00\x00/\xEB\x11\x48\x8B\x45\xC8\x8B\x55\xFC\x89\x50\x58\xB8\x00\x00\x00/' $out/bin/resolve ${lib.getExe pkgs.perl} -pi -e 's/\x74\x11\x48\x8B\x45\xC8\x8B\x55\xFC\x89\x50\x58\xB8\x00\x00\x00/\xEB\x11\x48\x8B\x45\xC8\x8B\x55\xFC\x89\x50\x58\xB8\x00\x00\x00/' $out/bin/resolve
@@ -80,12 +83,13 @@
''; '';
}); });
in in
# Sandbox framework evaluated entirely against NixOS 26.05
pkgs.buildFHSEnv { pkgs.buildFHSEnv {
inherit (davinci-patched) pname version; inherit (davinci-patched) pname version;
targetPkgs = targetPkgs =
pkgs: inner-pkgs:
with pkgs; with inner-pkgs;
[ [
alsa-lib alsa-lib
aprutil aprutil
@@ -111,21 +115,21 @@
python3.pkgs.numpy python3.pkgs.numpy
udev udev
xdg-utils xdg-utils
libICE libice
libSM libsm
libX11 libx11
libXcomposite libxcomposite
libXcursor libxcursor
libXdamage libxdamage
libXext libxext
libXfixes libxfixes
libXi libxi
libXinerama libxinerama
libXrandr libxrandr
libXrender libxrender
libXt libxt
libXtst libxtst
libXxf86vm libxxf86vm
libxcb libxcb
xcbutil xcbutil
xcbutilimage xcbutilimage
@@ -135,9 +139,10 @@
xkeyboardconfig xkeyboardconfig
zlib zlib
rocmPackages.clr.icd rocmPackages.clr.icd
mesa
] ]
++ [ ++ [
mesa-good-pkg # mesa-good-pkg
davinci-patched davinci-patched
]; ];
@@ -146,12 +151,14 @@
''; '';
extraBwrapArgs = [ extraBwrapArgs = [
''--bind "$HOME"/.local/share/DaVinciResolve/Extras ${davinci-patched}/Extras'' # 1. Mount the Extras folder cleanly to the user's home directory
# "--dir" ''--bind "$HOME"/.local/share/DaVinciResolve/Extras /Extras''
# "/opt/resolve/IOPlugins"
# "--ro-bind" # 2. Let bubblewrap safely create the required bundle subdirectory inside the existing structure
# "${ffmpeg-encoder-plugin}" "--dir /IOPlugins/ffmpeg_encoder_plugin.dvcp.bundle/Contents/Linux-x86-64"
# "/opt/resolve/IOPlugins/ffmpeg_encoder_plugin.dvcp.bundle"
# 3. Mount the built plugin file directly into its bundle location
"--ro-bind ${ffmpeg-encoder-plugin}/ffmpeg_encoder_plugin.dvcp /IOPlugins/ffmpeg_encoder_plugin.dvcp.bundle/Contents/Linux-x86-64/ffmpeg_encoder_plugin.dvcp"
]; ];
runScript = "${lib.getExe pkgs.bash} ${pkgs.writeText "davinci-wrapper" '' runScript = "${lib.getExe pkgs.bash} ${pkgs.writeText "davinci-wrapper" ''