Skip to main content

ELF symbol check

Project description

Purpose

This tool does check compiled elf-files (and all dependencies) against given rules. Objectives are

  • check for discouraged functions (e.g. strcpy)
  • check for combinations of symbols (e.g. mutex and pthreads)

Usage

usage: pysymbolcheck [-h] [--libpath LIBPATH] rules file

Eval symbols of a binary against given rules

positional arguments:
  rules              Path to a rule file
  file               File to parse

optional arguments:
  -h, --help         show this help message and exit
  --libpath LIBPATH  ":" separated path to lookup libraries

Rule file format

a rule file consists of a json-array, like this

[]

within this n element of the following can be added

{ "severity": "error", "id": "A_Unique_ID", "msg": "some message", "rule", "<rule>" }

for severity it is advised to use only info, warning or error

Rule definition

A rule can consist of any logical combined operation such as

((A && B) || (C && D )) && !E

to get the needed information following keywords are implemented

keyword variables purpose example
AVAILABLE() symbol-name check if a symbol is defined in the binary or any referenced lib AVAILABLE(strncpy)
USED() symbol-name check if a symbol is used by some binary or lib USED(strncpy)
SIZE() symbol-name get the size in bytes of a symbol SIZE(strncpy)
TYPE() symbol-name get the type in bytes of a symbol TYPE(strncpy)
&& n.a. logical and A && B
|| n.a. logical or A || B
! n.a. not operator !A

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysymbolcheck-2.10.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

pysymbolcheck-2.10.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file pysymbolcheck-2.10.0.tar.gz.

File metadata

  • Download URL: pysymbolcheck-2.10.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pysymbolcheck-2.10.0.tar.gz
Algorithm Hash digest
SHA256 8c1781b15453cd9da9cab1b789be5ce70d065b575d0331bd0025707a8e9cb40e
MD5 40209d57c1f61146324b1f5320503b16
BLAKE2b-256 1d8593512cdc02de7c0e17b85b73f40394d6d117d080751128e79fd7f86ad2ad

See more details on using hashes here.

File details

Details for the file pysymbolcheck-2.10.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pysymbolcheck-2.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eae9d9c5856587974aba5e85c855b417e52deaf00fee505d20d1e7496f3fe730
MD5 853c31ff7b9401019acfe66615f8e145
BLAKE2b-256 19f2c1199c682b8dbff03ebd35eea7bc516427c8e3511200175f2ab3e142bcf7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page