GitXplorerGitXplorer
m

optenum

public
44 stars
3 forks
3 issues

Commits

List of commits on branch master.
Unverified
d03fa509b74b67f29553ddea8d15ed7fa95f1ca0

Nicer .travis.yml

mmattboyer committed 10 years ago
Unverified
493168305618faa9ba8788632c697db2d0311b35

Merge pull request #8 from mattboyer/issue_0007

mmattboyer committed 10 years ago
Unverified
4f7abd96eb95f4a8ef024eb1cf99428dcb3cc88c

Should do the trick

mmattboyer committed 10 years ago
Unverified
54f7aa39950eb2a370e6abb8b4c94c37fb7d1963

Merge pull request #6 from mattboyer/issue_0005

mmattboyer committed 10 years ago
Unverified
9576c0a459c0d7c5e1934955939b23d6e36e23e2

The #define for GLib 2 is HAVE_GLIB2

mmattboyer committed 10 years ago
Unverified
5b6a327243dbec468f054f4e247524b86612a564

Merge pull request #4 from mattboyer/issue_0003

mmattboyer committed 10 years ago

README

The README file for this repository.

#optenum

optenum(1) is a command-line option enumerator for ELF executables.

Build status: Build Status Illustrative video

optenum(1) uses static analysis to extract the options accepted by a binary and lets you use bash's autocompletion with options.

<space> - <TAB> <TAB> - it's magic!

##Installing optenum

Building optenum is quick and easy. Download the source into a staging directory, run cmake then make install

$ git clone git://github.com/mattboyer/optenum.git
$ cd optenum/
$ cmake -DCMAKE_INSTALL_PREFIX:PATH=~/.local .
$ make install

Note The above will install optenum under the current user's home directory. For a system-wide install, replace the cmake invocation above with cmake .. This will cause optenum to be installed under /usr/local/, which will require elevated privileges.

All that's left to do is make sure the completion function is sourced and registered by your shell. You may want to add the following to your ~/.bashrc:

. ~/.local/share/optenum/optenum.sh

##About

optenum(1) uses libbfd and libopcodes from the GNU binutils package to parse the dynamic symbols used by a binary executable and disassemble its code.

When it finds a call to one of the supported option-parsing functions below, optenum will attempt to reconstitute the arguments passed as part of the call and, in the event the argument(s) that describes valid options has successfully been retrieved and points to a chunk of data hardcoded in the binary, finally parses it and exposes options to the user.

optenum(1) never executes foreign code and doesn't rely on any particular behaviour in the target binary. No usage message? No problem!

There are several moving parts and optenum operates on a best-effort basis. When optenum can't retrieve options, it will try to fail gracefully and fail fast.

##Support

###Option parsing functions

optenum(1) extracts options from binary executables by relying on the assumption that the task of defining valid command line options is done through a call to one of the following supported functions:

Function Library Used by
getopt libc GNU Coreutils, systemd utils, GNU NetCat and many more POSIX-compliant tools
getopt_long
getopt_long_only
g_option_context_add_main_entries Glib Gimp, Xchat,...
poptGetContext popt Samba utils, logrotate, cryptsetup...

###Architectures

optenum(1) only supports x86_64 argument passing conventions at this time.

##Contact

Please log any bugs you may encounter using the GitHub issue tracker or alternatively send a mail to mboyer <AT> sdf <DOT> org.