{"id":28346752,"url":"https://github.com/danielplohmann/picblocks","last_synced_at":"2025-08-18T11:06:53.257Z","repository":{"id":46622833,"uuid":"405667431","full_name":"danielplohmann/picblocks","owner":"danielplohmann","description":null,"archived":false,"fork":false,"pushed_at":"2023-11-24T07:29:45.000Z","size":505,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-01T11:08:17.307Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danielplohmann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-09-12T14:41:57.000Z","updated_at":"2021-12-05T21:42:03.000Z","dependencies_parsed_at":"2025-06-21T23:42:00.076Z","dependency_job_id":null,"html_url":"https://github.com/danielplohmann/picblocks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/danielplohmann/picblocks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielplohmann%2Fpicblocks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielplohmann%2Fpicblocks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielplohmann%2Fpicblocks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielplohmann%2Fpicblocks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielplohmann","download_url":"https://codeload.github.com/danielplohmann/picblocks/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielplohmann%2Fpicblocks/sbom","scorecard":{"id":320298,"data":{"date":"2025-08-11","repo":{"name":"github.com/danielplohmann/picblocks","commit":"a5e9e0171a74825cf20b2ca5ae5bc8ab40476f22"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.9,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":1,"reason":"Found 2/17 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 2-Clause \"Simplified\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 15 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"25 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2018-66 / GHSA-562c-5r94-xh97","Warn: Project is vulnerable to: PYSEC-2019-179 / GHSA-5wv5-4vpf-pj6m","Warn: Project is vulnerable to: PYSEC-2023-62 / GHSA-m2qf-hxjv-5gpq","Warn: Project is vulnerable to: GHSA-m87m-mmvp-v9qm","Warn: Project is vulnerable to: PYSEC-2013-30 / GHSA-x33v-f3gp-gw2c","Warn: Project is vulnerable to: PYSEC-2017-74","Warn: Project is vulnerable to: PYSEC-2024-211 / GHSA-3f84-rpwh-47g6","Warn: Project is vulnerable to: PYSEC-2022-169 / GHSA-4f7p-27jc-3c36","Warn: Project is vulnerable to: PYSEC-2020-178 / GHSA-4ppp-gpcr-7qf6 / GHSA-j7j6-7hfx-5522","Warn: Project is vulnerable to: PYSEC-2019-138 / GHSA-968f-66r5-5v74","Warn: Project is vulnerable to: PYSEC-2019-137 / GHSA-g2xc-35jw-c63p","Warn: Project is vulnerable to: GHSA-m5ff-3wj3-8ph4","Warn: Project is vulnerable to: PYSEC-2019-136 / GHSA-pg36-wpm5-g57p","Warn: Project is vulnerable to: PYSEC-2020-155","Warn: Project is vulnerable to: GHSA-2g68-c3qc-8985","Warn: Project is vulnerable to: PYSEC-2020-157 / GHSA-3p3h-qghp-hvh2","Warn: Project is vulnerable to: GHSA-f9vj-2wh5-fj8j","Warn: Project is vulnerable to: PYSEC-2019-140 / GHSA-gq9m-qvpx-68hc","Warn: Project is vulnerable to: PYSEC-2017-43 / GHSA-h2fp-xgx6-xh6f","Warn: Project is vulnerable to: PYSEC-2023-221 / GHSA-hrfv-mqp8-q5rw","Warn: Project is vulnerable to: GHSA-j544-7q9p-6xp8","Warn: Project is vulnerable to: PYSEC-2023-57 / GHSA-px8h-6qxv-m22q","Warn: Project is vulnerable to: GHSA-q34m-jh98-gwm2","Warn: Project is vulnerable to: PYSEC-2023-58 / GHSA-xg9f-g7g7-2323","Warn: Project is vulnerable to: PYSEC-2022-203"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T01:11:39.891Z","repository_id":46622833,"created_at":"2025-08-18T01:11:39.891Z","updated_at":"2025-08-18T01:11:39.891Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270982194,"owners_count":24679447,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-27T14:11:05.628Z","updated_at":"2025-08-18T11:06:53.249Z","avatar_url":"https://github.com/danielplohmann.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PicBlocks\n\nAn experimental project using position-independent code hashing over basic blocks for code similarity estimation.\n\n## Usage\n\nBoth module files in `./picblocks` and in `./utils` are runnable and contain examples of their usage:\n\n* `$ python -m picblocks.blockhasher \u003ctarget_binary_path\u003e` - produces a `block-report` for a single binary.\n* `$ python -m picblocks.blockhashmatcher \u003cblock_reports_path\u003e` - creates a new `./db/picblocksdb.json` from the `block-reports` located in `\u003cblock_reports_path\u003e`\n* `$ python -m blocks.blockhashmatcher \u003cblock_reports_path\u003e \u003ctarget_binary_path\u003e` - matches a binary against data stored in `./db/picblocksdb.json` if it exists, or otherwise creates `./db/picblocksdb.json` from the `block-reports` located in `\u003cblock_reports_path\u003e`\n* `$ python -m utils.import_picblocksdb_to_mongo.py` assumes some mongodb configurations (please check inside the file to adapt to yours) it merely takes the json generated DB into a most easy to manage (and query)  mongodb. \n* `$ python -m utils.make_stats.py` it assumes a mongodb connection (please check inside the file to adapt to yours), the generated json db into `db/picblocksdb.json` (you can change it directly in the relative varible) and the generated blocks report into `./block-reports/` folder. It builds up some statistics about detections and DB composition. The results would be available in a dedicated (and very simple) stats web ui. \n\n## Creating a Database\n\nThe script `hash_malpedia.py` is an example of how to process a collection of binaries into `./block-reports`, which will then be aggreated into a `./db/picblocksdb.json`.\n\n## Database Evaulation\n\nIn oder to quantify and to measure the quality of your detection rate you should check some basic informations about tests run against your db. \nThe simple (and preliminary) script named `make_stats.py` would build up some initial stats for you about detection rates. \nIt assumes to have a mongodb connection, the generated json db into `db/picblocksdb.json` (you can change it directly in the relative varible) and the generated blocks reports into `./block-reports/` folder (you can change it directly on the specified variable). \nOnce you run it, it takes every single block report and check it against the json database.\nIt build some stats and saves all the matching results into db. \nA dedicated web page (and a relative API) is built to show the detection rates and some more interesting statistics on your database.\n\n## Running as a Service\n\nIf a `./db/picblocksdb.json` exists, you can run\n\n`$ python app.py` \n\nto spawn a local demo server (`https://127.0.0.1:9001`) to query against.\n\n### Screenshots\n\nJust few screenshots about the initial stage of web user interface \nThe submit form. Once you have a given database (`./db/picblocksdb.json`) you can check matching from samples by submitting your samples from \nthis form.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"static/img/1.png\"\u003e\n\u003c/p\u003e\n\nIf the submitted sample gets some matches against the given database you should see a block similarity matrix (still under development for a better visualization)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"static/img/2.png\"\u003e\n\u003c/p\u003e\n\nFinally the matching database statistics generated by the script into `utils/make_stats.py` which takes all the generated block_reports (`block-reports/`) and check them against the generated databases (`./db/picblocksdb.json`) in order to estimate the detection rate on a given database.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"static/img/3.png\"\u003e\n\u003c/p\u003e\n\n## Contributors\n\n* [Daniel Plohmann](https://github.com/danielplohmann)\n* [Marco Ramilli](https://github.com/marcoramilli)\n* [Daniele Bellavista](https://github.com/dbellavista)\n\n## Version History\n* 2023-11-24: v2.0.1 - SMDA pinned to 1.12.7 before our bigger fix for PIC calculation\n* 2022-09-08: v2.0.0 - (BREAKING CHANGE) now intraprocedural control flow transfers are wildcarded by default, which should improve matching\n* 2022-08-04: v1.1.3 - extended format for blockhash representation of functions\n* 2021-10-01: v1.1.1 - added script to check detection rates and relative web interface page\n* 2021-09-28: v1.1.0 - added simple web user interface and a db connection\n* 2021-09-12: v1.0.6 - added submission form fields for bitness and base address to force overrides for those values.\n* 2021-08-24: v1.0.5 - improved parsing of bitness from submission filenames.\n* 2021-08-20: v1.0.4 - Tweaked result visualization, now showing all unique matches beyond the first 20.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielplohmann%2Fpicblocks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielplohmann%2Fpicblocks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielplohmann%2Fpicblocks/lists"}