Created
September 10, 2024 20:00
-
-
Save zommiommy/df0bc65f970a692e824d18ad81dbbe21 to your computer and use it in GitHub Desktop.
Nix-shell that can run idapro 9.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> {} }: | |
let | |
idaProPath = "$PWD"; # Adjust this to your IDA Pro installation path | |
idaExecutable = "${idaProPath}/ida64"; # Adjust if needed for different executables | |
fhsEnv = pkgs.buildFHSUserEnv { | |
name = "ida-pro-env"; | |
targetPkgs = pkgs: (with pkgs; [ | |
glibc | |
libGL | |
libGLU | |
stdenv.cc.cc.lib | |
zlib | |
glib | |
xorg.libxcb | |
xorg.libX11 | |
xorg.libXi | |
xorg.libXrender | |
xorg.libXcursor | |
xorg.libXrandr | |
xorg.libXcomposite | |
xorg.libXext | |
xorg.libXfixes | |
xorg.libXinerama | |
xorg.libXau | |
xorg.libXdmcp | |
xorg.libxkbfile | |
xorg.libSM | |
xorg.libICE | |
libxkbcommon | |
fontconfig | |
freetype | |
libxml2 | |
libxslt | |
libuuid | |
dbus | |
qt5.qtbase | |
qt5.qtwayland | |
xorg.xcbutilwm | |
xorg.xcbutilimage | |
xorg.xcbutilkeysyms | |
xorg.xcbutilrenderutil | |
]); | |
runScript = "bash"; | |
}; | |
in | |
pkgs.mkShell { | |
buildInputs = [ fhsEnv ]; | |
shellHook = '' | |
export IDA_PRO_PATH="${idaProPath}" | |
# Patch the IDA Pro executable to use the correct dynamic linker | |
if [ -f "${idaExecutable}" ]; then | |
echo "Patching ${idaExecutable} to use ${pkgs.stdenv.cc.bintools.dynamicLinker}" | |
${pkgs.patchelf}/bin/patchelf --set-interpreter "${pkgs.stdenv.cc.bintools.dynamicLinker}" "${idaExecutable}" | |
else | |
echo "Warning: IDA executable not found at ${idaExecutable}" | |
fi | |
echo "IDA Pro environment set up." | |
echo "To run these commands within the FHS environment, use:" | |
echo "ida-pro-env -c './ida64'" | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment