-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzipcracker.sh
More file actions
executable file
·39 lines (34 loc) · 856 Bytes
/
zipcracker.sh
File metadata and controls
executable file
·39 lines (34 loc) · 856 Bytes
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
#!/bin/bash
case "$1" in
build)
echo "[*] building with optimizations..."
GOAMD64=v3 go build -ldflags="-s -w" -gcflags="-l=4" -o zipcracker main.go
if [ $? -eq 0 ]; then
echo "[+] build ok"
ls -lh zipcracker | awk '{print "[*] size: " $5}'
else
echo "[-] build failed"
exit 1
fi
;;
run)
if [ ! -f "./zipcracker" ]; then
echo "[-] binary not found, building..."
$0 build || exit 1
fi
ZIP="${2:-fontos_projektem.zip}"
CHARSET="${3:-lower+digits}"
MIN="${4:-1}"
MAX="${5:-8}"
./zipcracker -f "$ZIP" -c "$CHARSET" -min "$MIN" -max "$MAX" --auto
;;
*)
echo "usage: $0 {build|run} [zip] [charset] [min] [max]"
echo ""
echo "examples:"
echo " $0 build"
echo " $0 run"
echo " $0 run file.zip lower+digits 1 8"
exit 1
;;
esac