mirror of
https://github.com/darlinghq/darling.git
synced 2024-11-27 06:10:36 +00:00
28 lines
398 B
Bash
Executable File
28 lines
398 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Generates a direct mapping between two functions in assembly code
|
|
|
|
(
|
|
echo "section text"
|
|
echo
|
|
|
|
while read line; do
|
|
if [[ $line == ";;*" ]]; then
|
|
continue
|
|
fi
|
|
|
|
arrIN=(${line//;/ })
|
|
|
|
if [ ${#arrIN[@]} -ne 2 ]; then
|
|
continue
|
|
fi
|
|
|
|
echo "global ${arrIN[0]}"
|
|
echo "extern ${arrIN[1]}"
|
|
echo "${arrIN[0]}:"
|
|
echo " jmp ${arrIN[1]} WRT ..plt"
|
|
echo
|
|
done < "$1"
|
|
) > "${1%.lst}.asm"
|
|
|