项目作者: v3l0c1r4pt0r

项目描述 :
Quickly count define values, sizes and offsets from C code
高级语言: Shell
项目地址: git://github.com/v3l0c1r4pt0r/sadve.git
创建时间: 2018-11-08T17:03:59Z
项目社区:https://github.com/v3l0c1r4pt0r/sadve

开源协议:GNU General Public License v3.0

下载


SADVE

Extract value of C defines directly from command line

Prerequisites

  • cmake - required for both building and using
  • bash - min. version 4.0
  • compiler that can be picked up by cmake (also for using, not only building)

Installation

  1. git clone https://github.com/v3l0c1r4pt0r/sadve.git
  2. cd sadve
  3. mkdir -p build && cd build
  4. cmake ..
  5. make
  6. sudo make install

Usage

To get value of define AF_INET, defined in header sys/socket.h, one can call:

  1. sadve -d AF_INET sys/socket.h

Then to learn size of structure sockaddr as defined in sys/socket.h, use:

  1. sadve -s sockaddr sys/socket.h

Full help text:

  1. Usage: /usr/local/bin/sadve [--dec|--hex|--format=F] -d|-s|-u|-t|-e SYMBOL HEADER
  2. /usr/local/bin/sadve [--dec|--hex|--format=F] -o STRUCT.FIELD HEADER
  3. /usr/local/bin/sadve -h
  4. -d, --define Print final value of preprocessor macro
  5. -s, --struct Print total length of struct
  6. -u, --union Print total length of union
  7. -t, --type Print total length of type
  8. -e, --enum Print total length of enum
  9. -o, --offset Print offset of field in structure
  10. -I DIR Appends DIR to search path of include files
  11. --dec Print value in decimal form (default)
  12. --hex Print value in hexadecimal form
  13. --format=F Print value in F form, where F is format string as in
  14. printf(3)
  15. --debug Debug sadve itself
  16. -h, --help Print this help message and exit
  17. SYMBOL Symbol which value is to be examined
  18. HEADER Header where symbol is defined

License

The program is licensed under GNU GPL v3.