generated from clearbluejar/ghidra-python-vscode-devcontainer-skeleton
-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathpost-create.sh
executable file
·50 lines (39 loc) · 1.32 KB
/
post-create.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
# Create local venv
python3 -m venv .env
source .env/bin/activate
# upgrade pip
pip install --upgrade pip
# Download latest pyi typings for Ghidra Version
pip install ghidra-stubs
# If arm64 os, need to build native binaries for Ghidra
if uname -a | grep -q 'aarch64'; then
if [ -e $GHIDRA_INSTALL_DIR/support/buildNatives ]
then
$GHIDRA_INSTALL_DIR/support/buildNatives
else
# needed for Ghidra 11.2+
pushd $GHIDRA_INSTALL_DIR/support/gradle/
gradle buildNatives
popd
fi
fi
# install local workspace and test requirements
pip install -e ".[testing]"
# initialize pyhidra
python -m pyhidra.install_plugins
# git clone test data if dir doesn't exist
TEST_DATA_PATH="tests/data"
if [ ! -d "$TEST_DATA_PATH" ] ; then
git clone https://github.com/clearbluejar/ghidriff-test-data.git tests/data
pushd $TEST_DATA_PATH
git remote set-url origin git@github.com:clearbluejar/ghidriff-test-data.git
popd
fi
# Setup Ghidra Dev for Reference
# git clone https://github.com/NationalSecurityAgency/ghidra.git ~/ghidra-master
# pushd ~/ghidra-master
# # Follow setup from https://github.com/NationalSecurityAgency/ghidra/blob/master/DevGuide.md
# gradle -I gradle/support/fetchDependencies.gradle init
# gradle prepdev
# popd
# echo 'To open up a Ghidra latest dev: code ~/ghidra-master'