-
Notifications
You must be signed in to change notification settings - Fork 0
/
binaryninja.nix
111 lines (105 loc) · 2.72 KB
/
binaryninja.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
{
pkgs,
lib ? pkgs.lib,
buildFHSEnv ? pkgs.buildFHSEnv,
writeScript ? pkgs.writeScript,
stdenv,
}: let
binaryNinja = with pkgs;
stdenv.mkDerivation rec {
version = "4.1.5129";
pname = "binary-ninja";
# src = /nix/store/a0hgfba2ppclbvshv1rwgjraikspa17q-binary-linux-personal.zip;
src = /nix/store/zkcalrkagpxrrrf6bf40k0dp3ad21vc0-binaryninja_personal_linux.zip;
# desktopItems = [
# (makeDesktopItem {
# name = pname;
# desktopName = "binaryninja";
# exec = "binaryninja";
# icon = pname;
# categories = ["Utility"];
# })
# ];
nativeBuildInputs = with pkgs.xorg; [
autoPatchelfHook
copyDesktopItems
dbus
fontconfig
glib
libGL
makeWrapper
qt6.full
qt6.qtbase
qt6.wrapQtAppsHook
stdenv.cc.cc.lib
unzip
wayland
xorg.libXi
libXcursor
xorg.libXrender
];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
mkdir -p $out/opt
cp -r * $out/opt
chmod +x $out/opt/binaryninja
install -Dm644 ./docs/img/logo.png $out/share/icons/hicolor/512x512/apps/${pname}.png
makeWrapper $out/opt/binaryninja \
$out/bin/binaryninja \
--prefix "QT_QPA_PLATFORM_PLUGIN_PATH" ":" "$out/opt/" \
--set LD_LIBRARY_PATH $out/opt:$NIX_LD_LIBRARY_PATH
# --prefix "QT_XKB_CONFIG_ROOT" ":" "${xkeyboard_config}/share/X11/xkb"\
# --prefix "QT_DEBUG_PLUGINS" ":" "1" \
runHook postInstall
'';
meta = with lib; {
homepage = "binary.ninja";
description = "Reverse Engineering in Style";
platforms = platforms.linux;
license = licenses.unfree;
sourceProvenance = with sourceTypes; [binaryNativeCode];
};
};
in
buildFHSEnv {
name = "binaryninja";
targetPkgs = pkgs:
with pkgs; [
dbus
fontconfig
freetype
libGL
libxml2
libxkbcommon
# python311
(python311.withPackages (ps:
with ps; [
pypresence
z3-solver
frida-python
frida-tools
angr
]))
# frida-tools
z3
xorg.libX11
xorg.libxcb
xorg.xcbutilimage
xorg.xcbutilkeysyms
xorg.xcbutilrenderutil
xorg.xcbutilwm
wayland
zlib
gdb
];
runScript = writeScript "binaryninja.sh" ''
set -e
exec "${binaryNinja}/bin/binaryninja"
# exec "/opt/binaryninja/binaryninja"
'';
meta = {
description = "BinaryNinja";
platforms = ["x86_64-linux"];
};
}