2021-01-17 03:51:22 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, pkg-config, ncurses, readline, pcsclite, qt5
|
2020-01-01 19:11:38 +00:00
|
|
|
, gcc-arm-embedded }:
|
2019-04-06 12:51:22 +00:00
|
|
|
|
2020-01-01 19:11:38 +00:00
|
|
|
let
|
|
|
|
generic = { pname, version, rev, sha256 }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
inherit pname version;
|
2019-04-06 12:51:22 +00:00
|
|
|
|
2020-01-01 19:11:38 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Proxmark";
|
|
|
|
repo = "proxmark3";
|
|
|
|
inherit rev sha256;
|
|
|
|
};
|
|
|
|
|
2021-01-17 03:51:22 +00:00
|
|
|
nativeBuildInputs = [ pkg-config gcc-arm-embedded ];
|
2020-01-01 19:11:38 +00:00
|
|
|
buildInputs = [ ncurses readline pcsclite qt5.qtbase ];
|
2019-04-06 12:51:22 +00:00
|
|
|
|
2021-01-12 11:50:23 +00:00
|
|
|
dontWrapQtApps = true;
|
|
|
|
|
2020-01-01 19:11:38 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace client/Makefile --replace '-ltermcap' ' '
|
|
|
|
substituteInPlace liblua/Makefile --replace '-ltermcap' ' '
|
|
|
|
substituteInPlace client/flasher.c \
|
|
|
|
--replace 'armsrc/obj/fullimage.elf' \
|
|
|
|
'${placeholder "out"}/firmware/fullimage.elf'
|
|
|
|
'';
|
2019-04-06 12:51:22 +00:00
|
|
|
|
2020-01-01 19:11:38 +00:00
|
|
|
buildPhase = ''
|
|
|
|
make bootrom/obj/bootrom.elf armsrc/obj/fullimage.elf client
|
|
|
|
'';
|
2019-04-06 12:51:22 +00:00
|
|
|
|
2020-01-01 19:11:38 +00:00
|
|
|
installPhase = ''
|
|
|
|
install -Dt $out/bin client/proxmark3
|
|
|
|
install -T client/flasher $out/bin/proxmark3-flasher
|
|
|
|
install -Dt $out/firmware bootrom/obj/bootrom.elf armsrc/obj/fullimage.elf
|
|
|
|
'';
|
2019-04-06 12:51:22 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-01-01 19:11:38 +00:00
|
|
|
description = "Client for proxmark3, powerful general purpose RFID tool";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://www.proxmark.org";
|
2020-01-01 19:11:38 +00:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
maintainers = with maintainers; [ fpletz ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
proxmark3 = generic rec {
|
|
|
|
pname = "proxmark3";
|
|
|
|
version = "3.1.0";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1qw28n1bhhl91ix77lv50qcr919fq3hjc8zhhqphwxal2svgx2jf";
|
|
|
|
};
|
2019-04-06 12:51:22 +00:00
|
|
|
|
2020-01-01 19:11:38 +00:00
|
|
|
proxmark3-unstable = generic {
|
|
|
|
pname = "proxmark3-unstable";
|
|
|
|
version = "2019-12-28";
|
|
|
|
rev = "a4ff62be63ca2a81071e9aa2b882bd3ff57f13ad";
|
|
|
|
sha256 = "067lp28xqx61n3i2a2fy489r5frwxqrcfj8cpv3xdzi3gb3vk5c3";
|
2019-04-06 12:51:22 +00:00
|
|
|
};
|
|
|
|
}
|