mirror of
https://codeberg.org/KeybadeBlox/JSRF-Decompilation.git
synced 2026-05-22 17:37:20 +03:00
Remove unused make_symboltable.sh
Was obsoleted by the enhanced export/import Ghidra scripts.
This commit is contained in:
parent
4048526736
commit
5bf24865ac
1 changed files with 0 additions and 50 deletions
|
|
@ -1,50 +0,0 @@
|
||||||
#!/bin/sh -eu
|
|
||||||
# Script to convert Ghidra symbol table CSV export data to the format used by
|
|
||||||
# the Ghidra script ImportSymbolsScript.py
|
|
||||||
|
|
||||||
main() {
|
|
||||||
if [ $# -ne 1 ]; then usage; fi
|
|
||||||
|
|
||||||
printf 'Writing symbol table to symboltable.tsv...'
|
|
||||||
|
|
||||||
>symboltable.tsv # Create/truncate output file
|
|
||||||
|
|
||||||
while IFS=, read -r location namespace name type; do # Iterate rows
|
|
||||||
# Determine symbol type (skip if unrecognized, e.g. header row)
|
|
||||||
if [ "$type" = '"Function"' ]; then type_out=f
|
|
||||||
elif [ "$type" = '"Data Label"' ]; then type_out=l
|
|
||||||
else continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Add namespace prefix if not in global namespace
|
|
||||||
if [ "$namespace" = '"Global"' ]; then namespace_out=
|
|
||||||
else
|
|
||||||
namespace_out=${namespace#'"'}
|
|
||||||
namespace_out=${namespace_out%'"'}::
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Strip quotes from other columns
|
|
||||||
name_out=${name#'"'} ; name_out=${name_out%'"'}
|
|
||||||
location_out=${location#'"'}; location_out=${location_out%'"'}
|
|
||||||
|
|
||||||
# Output row
|
|
||||||
printf '%s\t%s\t%s\n'\
|
|
||||||
"$namespace_out$name_out" "$location_out" "$type_out"\
|
|
||||||
>> symboltable.tsv
|
|
||||||
done < $1
|
|
||||||
|
|
||||||
printf ' done.\n'
|
|
||||||
}
|
|
||||||
|
|
||||||
usage() {
|
|
||||||
printf '%s\n'\
|
|
||||||
'Usage: make_symboltable.sh CSVFILE'\
|
|
||||||
' CSVFILE is the path of a symbol table CSV from Ghidra'\
|
|
||||||
''\
|
|
||||||
'The CSV file should have columns Name, Location, and Type. The output file'\
|
|
||||||
'will be named "symboltable.tsv".' >&2
|
|
||||||
exit 2
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
main "$@"
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue