{"id":20757854,"url":"https://github.com/amdmi3/libbinbuf","last_synced_at":"2026-04-25T02:36:52.356Z","repository":{"id":27288718,"uuid":"30762308","full_name":"AMDmi3/libbinbuf","owner":"AMDmi3","description":"Binary format parsing abstraction library","archived":false,"fork":false,"pushed_at":"2015-03-23T17:02:36.000Z","size":164,"stargazers_count":0,"open_issues_count":7,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-11T16:23:57.248Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","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/AMDmi3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-13T15:30:47.000Z","updated_at":"2015-03-23T17:02:36.000Z","dependencies_parsed_at":"2022-09-02T05:00:41.553Z","dependency_job_id":null,"html_url":"https://github.com/AMDmi3/libbinbuf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AMDmi3/libbinbuf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AMDmi3%2Flibbinbuf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AMDmi3%2Flibbinbuf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AMDmi3%2Flibbinbuf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AMDmi3%2Flibbinbuf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AMDmi3","download_url":"https://codeload.github.com/AMDmi3/libbinbuf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AMDmi3%2Flibbinbuf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27994391,"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-12-24T02:00:07.193Z","response_time":83,"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":"2024-11-17T09:46:05.604Z","updated_at":"2025-12-24T03:34:10.572Z","avatar_url":"https://github.com/AMDmi3.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libbinbuf\n\n[![Build Status](https://travis-ci.org/AMDmi3/libbinbuf.svg?branch=master)](https://travis-ci.org/AMDmi3/libbinbuf)\n\nBinary format parsing abstraction library.\n\n## Synopsis\n\n    // Open file for reading; uses mmap if available\n    FileContainer file(\"file.dat\");\n\n    // Read 8 byte chunk at offset 0\n    Buffer signature = file.GetSlice(0, 8);\n\n    // Extract a string\n    assert(signature.GetString() == \"MyFmt1.0\");\n    assert(signature.GetString(0, 8) == \"MyFmt1.0\");\n    assert(signature.GetString(0, 5) == \"MyFmt\");\n    assert(signature.GetString(5, 3) == \"1.0\");\n\n    // Read another 16 byte chunk at offset 8\n    Buffer header = file.GetSlice(8, 16);\n\n    // Extract some values\n    uint8_t val1 = header.GetU8(0);     // unsigned byte at 0\n    int16_t val2 = header.GetS16LE(1);  // signed litte endian word at 1\n    uint32_t val3 = header.GetU32BE(3); // unsigned big endian word at 3\n\n    // Extract sub-chunk\n    Buffer entry = header.GetSlice(4, 8);\n\n    // sub-chunks are useful for relative addessing\n    // note that entry references the same memory as\n    // header, so no copying is performed\n    uint8_t = entry[0];  // array-like access\n\n    // This still references the same memory...\n    Buffer copy = entry;\n\n    // ...but likely no more after this following line\n    copy.Append(';');\n\n    // Yes, may may append data to the buffer - useful if a\n    // format needs decompression or decrypting.\n    // Library still uses shared buffers for efficiency and\n    // convenience, but it always makes sure that one slice\n    // modification will never affect other slices.\n\n## Description\n\nThis small library implements a low level abstraction layer for\nbinary file parsing. What it does for you:\n\n- Hides away method of working with a data file. It can either use\n  fstream or mmap, and since the latter is more effective, it's used\n  when available.\n- Hides away method of handling buffers and slices of binary data.\n  After you get Buffer (which represents a contiguous chunk of\n  bytes) from a container, you can pass and copy it around, create\n  slices of it, but internally no data copying is performed - all\n  Buffers will reference a single place in memory. When mmap container\n  is used, it's not even copied from mapped memory.\n- Allows easy extraction of strings and integer values of different\n  sizes, signedness and endianess\n\n## Usage ##\n\nTo build libbinbuf, you need a compiler with C++11 support, for\nexample clang 3.4+ or gcc 4.8+, and cmake.\n\nTo build standalone version:\n\n    cmake . \u0026\u0026 make\n\nYou may either bundle this library with your project (if you use\ncmake, just add this to your CMakeLists.txt:\n\n    ADD_SUBDIRECTORY(extlib/libbinbuf) # where libbinbuf code is\n\n    ...\n\n    INCLUDE_DIRECTORIES(${BINBUF_INCLUDE_DIRS})\n\n    ADD_EXECUTABLE(mytarget ...)\n    TARGET_LINK_LIBRARIES(mytarget ${BINBUF_LIBRARIES})\n\n) or intall it systemwide with\n\n    make install\n\n## Author ##\n\n* [Dmitry Marakasov](https://github.com/AMDmi3) \u003camdmi3@amdmi3.ru\u003e\n\n## License ##\n\n2-clause BSD, see COPYING.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famdmi3%2Flibbinbuf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famdmi3%2Flibbinbuf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famdmi3%2Flibbinbuf/lists"}