# 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": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": null,
"author": "Konrad Weihmann",
"author_email": "kweihmann@outlook.com",
"download_url": "https://files.pythonhosted.org/packages/1d/85/93512cdc02de7c0e17b85b73f40394d6d117d080751128e79fd7f86ad2ad/pysymbolcheck-2.10.0.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",
"bugtrack_url": null,
"license": null,
"summary": "ELF symbol check",
"version": "2.10.0",
"project_urls": {
"Homepage": "https://github.com/priv-kweihmann/pysymcheck"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "19f2c1199c682b8dbff03ebd35eea7bc516427c8e3511200175f2ab3e142bcf7",
"md5": "853c31ff7b9401019acfe66615f8e145",
"sha256": "eae9d9c5856587974aba5e85c855b417e52deaf00fee505d20d1e7496f3fe730"
},
"downloads": -1,
"filename": "pysymbolcheck-2.10.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "853c31ff7b9401019acfe66615f8e145",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 5881,
"upload_time": "2024-11-01T06:43:09",
"upload_time_iso_8601": "2024-11-01T06:43:09.610891Z",
"url": "https://files.pythonhosted.org/packages/19/f2/c1199c682b8dbff03ebd35eea7bc516427c8e3511200175f2ab3e142bcf7/pysymbolcheck-2.10.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1d8593512cdc02de7c0e17b85b73f40394d6d117d080751128e79fd7f86ad2ad",
"md5": "40209d57c1f61146324b1f5320503b16",
"sha256": "8c1781b15453cd9da9cab1b789be5ce70d065b575d0331bd0025707a8e9cb40e"
},
"downloads": -1,
"filename": "pysymbolcheck-2.10.0.tar.gz",
"has_sig": false,
"md5_digest": "40209d57c1f61146324b1f5320503b16",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 5850,
"upload_time": "2024-11-01T06:43:11",
"upload_time_iso_8601": "2024-11-01T06:43:11.109397Z",
"url": "https://files.pythonhosted.org/packages/1d/85/93512cdc02de7c0e17b85b73f40394d6d117d080751128e79fd7f86ad2ad/pysymbolcheck-2.10.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-01 06:43:11",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "priv-kweihmann",
"github_project": "pysymcheck",
"github_not_found": true,
"lcname": "pysymbolcheck"
}