-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
228 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# Process this file with autoconf to produce a configure script. | ||
|
||
AC_PREREQ([2.69]) | ||
AC_INIT([assemblyline],[1.3.1],[[email protected]]) | ||
AC_INIT([assemblyline],[1.3.2],[[email protected]]) | ||
AC_CONFIG_HEADERS([config.h]) | ||
AC_CONFIG_SRCDIR([src/assemblyline.c]) | ||
AC_CONFIG_AUX_DIR([build-aux]) | ||
|
@@ -34,6 +34,43 @@ AC_TYPE_UINT32_T | |
AC_TYPE_UINT64_T | ||
AC_TYPE_UINT8_T | ||
|
||
|
||
|
||
# completion --start-- | ||
# bash | ||
AC_ARG_WITH([bash-completion-dir], | ||
AS_HELP_STRING([--with-bash-completion-dir[=PATH]], | ||
[Install the bash auto-completion script in this directory. @<:@default=yes@:>@]), | ||
[], | ||
[with_bash_completion_dir=yes]) | ||
|
||
if test "x$with_bash_completion_dir" = "xyes"; then | ||
PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0], | ||
[BASH_COMPLETION_DIR="`pkg-config --variable=completionsdir bash-completion`"], | ||
[BASH_COMPLETION_DIR="$datadir/bash-completion/completions"]) | ||
else | ||
BASH_COMPLETION_DIR="$with_bash_completion_dir" | ||
fi | ||
AC_SUBST([BASH_COMPLETION_DIR]) | ||
AM_CONDITIONAL([ENABLE_BASH_COMPLETION],[test "x$with_bash_completion_dir" != "xno"]) | ||
# end bash | ||
# start zsh | ||
AC_ARG_WITH([zsh-completion-dir], | ||
AS_HELP_STRING([--with-zsh-completion-dir[=PATH]], | ||
[Install the zsh auto-completion script in this directory. @<:@default=yes@:>@]), | ||
[], | ||
[with_zsh_completion_dir=yes]) | ||
|
||
if test "x$with_zsh_completion_dir" = "xyes"; then | ||
ZSH_COMPLETION_DIR="$datadir/zsh/site-functions" | ||
else | ||
ZSH_COMPLETION_DIR="$with_zsh_completion_dir" | ||
fi | ||
AC_SUBST([ZSH_COMPLETION_DIR]) | ||
AM_CONDITIONAL([ENABLE_ZSH_COMPLETION],[test "x$with_zsh_completion_dir" != "xno"]) | ||
# end zsh | ||
# completion --end-- | ||
|
||
# Checks for library functions. | ||
AC_FUNC_MALLOC | ||
AC_FUNC_MMAP | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#compdef asmline | ||
|
||
_arguments -S -s \ | ||
'(H --rand)--rand[runs the code and initializes memory with random data _rdi--r9 can be dereferenced_.]:random heap:' \ | ||
'(H -r --return)'{-r=-,--return=-}'[runs assembled code]:number of elements::resolution:(300 500)' \ | ||
'(H -p --print)'{-p,--print}'[print to stdout in ASCII-hex.]' \ | ||
'(H -P --printfile -o --object)'{-P+,--printfile+}'[write raw binary into FILE]' \ | ||
'(H -P --printfile -o --object)'{-o+,--object+}'[write raw binary machinecode to FILE.bin]' \ | ||
'(H -c --chunk)'{-c+,--chunk+}'[set (write) chunk size. Will NOP-pad every chunk]' \ | ||
'(H -b --breaks)'{-b+,--breaks+}'[set (read) chunk size. Counts how many chunks break a boundary.]' \ | ||
+ '(mov)' \ | ||
"(H)--nasm-mov-imm[nasm mov imm: mov to 32-bit reg if possible.]" \ | ||
"(H)--smart-mov-imm[smart mov imm: if 64-bit padded, mov to 64-bit reg, to 32-bit otherwise.]" \ | ||
"(H)--strict-mov-imm[strict mov imm: always mov to 64-bit reg.]" \ | ||
+ '(sib_index)' \ | ||
"(H)--nasm-sib-index-base-swap[nasm swap sib; 'lea r15, \[rax+rsp\]' -> 'lea r15, \[rsp+rax\]']" \ | ||
"(H)--strict-sib-index-base-swap[no swap sib; 'lea r15, \[rax+rsp\]' as is.]" \ | ||
+ '(sib_nobase)' \ | ||
"(H)--nasm-sib-no-base[nasm scale sib; 'lea r15, \[2*rax\]' -> 'lea r15, \[rax+1*rax\]']" \ | ||
"(H)--strict-sib-no-base[no scale sib; 'lea r15, \[2*rax\]' as is.]" \ | ||
+ '(sib_total)' \ | ||
"(H sib_index sib_nobase)--nasm-sib[implies --nasm-sib-{no-base,index-base-swap}]" \ | ||
"(H sib_index sib_nobase)--strict-sib[implies --strict-sib-{no-base,index-base-swap}]" \ | ||
+ '(mode_total)' \ | ||
"(H sib_total mov)"{--nasm,-n}'[implies --nasm-{mov-imm,sib-{no-base,index-base-swap}}]' \ | ||
"(H sib_total mov)"{--strict,-t}'[implies --strict-{mov-imm,-{no-base,index-base-swap}}]' \ | ||
+ '(H)' \ | ||
'(* - input)'{-v,--version}'[Prints version information to stdout and exits.]' \ | ||
'(* - input)'{-h,--help}'[Prints usage information to stdout and exits.]' \ | ||
+ '(input)' \ | ||
':assembly file:_files -g \*.\(asm\|s\|S\)' && ret=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env bash | ||
_asmline() { | ||
|
||
local current="${COMP_WORDS[COMP_CWORD]}" | ||
local options=" | ||
--breaks | ||
--chunk | ||
--help | ||
--nasm | ||
--nasm-mov-imm | ||
--nasm-sib | ||
--nasm-sib-index-base-swap | ||
--nasm-sib-no-base | ||
--object | ||
--printfile | ||
--rand | ||
--return | ||
--smart-mov-imm | ||
--strict | ||
--strict-mov-imm | ||
--strict-sib | ||
--strict-sib-index-base-swap | ||
--strict-sib-no-base | ||
--version | ||
-P | ||
-b | ||
-c | ||
-h | ||
-n | ||
-o | ||
-p | ||
-r | ||
-t | ||
-v | ||
" | ||
mapfile -t COMPREPLY < <(compgen -W "${options}" -- "${current}") | ||
} | ||
|
||
complete -F _asmline asmline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters