binstat 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. binstat-1.0.0/.github/dependabot.yml +15 -0
  2. binstat-1.0.0/.github/workflows/python-package.yml +131 -0
  3. binstat-1.0.0/.github/workflows/security.yml +31 -0
  4. binstat-1.0.0/.gitignore +72 -0
  5. binstat-1.0.0/.readthedocs.yaml +13 -0
  6. binstat-1.0.0/LICENSE +674 -0
  7. binstat-1.0.0/PKG-INFO +756 -0
  8. binstat-1.0.0/README.md +55 -0
  9. binstat-1.0.0/SECURITY.md +17 -0
  10. binstat-1.0.0/docs/Jin et al. - 2010 - BinStat Tool for Recognition of Packed Executables.pdf +0 -0
  11. binstat-1.0.0/docs/mkdocs.yml +60 -0
  12. binstat-1.0.0/docs/pages/api.md +166 -0
  13. binstat-1.0.0/docs/pages/cli/binstat.md +126 -0
  14. binstat-1.0.0/docs/pages/contributing.md +79 -0
  15. binstat-1.0.0/docs/pages/img/icon.png +0 -0
  16. binstat-1.0.0/docs/pages/img/logo.png +0 -0
  17. binstat-1.0.0/docs/pages/index.md +65 -0
  18. binstat-1.0.0/docs/pages/installation.md +55 -0
  19. binstat-1.0.0/docs/pages/internals.md +148 -0
  20. binstat-1.0.0/docs/requirements.txt +6 -0
  21. binstat-1.0.0/pyproject.toml +68 -0
  22. binstat-1.0.0/requirements.txt +1 -0
  23. binstat-1.0.0/scripts/train-default-model.py +55 -0
  24. binstat-1.0.0/setup.cfg +4 -0
  25. binstat-1.0.0/src/binstat/VERSION.txt +1 -0
  26. binstat-1.0.0/src/binstat/__info__.py +19 -0
  27. binstat-1.0.0/src/binstat/__init__.py +110 -0
  28. binstat-1.0.0/src/binstat/__main__.py +134 -0
  29. binstat-1.0.0/src/binstat/features.py +151 -0
  30. binstat-1.0.0/src/binstat/model.json +1 -0
  31. binstat-1.0.0/src/binstat/model.py +112 -0
  32. binstat-1.0.0/src/binstat.egg-info/PKG-INFO +756 -0
  33. binstat-1.0.0/src/binstat.egg-info/SOURCES.txt +38 -0
  34. binstat-1.0.0/src/binstat.egg-info/dependency_links.txt +1 -0
  35. binstat-1.0.0/src/binstat.egg-info/entry_points.txt +2 -0
  36. binstat-1.0.0/src/binstat.egg-info/requires.txt +4 -0
  37. binstat-1.0.0/src/binstat.egg-info/top_level.txt +1 -0
  38. binstat-1.0.0/tests/__init__.py +0 -0
  39. binstat-1.0.0/tests/hello.exe +0 -0
  40. binstat-1.0.0/tests/test_binstat.py +225 -0
