-
Notifications
You must be signed in to change notification settings - Fork 0
/
gasGuard.sh
58 lines (51 loc) · 1.32 KB
/
gasGuard.sh
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
#!/bin/bash
clear
figlet -c "Gas Guard"
echo " Scripted by basant0x01 | Initial v0.2"
function engine() {
vulnTemplates=(
"default_Initilization_Loop.sh"
"cache_Array_Length_Loop.sh"
"greater_than_0_comperision.sh"
"use_custom_error.sh"
"increament_and_decrement.sh"
"bit_shifting_division_multiplication.sh"
"calldata_instead_memory_in_function.sh"
"assembly_for_address0.sh"
)
for template in "${vulnTemplates[@]}"; do
output=$(source "$template" 2>&1)
if echo "$output" | grep -q "LINE:"; then
echo "$output"
echo "*****************************************************************************"
fi
done
}
# Parse command line arguments
input_files=()
while [[ $# -gt 0 ]]; do
case $1 in
-i|--input)
shift
input_files+=("$1")
;;
-mi|--multi-input)
shift
input_files+=("$@")
break
;;
*)
echo "UNKNOWN OPTION: $1"
exit 1
;;
esac
shift
done
if [ ${#input_files[@]} -eq 0 ]; then
echo "Usage: $0 [-i input_file1 ...] [-mi input_file1 ...]"
exit 1
fi
# Check for loop issues
for input_file in "${input_files[@]}"; do
engine
done