-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
proxmark3.rb
99 lines (83 loc) · 3.25 KB
/
proxmark3.rb
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
class Proxmark3 < Formula
desc "RRG/Iceman Proxmark3 client, CDC flasher and firmware bundle"
homepage "http://www.proxmark.org/"
url "https://github.com/RfidResearchGroup/proxmark3/archive/refs/tags/v4.19552.tar.gz"
sha256 "43f0f5ddbbca478c5be33a6392847a99e2fda47b0a2d21e89fed4a918808f405"
head do
if ENV.has_key?('HOMEBREW_TRAVIS_COMMIT')
url "https://github.com/RfidResearchGroup/proxmark3.git", :branch => "#{ENV['HOMEBREW_TRAVIS_BRANCH']}", :revision => "#{ENV['HOMEBREW_TRAVIS_COMMIT']}"
else
url "https://github.com/RfidResearchGroup/proxmark3.git"
end
end
depends_on "readline"
depends_on "coreutils"
depends_on "lua" => :build
depends_on "pkg-config" => :build
depends_on "openssl@3" => :build
depends_on "qt@5" => :recommended
depends_on "[email protected]" => :build
depends_on "gd" => :recommended
depends_on "openssl" => :recommended
depends_on "rfidresearchgroup/proxmark3/arm-none-eabi-gcc" => :build
option "with-blueshark", "Enable Blueshark (BT Addon) support"
option 'with-generic', 'Build for generic devices instead of RDV4'
option 'with-small', 'Build for 256kB devices'
FUNCTIONS = %w[em4x50 felica hfplot hfsniff hitag iclass iso14443a iso14443b iso15693 legicrf lf nfcbarcode zx8211]
STANDALONE = {
'lf' => %w[em4100emul em4100rswb em4100rsww em4100rwc hidbrute hidfcbrute icehid multihid nedap_sim nexid proxbrute prox2brute samyrun tharexde],
'hf' => %w[14asniff 14bsniff 15sniff aveful bog cardhopper colin craftbyte iceclass legic legicsim mattyrun mfcsim msdsal reblay tcprst tmudford unisniff young]
}
FUNCTIONS.each do |func|
option "without-#{func}", "Build without #{func.upcase} functionality"
end
option 'without-standalone', 'Build without standalone mode'
STANDALONE.each do |freq, modes|
modes.each do |mode|
option "with-#{freq}-#{mode}", "Build with standalone mode #{freq.upcase}_#{mode.upcase}"
end
end
def install
ENV.deparallelize
args = %W[
BREW_PREFIX=#{HOMEBREW_PREFIX}
PLATFORM=#{build.with?('generic') ? 'PM3GENERIC' : 'PM3RDV4'}
]
args << 'PLATFORM_EXTRAS=BTADDON' if build.with? 'blueshark'
args << '
PLATFORM_SIZE=256
STANDALONE=
SKIP_HITAG=1
SKIP_LEGICRF=1
SKIP_EM4x50=1
SKIP_ICLASS=1
SKIP_FELICA=1
SKIP_HFPLOT=1
SKIP_HFSNIFF=1
SKIP_NFCBARCODE=1
SKIP_ZX8211=1
' if build.with? 'small'
args << 'SKIPQT=1' unless build.with? 'qt5'
FUNCTIONS.each do |func|
args << "SKIP_#{func.upcase}=1" unless build.with? func
end
standalone = build.with?('standalone') ? nil : ''
STANDALONE.each do |freq, modes|
modes.each do |mode|
if build.with? "#{freq}-#{mode}"
odie 'Only one standalone mode may be selected' unless standalone.nil?
standalone = "#{freq.upcase}_#{mode.upcase}"
end
end
end
args << "STANDALONE=#{standalone}" unless standalone.nil?
system "make", "clean"
system "make", "all", *args
system "make", "install", "PREFIX=#{prefix}", *args
ohai "Install success!"
ohai "The latest bootloader and firmware binaries are ready and waiting in the current homebrew Cellar within share/firmware."
end
test do
system "proxmark3", "-h"
end
end