{"id":33178921,"url":"https://github.com/UpstandingHackers/hammer","last_synced_at":"2025-11-20T21:01:57.437Z","repository":{"id":3083914,"uuid":"4107922","full_name":"UpstandingHackers/hammer","owner":"UpstandingHackers","description":"Parser combinators for binary formats, in C. Yes, in C. What? Don't look at me like that.","archived":false,"fork":true,"pushed_at":"2022-11-27T12:19:01.000Z","size":3172,"stargazers_count":438,"open_issues_count":56,"forks_count":41,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-10-20T13:33:28.869Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"abiggerhammer/hammer","license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/UpstandingHackers.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}},"created_at":"2012-04-22T23:12:01.000Z","updated_at":"2025-10-02T17:40:15.000Z","dependencies_parsed_at":"2023-01-16T18:45:29.178Z","dependency_job_id":null,"html_url":"https://github.com/UpstandingHackers/hammer","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/UpstandingHackers/hammer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpstandingHackers%2Fhammer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpstandingHackers%2Fhammer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpstandingHackers%2Fhammer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpstandingHackers%2Fhammer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UpstandingHackers","download_url":"https://codeload.github.com/UpstandingHackers/hammer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpstandingHackers%2Fhammer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285511776,"owners_count":27184237,"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-11-20T02:00:05.334Z","response_time":54,"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-11-16T03:00:36.653Z","updated_at":"2025-11-20T21:01:57.431Z","avatar_url":"https://github.com/UpstandingHackers.png","language":"C","funding_links":[],"categories":["Generic ##"],"sub_categories":[],"readme":"Hammer is a parsing library. Like many modern parsing libraries, it provides a parser combinator interface for writing grammars as inline domain-specific languages, but Hammer also provides a variety of parsing backends. It's also bit-oriented rather than character-oriented, making it ideal for parsing binary data such as images, network packets, audio, and executables.\n\nHammer is written in C, but will provide bindings for other languages. If you don't see a language you're interested in on the list, just ask.\n\nHammer currently builds under Linux and OS X. (Windows is coming.)\n\n[![Build Status](https://travis-ci.org/UpstandingHackers/hammer.png)](https://travis-ci.org/UpstandingHackers/hammer)\nFeatures\n========\n* Bit-oriented -- grammars can include single-bit flags or multi-bit constructs that span character boundaries, with no hassle\n* Thread-safe, reentrant\n* Benchmarking for parsing backends -- determine empirically which backend will be most time-efficient for your grammar\n* Parsing backends:\n  * Packrat parsing\n  * LL(k) \n  * GLR \n  * LALR\n  * Regular expressions \n* Language bindings: \n  * C++\n  * Java (not currently building; give us a few days)\n  * Python\n  * Ruby\n  * Perl\n  * [Go](https://github.com/prevoty/hammer)\n  * PHP\n  * .NET \n\nInstalling\n==========\n### Prerequisites\n* [SCons](http://scons.org/)\n\n### Optional Dependencies\n* pkg-config (for `scons test`)\n* glib-2.0 (\u003e= 2.29) (for `scons test`)\n* glib-2.0-dev (for `scons test`)\n* [swig](http://swig.org/) (for Python/Perl/PHP bindings; Perl requires \u003e= 2.0.8; Python 3.x requires \u003e= 3.0.0)\n* python2.7-dev (for Python 2 bindings)\n* python3-dev (\u003e= 3.5) (for Python 3 bindings)\n* a JDK (for Java bindings)\n* a working [phpenv](https://github.com/CHH/phpenv) configuration (for PHP bindings)\n* [Ruby](https://www.ruby-lang.org/) \u003e= 1.9.3 and bundler, for the Ruby bindings\n* mono-devel and mono-mcs (\u003e= 3.0.6) (for .NET bindings)\n* [nunit](http://www.nunit.org/) (for testing .NET bindings)\n\nTo build, type `scons`. To run the built-in test suite, type `scons test`. For a debug build, add `--variant=debug`.\n\nTo build bindings, pass a \"bindings\" argument to scons, e.g. `scons bindings=python`. `scons bindings=python test` will build Python bindings and run tests for both C and Python. `--variant=debug` is valid here too. You can build more than one set of bindings at a time; just separate them with commas, e.g. `scons bindings=python,perl`.\n\nFor Java, if jni.h and jni_md.h aren't already somewhere on your include path, prepend\n`C_INCLUDE_PATH=/path/to/jdk/include` to that.\n\nTo make Hammer available system-wide, use `scons install`. This places include files in `/usr/local/include/hammer` \nand library files in `/usr/local/lib` by default; to install elsewhere, add a `prefix=\u003cdestination\u003e` argument, e.g. \n`scons install prefix=$HOME`. A suitable `bindings=` argument will install bindings in whatever place your system thinks is appropriate.\n\nUsage\n=====\nJust `#include \u003chammer/hammer.h\u003e` (also `#include \u003chammer/glue.h\u003e` if you plan to use any of the convenience macros) and link with `-lhammer`.\n\nIf you've installed Hammer system-wide, you can use `pkg-config` in the usual way.\n\nTo learn about hammer check\n* the [user guide](https://github.com/UpstandingHackers/hammer/wiki/User-guide)\n* [Hammer Primer](https://github.com/sergeybratus/HammerPrimer) (outdated in terms of code, but good to get the general thinking)\n* [Try Hammer](https://github.com/sboesen/TryHammer)\n\nExamples\n========\nThe `examples/` directory contains some simple examples, currently including:\n* [base64](https://en.wikipedia.org/wiki/Base64)\n* [DNS](https://en.wikipedia.org/wiki/Domain_Name_System)\n\nKnown Issues\n============\nThe Python bindings work with Python 2.7, and Python 3.5+.\n\nThe requirement for SWIG \u003e= 2.0.8 for Perl bindings is due to a [known bug](http://sourceforge.net/p/swig/patches/324/) in SWIG. [ppa:dns/irc](https://launchpad.net/~dns/+archive/irc) has backports of SWIG 2.0.8 for Ubuntu versions 10.04-12.10; you can also [build SWIG from source](http://www.swig.org/download.html).\n\nThe .NET bindings are for Mono 3.0.6 and greater. If you're on a Debian-based distro that only provides Mono 2 (e.g., Ubuntu 12.04), there are backports for [3.0.x](http://www.meebey.net/posts/mono_3.0_preview_debian_ubuntu_packages/), and a [3.2.x PPA](https://launchpad.net/~directhex/+archive/monoxide) maintained by the Mono team.\n\nCommunity\n=========\nPlease join us at `#hammer` on `irc.upstandinghackers.com` if you have any questions or just want to talk about parsing.\n\nContact\n=======\nYou can also email us at \u003chammer@upstandinghackers.com\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FUpstandingHackers%2Fhammer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FUpstandingHackers%2Fhammer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FUpstandingHackers%2Fhammer/lists"}