@@ -0,0 +1,15 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: github-actions
4
+ directory: /
5
+ schedule:
6
+ interval: monthly
7
+ groups:
8
+ actions:
9
+ patterns: ["*"]
10
+ - package-ecosystem: pip
11
+ directory: /
12
+ schedule:
13
+ interval: monthly
14
+ # dependencies are minimum versions (>=) ; only open security updates, not routine upgrades
15
+ open-pull-requests-limit: 0
@@ -0,0 +1,131 @@
1
+ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3
+
4
+ name: build
5
+
6
+ on:
7
+ push:
8
+ branches: [ "main" ]
9
+ pull_request:
10
+ branches: [ "main" ]
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ jobs:
16
+ build:
17
+ runs-on: ${{ matrix.os }}
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ os: [ubuntu-latest]
22
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
23
+ env:
24
+ cov_python_version: "3.13"
25
+ steps:
26
+ - uses: actions/checkout@v7
27
+ - name: Set up Python ${{ matrix.python-version }}
28
+ uses: actions/setup-python@v7
29
+ with:
30
+ python-version: ${{ matrix.python-version }}
31
+ - name: Install package
32
+ run: |
33
+ python -m pip install --upgrade pip
34
+ python -m pip install flake8 pytest pytest-cov
35
+ pip install -r requirements.txt
36
+ pip install .[train]
37
+ - name: Lint with flake8
38
+ run: |
39
+ # stop the build if there are Python syntax errors or undefined names
40
+ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
41
+ # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
42
+ flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
43
+ - name: Test package with pytest
44
+ run: |
45
+ pytest --cov=binstat --cov-report=xml
46
+ - name: Upload coverage report
47
+ if: matrix.python-version == env.cov_python_version
48
+ uses: actions/upload-artifact@v7
49
+ with:
50
+ name: coverage-report
51
+ path: coverage.xml
52
+ coverage:
53
+ # only publish the badge for commits on main (not for pull requests)
54
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
55
+ needs: build
56
+ permissions:
57
+ contents: write
58
+ runs-on: ubuntu-latest
59
+ env:
60
+ cov_badge_path: docs/coverage.svg
61
+ steps:
62
+ - uses: actions/checkout@v7
63
+ - name: Set up Python
64
+ uses: actions/setup-python@v7
65
+ with:
66
+ python-version: "3.13"
67
+ - name: Download coverage report
68
+ uses: actions/download-artifact@v8
69
+ with:
70
+ name: coverage-report
71
+ - name: Make coverage badge
72
+ run: |
73
+ pip install genbadge[coverage]
74
+ genbadge coverage -i coverage.xml -o $cov_badge_path
75
+ - name: Push coverage badge
76
+ run: |
77
+ # keep the badge alone on an orphan branch so that main is never modified by the workflow
78
+ git config --local user.email "github-actions[bot]@users.noreply.github.com"
79
+ git config --local user.name "github-actions[bot]"
80
+ if git fetch --depth=1 origin coverage-badge 2>/dev/null && \
81
+ git show FETCH_HEAD:$cov_badge_path | cmp -s - $cov_badge_path; then
82
+ echo "Coverage badge unchanged"
83
+ exit 0
84
+ fi
85
+ git checkout --orphan coverage-badge
86
+ git rm -rqf --cached .
87
+ git add $cov_badge_path
88
+ git commit -m "Update coverage badge"
89
+ git push origin coverage-badge --force
90
+ deploy:
91
+ # only publish from pushes to main, never from pull requests
92
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
93
+ environment:
94
+ name: pypi
95
+ url: https://pypi.org/p/binstat
96
+ permissions:
97
+ # required for PyPI trusted publishing (OIDC)
98
+ id-token: write
99
+ contents: read
100
+ runs-on: ubuntu-latest
101
+ needs: build
102
+ steps:
103
+ - uses: actions/checkout@v7
104
+ - name: Check whether the version is already on PyPI
105
+ # comparing with PyPI (not with the previous commit) also releases a version whose push did not trigger a deploy
106
+ id: version
107
+ run: |
108
+ version=$(tr -d '[:space:]' < src/binstat/VERSION.txt)
109
+ status=$(curl -s -o /dev/null -w '%{http_code}' --retry 3 "https://pypi.org/pypi/binstat/$version/json")
110
+ case "$status" in
111
+ 200) echo "Version $version is already on PyPI" ; echo "new=false" >> "$GITHUB_OUTPUT" ;;
112
+ 404) echo "Version $version is not on PyPI yet" ; echo "new=true" >> "$GITHUB_OUTPUT" ;;
113
+ *) echo "::error::Unexpected HTTP status $status from PyPI" ; exit 1 ;;
114
+ esac
115
+ - if: steps.version.outputs.new == 'true'
116
+ name: Cleanup README
117
+ run: |
118
+ sed -ri 's/^(##*)\s*:.*:\s*/\1 /g' README.md
119
+ awk '{if (match($0,"## Supporters")) exit; print}' README.md > README
120
+ mv -f README README.md
121
+ - if: steps.version.outputs.new == 'true'
122
+ name: Set up Python
123
+ uses: actions/setup-python@v7
124
+ with:
125
+ python-version: "3.13"
126
+ - if: steps.version.outputs.new == 'true'
127
+ name: Build binstat package
128
+ run: python3 -m pip install --upgrade build && python3 -m build
129
+ - if: steps.version.outputs.new == 'true'
130
+ name: Publish to PyPI
131
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,31 @@
1
+ # This workflow audits the package dependencies for known vulnerabilities
2
+ # It is separate from python-package.yml so that a new advisory never blocks a release
3
+
4
+ name: security
5
+
6
+ on:
7
+ push:
8
+ branches: [ "main" ]
9
+ pull_request:
10
+ branches: [ "main" ]
11
+ schedule:
12
+ - cron: "0 6 * * 1" # weekly, catches new advisories between pushes
13
+ workflow_dispatch:
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ jobs:
19
+ pip-audit:
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@v7
23
+ - name: Set up Python
24
+ uses: actions/setup-python@v7
25
+ with:
26
+ python-version: "3.13"
27
+ - name: Install pip-audit
28
+ run: python -m pip install --upgrade pip pip-audit
29
+ - name: Audit dependencies
30
+ # resolves the dependencies of pyproject.toml in an isolated environment, so only these are audited
31
+ run: pip-audit .
@@ -0,0 +1,72 @@
1
+ # Temp files
2
+ *~
3
+ *.backup
4
+ .DS_Store
5
+
6
+ # Byte-compiled / optimized / DLL files
7
+ __pycache__/
8
+ *.py[cod]
9
+
10
+ # C extensions
11
+ *.so
12
+
13
+ # Distribution / packaging
14
+ .Python
15
+ env/
16
+ build/
17
+ .build/
18
+ develop-eggs/
19
+ dist/
20
+ downloads/
21
+ eggs/
22
+ .eggs/
23
+ lib64/
24
+ parts/
25
+ sdist/
26
+ reinstall.sh
27
+ update.sh
28
+ version.py
29
+
30
+ var/
31
+ *.egg-info/
32
+ .installed.cfg
33
+ *.egg
34
+
35
+ # PyInstaller
36
+ # Usually these files are written by a python script from a template
37
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
38
+ *.manifest
39
+ *.spec
40
+ MANIFEST
41
+
42
+ # Installer logs
43
+ pip-log.txt
44
+ pip-delete-this-directory.txt
45
+
46
+ # Unit test / coverage reports
47
+ htmlcov/
48
+ .tox/
49
+ .coverage
50
+ .coverage.*
51
+ .cache
52
+ nosetests.xml
53
+ coverage.xml
54
+ *,cover
55
+
56
+ # Translations
57
+ *.mo
58
+ *.pot
59
+
60
+ # Sphinx documentation
61
+ docs/_build/
62
+
63
+ # PyBuilder
64
+ target/
65
+
66
+ # Project artifacts
67
+ .deprecated
68
+ .idea
69
+ .vagrant
70
+ .test
71
+ tmp
72
+ TODO
@@ -0,0 +1,13 @@
1
+ version: 2
2
+
3
+ build:
4
+ os: ubuntu-24.04
5
+ tools:
6
+ python: "3.13"
7
+
8
+ mkdocs:
9
+ configuration: docs/mkdocs.yml
10
+
11
+ python:
12
+ install:
13
+ - requirements: docs/requirements.txt