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.8.1.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: pysymbolcheck-2.8.1.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pysymbolcheck-2.8.1.tar.gz
Algorithm Hash digest
SHA256 1b49a02565b8ba47521ec67196a8dc2fbaedc4cee05551252eb2050a47c72821
MD5 a8a27206c9000657d270d71102361a21
BLAKE2b-256 2f5c3dd727668f857da9c7a6bd1128927df036aee8f4d23587a8ffb8d9420ad3

See more details on using hashes here.

File details

Details for the file pysymbolcheck-2.8.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pysymbolcheck-2.8.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 98bd14d7e9282c1da1a72f9db3db700fc8945e3b524df9180d891d9bc20e04f8
MD5 313cf2514a9c972b53fbdd5eecabdfb9
BLAKE2b-256 b7a385aeb36c66a0dc1465a62a9368835b89b49ecbc27e50c86c59809ffb9627

See more details on using hashes here.

Supported by

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