# 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
```shell
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
```json
[]
```
within this __n__ element of the following can be added
```json
{ "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
```text
((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 |
Raw data
{
"_id": null,
"home_page": "https://github.com/priv-kweihmann/pysymcheck",
"name": "pysymbolcheck",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "",
"author": "Konrad Weihmann",
"author_email": "kweihmann@outlook.com",
"download_url": "https://files.pythonhosted.org/packages/94/c1/45051b261fb95221008a49565806eee163d6d3e6d64d343d23e5542b3a87/pysymbolcheck-2.9.3.tar.gz",
"platform": null,
"description": "# Purpose\n\nThis tool does check compiled elf-files (and all dependencies) against given rules.\nObjectives are\n\n* check for discouraged functions (e.g. strcpy)\n* check for combinations of symbols (e.g. mutex and pthreads)\n\n## Usage\n\n```shell\nusage: pysymbolcheck [-h] [--libpath LIBPATH] rules file\n\nEval symbols of a binary against given rules\n\npositional arguments:\n rules Path to a rule file\n file File to parse\n\noptional arguments:\n -h, --help show this help message and exit\n --libpath LIBPATH \":\" separated path to lookup libraries\n```\n\n## Rule file format\n\na rule file consists of a json-array, like this\n\n```json\n[]\n```\n\nwithin this __n__ element of the following can be added\n\n```json\n{ \"severity\": \"error\", \"id\": \"A_Unique_ID\", \"msg\": \"some message\", \"rule\", \"<rule>\" }\n```\n\nfor __severity__ it is advised to use only **info**, **warning** or **error**\n\n## Rule definition\n\nA rule can consist of any logical combined operation such as\n\n```text\n((A && B) || (C && D )) && !E\n```\n\nto get the needed information following keywords are implemented\n\n| keyword | variables | purpose | example |\n| ----------- | :---------: | ---------------------------------------------------------------: | -----------------: |\n| AVAILABLE() | symbol-name | check if a symbol is defined in the binary or any referenced lib | AVAILABLE(strncpy) |\n| USED() | symbol-name | check if a symbol is used by some binary or lib | USED(strncpy) |\n| SIZE() | symbol-name | get the size in bytes of a symbol | SIZE(strncpy) |\n| TYPE() | symbol-name | get the type in bytes of a symbol | TYPE(strncpy) |\n| && | n.a. | logical and | A && B |\n| \\|\\| | n.a. | logical or | A \\|\\| B |\n| ! | n.a. | not operator | !A |\n\n\n",
"bugtrack_url": null,
"license": "",
"summary": "ELF symbol check",
"version": "2.9.3",
"project_urls": {
"Homepage": "https://github.com/priv-kweihmann/pysymcheck"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0a73d36cae45f92d533c57808e816d0464157da97e877e522a56080846914f09",
"md5": "0e14fcba1070dc62ac785482b3d8aa3d",
"sha256": "1f75f4f7d299a9dc9c35a2ee520c801d75573a5251f36ac5cbdc0f20de1c25b9"
},
"downloads": -1,
"filename": "pysymbolcheck-2.9.3-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "0e14fcba1070dc62ac785482b3d8aa3d",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.7",
"size": 5904,
"upload_time": "2024-03-15T06:02:06",
"upload_time_iso_8601": "2024-03-15T06:02:06.979770Z",
"url": "https://files.pythonhosted.org/packages/0a/73/d36cae45f92d533c57808e816d0464157da97e877e522a56080846914f09/pysymbolcheck-2.9.3-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "94c145051b261fb95221008a49565806eee163d6d3e6d64d343d23e5542b3a87",
"md5": "bec8d526b780e9b915ff5a110ee89f96",
"sha256": "a66f56fe51589747098f9de0f03a17dfb4aa4d15b2000de30a9abc9e43a22f63"
},
"downloads": -1,
"filename": "pysymbolcheck-2.9.3.tar.gz",
"has_sig": false,
"md5_digest": "bec8d526b780e9b915ff5a110ee89f96",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 5888,
"upload_time": "2024-03-15T06:02:08",
"upload_time_iso_8601": "2024-03-15T06:02:08.737835Z",
"url": "https://files.pythonhosted.org/packages/94/c1/45051b261fb95221008a49565806eee163d6d3e6d64d343d23e5542b3a87/pysymbolcheck-2.9.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-15 06:02:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "priv-kweihmann",
"github_project": "pysymcheck",
"github_not_found": true,
"lcname": "pysymbolcheck"
}