about summary refs log tree commit diff
path: root/pkgs/by-name/un/unhide-gui/package.nix
blob: a8c988ee6d2d1576edf0ab2e4971e6467a3ecf3b (plain) (blame)
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
{
  fetchFromGitHub,
  lib,
  python3Packages,
  unhide,
}:

python3Packages.buildPythonApplication rec {
  pname = "unhide-gui";
  version = "20220611";
  format = "other";

  src = fetchFromGitHub {
    owner = "YJesus";
    repo = "Unhide";
    rev = "v${version}";
    hash = "sha256-v4otbDhKKRLywH6aP+mbMR0olHbW+jk4TXTBY+iaxdo=";
  };

  propagatedBuildInputs = with python3Packages; [ tkinter ];

  buildInputs = [ unhide ];

  postPatch = ''
    substituteInPlace unhideGui.py \
      --replace-fail "\This" "This" \
      --replace-fail "__credits__" "#__credits__" \
      --replace-fail "./unhide-linux" "${unhide}/bin/unhide-linux" \
      --replace-fail "./unhide-tcp" "${unhide}/bin/unhide-tcp"
  '';

  installPhase = ''
    runHook preInstall

    mkdir -p $out/{bin,share/unhideGui}
    cp -R *.py $out/share/unhideGui

    runHook postInstall
  '';

  fixupPhase = ''
    runHook preFixup

    makeWrapper "${python3Packages.python.interpreter}" "$out/bin/unhideGui" \
      --set PYTHONPATH "$PYTHONPATH" \
      --add-flags "$out/share/unhideGui/unhideGui.py"

    runHook postFixup
  '';

  meta = {
    description = "Forensic tool to find hidden processes and TCP/UDP ports by rootkits, LKMs or other hiding technique";
    homepage = "https://github.com/YJesus/Unhide";
    changelog = "https://github.com/YJesus/Unhide/blob/${src.rev}/NEWS";
    license = lib.licenses.gpl3Only;
    maintainers = with lib.maintainers; [ tochiaha ];
    mainProgram = "unhide-gui";
    platforms = lib.platforms.all;
  };
}