forked from phra/PEzor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·63 lines (46 loc) · 2.15 KB
/
install.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
59
60
61
62
63
#!/usr/bin/env bash
CURR_DIR=`pwd`
INSTALL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd $INSTALL_DIR &&
apt update &&
apt install -y wget unzip build-essential cmake autotools-dev git clang golang mingw-w64 libcapstone-dev libssl-dev cowsay mono-devel &&
mkdir -p deps &&
cd deps &&
(ls inline_syscall 2>/dev/null 1>&2 || (
git clone https://github.com/JustasMasiulis/inline_syscall.git &&
cd inline_syscall &&
git checkout 24238544b510d8f85ca38de3a43bc41fa8cfe380 &&
cd .. &&
grep -v '#include <intrin.h>' $INSTALL_DIR/deps/inline_syscall/include/in_memory_init.hpp > $INSTALL_DIR/deps/inline_syscall/include/in_memory_init.hpp2 &&
mv $INSTALL_DIR/deps/inline_syscall/include/in_memory_init.hpp2 $INSTALL_DIR/deps/inline_syscall/include/in_memory_init.hpp)
) &&
(ls donut_v0.9.3.tar.gz 2>/dev/null 1>&2 || (wget https://github.com/TheWover/donut/releases/download/v0.9.3/donut_v0.9.3.tar.gz &&
tar xvf donut_v0.9.3.tar.gz)
) &&
(ls keystone 2>/dev/null 1>&2 || (git clone --depth 1 https://github.com/keystone-engine/keystone.git &&
cd keystone &&
mkdir -p build &&
cd build &&
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DLLVM_TARGETS_TO_BUILD="X86" -G "Unix Makefiles" .. &&
make &&
make install &&
cd ../..)
) &&
go get github.com/EgeBalci/sgn &&
(ls wclang 2>/dev/null 1>&2 || (git clone --depth 1 https://github.com/tpoechtrager/wclang.git &&
cd wclang &&
cmake -DCMAKE_INSTALL_PREFIX=_prefix_PEzor_ . &&
make &&
make install &&
cd ..)
) &&
cd .. &&
(grep -q _prefix_PEzor_ ~/.bashrc || echo "export PATH=\$PATH:~/go/bin/:$INSTALL_DIR:$INSTALL_DIR/deps/donut_v0.9.3/:$INSTALL_DIR/deps/wclang/_prefix_PEzor_/bin/") >> ~/.bashrc &&
export PATH=$PATH:~/go/bin/:$INSTALL_DIR:$INSTALL_DIR/deps/donut_v0.9.3/:$INSTALL_DIR/deps/wclang/_prefix_PEzor_/bin/ &&
ln -fs $INSTALL_DIR/PEzor.sh $INSTALL_DIR/PEzor &&
chmod +x $INSTALL_DIR/PEzor &&
$INSTALL_DIR/PEzor.sh -h &&
cd $CURR_DIR &&
echo '[!] installation complete' &&
echo '[?] run the following command to update $PATH variable or restart your shell' &&
echo "export PATH=\$PATH:~/go/bin/:$INSTALL_DIR:$INSTALL_DIR/deps/donut_v0.9.3/:$INSTALL_DIR/deps/wclang/_prefix_PEzor_/bin/"