-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·41 lines (33 loc) · 1.27 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·41 lines (33 loc) · 1.27 KB
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
#!/usr/bin/env bash
# build.sh — Regenerate IDA type library (.til) files from IDA.h
#
# Usage:
# ./build.sh # uses 'tilib' from PATH
# TILIB=/path/to/tilib ./build.sh
# ./build.sh /path/to/tilib # first argument overrides path
#
# tilib is shipped with IDA Pro (SDK or standalone tilib package).
set -euo pipefail
TILIB="${1:-${TILIB:-tilib}}"
# For a bare name (no slash), look it up in PATH; for a full/relative path, test directly.
if [[ "$TILIB" != */* ]]; then
if ! command -v "$TILIB" &>/dev/null; then
echo "error: tilib not found in PATH ('${TILIB}')" >&2
echo " Set the TILIB environment variable or pass the path as the first argument." >&2
exit 1
fi
elif [ ! -x "$TILIB" ]; then
echo "error: tilib not found at '${TILIB}'" >&2
echo " Set the TILIB environment variable or pass the path as the first argument." >&2
exit 1
fi
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
echo "Using tilib: $("$TILIB" -v 2>&1 | head -1 || echo "$TILIB")"
echo ""
echo "Building IDA.til (64-bit)..."
"$TILIB" -c -hIDA.h IDA.til -D__EA64__ -P -tIDAObjcTypes
echo "Building IDA32.til (32-bit)..."
"$TILIB" -c -hIDA.h IDA32.til -P -tIDAObjcTypes32
echo ""
echo "Done. Generated IDA.til and IDA32.til"