{"id":26499168,"url":"https://github.com/droe/binja-blocks","last_synced_at":"2025-03-20T14:53:40.335Z","repository":{"id":264548408,"uuid":"893222539","full_name":"droe/binja-blocks","owner":"droe","description":"Apple Blocks Plugin for Binary Ninja","archived":false,"fork":false,"pushed_at":"2024-12-28T13:57:53.000Z","size":2040,"stargazers_count":26,"open_issues_count":5,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-28T14:29:14.904Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/droe.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}},"created_at":"2024-11-23T21:15:44.000Z","updated_at":"2024-12-28T13:57:56.000Z","dependencies_parsed_at":"2024-11-25T01:19:30.392Z","dependency_job_id":"62a76c1b-5b6c-4860-8e4c-79dfd175fc6b","html_url":"https://github.com/droe/binja-blocks","commit_stats":null,"previous_names":["droe/binja-blocks"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/droe%2Fbinja-blocks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/droe%2Fbinja-blocks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/droe%2Fbinja-blocks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/droe%2Fbinja-blocks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/droe","download_url":"https://codeload.github.com/droe/binja-blocks/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244637070,"owners_count":20485445,"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","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-03-20T14:53:39.814Z","updated_at":"2025-03-20T14:53:40.330Z","avatar_url":"https://github.com/droe.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Apple Blocks Plugin\nAuthor: Daniel Roethlisberger\n\nAnnotation of Apple [libclosure](https://github.com/apple-oss-distributions/libclosure) [blocks](https://clang.llvm.org/docs/BlockLanguageSpec.html).\n\n## Description\n\nType annotation of stack and global blocks, block descriptors, variables closed\nover and related function signatures in [Binary Ninja](https://binary.ninja/).\nBlocks are an implementation of closures often found in C, C++, ObjC and ObjC++\ncode for Apple platforms.  Blocks are not the same as C++ lambdas.\n\n![Screenshot comparing before and after annotation](https://github.com/droe/binja-blocks/blob/0.4.0/.github/img/showcase.png?raw=true)\n\nCommands:\n\n-   Annotate all blocks\n-   Annotate all global blocks\n-   Annotate all stack blocks\n-   Annotate global block here\n-   Annotate stack block here\n-   Annotate stack byref here\n-   Remove plugin comment here (deprecated)\n\nFeatures:\n\n-   Find and annotate global and stack blocks\n-   Annotate block imported variables based on inline or out-of-line\n    generic helper info or extended layout\n-   Annotate block invoke function type based on encoded block ObjC type\n    signature\n-   Annotate block descriptors, copy/dispose functions, generic helper info\n    and out-of-line extended layout bytecode\n-   Annotate stack byrefs (`__block` variables) based on non-extended\n    layout or inline or out-of-line extended layout, including keep and\n    destroy functions\n-   Define per-block and per-byref named structs to allow for manual fixups\n-   Define structs for fully manual annotation: `Block_literal`,\n    `Block_descriptor_1`, `Block_descriptor_2`, `Block_descriptor_3`,\n    `Block_byref_1`, `Block_byref_2`, `Block_byref_3`.\n\nKnown limitations:\n\n-   Automatic discovery of blocks and byrefs on the stack is unreliable by\n    nature and depends on Binary Ninja's ability to lift into clean HLIL\n-   No support for \"small descriptors\"\n-   No support for 32-bit architectures\n-   No support for \"old GC layout\"\n-   No support for older block layout from before the introduction of block descriptors\n-   Byrefs passed as function arguments are not automatically discovered\n\n## References\n\nBlocks language docs:\n\n-   [Blocks Programming Topics](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Blocks/), Apple Documentation Archive\n-   [LLVM Block Language Spec](https://clang.llvm.org/docs/BlockLanguageSpec.html)\n\nBlocks implementation details:\n\n-   [libclosure](https://github.com/apple-oss-distributions/libclosure), source code and two spec documents\n-   [LLVM Block ABI](https://clang.llvm.org/docs/Block-ABI-Apple.html)\n\nObjective-C Type Encodings:\n\n-   [Type Encodings](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtTypeEncodings.html), Objective-C Runtime Programming Guide, Apple Documentation Archive\n-   [LLVM code emitting type encodings](https://github.com/llvm-mirror/clang/blob/master/lib/AST/ASTContext.cpp)\n\n## License\n\nThis plugin is released under an [MIT license](./license).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdroe%2Fbinja-blocks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdroe%2Fbinja-blocks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdroe%2Fbinja-blocks/lists"}