{"id":16841285,"url":"https://github.com/palmr/classfile-parser","last_synced_at":"2025-04-04T21:10:13.132Z","repository":{"id":48833868,"uuid":"51272010","full_name":"Palmr/classfile-parser","owner":"Palmr","description":":coffee: A parser for Java Classfiles written in rust","archived":false,"fork":false,"pushed_at":"2024-10-21T12:30:23.000Z","size":190,"stargazers_count":41,"open_issues_count":5,"forks_count":17,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T20:11:11.833Z","etag":null,"topics":["cargo","classfile-parser","java","java-classfiles","library","parsing","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/classfile-parser","language":"Rust","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/Palmr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2016-02-07T23:47:33.000Z","updated_at":"2025-01-01T18:31:04.000Z","dependencies_parsed_at":"2024-10-21T16:15:06.664Z","dependency_job_id":null,"html_url":"https://github.com/Palmr/classfile-parser","commit_stats":{"total_commits":94,"total_committers":8,"mean_commits":11.75,"dds":"0.26595744680851063","last_synced_commit":"6baefc0d69a4291742451bf47c848e02731ca8d6"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Palmr%2Fclassfile-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Palmr%2Fclassfile-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Palmr%2Fclassfile-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Palmr%2Fclassfile-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Palmr","download_url":"https://codeload.github.com/Palmr/classfile-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249532,"owners_count":20908212,"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":["cargo","classfile-parser","java","java-classfiles","library","parsing","rust"],"created_at":"2024-10-13T12:41:24.996Z","updated_at":"2025-04-04T21:10:13.104Z","avatar_url":"https://github.com/Palmr.png","language":"Rust","readme":"# Java Classfile Parser\n\n[![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE.txt)\n![Rust](https://github.com/Palmr/classfile-parser/workflows/Rust/badge.svg)\n[![Crates.io Version](https://img.shields.io/crates/v/classfile-parser.svg)](https://crates.io/crates/classfile-parser)\n\nA parser for [Java Classfiles](https://docs.oracle.com/javase/specs/jvms/se10/html/jvms-4.html), written in Rust using [nom](https://github.com/Geal/nom).\n\n## Installation\n\nClassfile Parser is available from crates.io and can be included in your Cargo enabled project like this:\n\n```toml\n[dependencies]\nclassfile-parser = \"~0.3\"\n```\n\n## Usage\n\n```rust\nextern crate classfile_parser;\n\nuse classfile_parser::class_parser;\n\nfn main() {\n    let classfile_bytes = include_bytes!(\"../path/to/JavaClass.class\");\n    \n    match class_parser(classfile_bytes) {\n        Ok((_, class_file)) =\u003e {\n            println!(\n                \"version {},{} \\\n                 const_pool({}), \\\n                 this=const[{}], \\\n                 super=const[{}], \\\n                 interfaces({}), \\\n                 fields({}), \\\n                 methods({}), \\\n                 attributes({}), \\\n                 access({:?})\",\n                class_file.major_version,\n                class_file.minor_version,\n                class_file.const_pool_size,\n                class_file.this_class,\n                class_file.super_class,\n                class_file.interfaces_count,\n                class_file.fields_count,\n                class_file.methods_count,\n                class_file.attributes_count,\n                class_file.access_flags\n            );\n        }\n        Err(_) =\u003e panic!(\"Failed to parse\"),\n    };\n}\n```\n\n## Implementation Status\n\n- [x] Header\n  - [x] Magic const\n  - [x] Version info\n- [x] Constant pool\n  - [x] Constant pool size\n  - [x] Constant types\n    - [x] Utf8\n    - [x] Integer\n    - [x] Float\n    - [x] Long\n    - [x] Double\n    - [x] Class\n    - [x] String\n    - [x] Fieldref\n    - [x] Methodref\n    - [x] InterfaceMethodref\n    - [x] NameAndType\n    - [x] MethodHandle\n    - [x] MethodType\n    - [x] InvokeDynamic\n- [x] Access flags\n- [x] This class\n- [x] Super class\n- [x] Interfaces\n- [x] Fields\n- [x] Methods\n- [x] Attributes\n  - [x] Basic attribute info block parsing\n  - [ ] Known typed attributes parsing\n    - [x] Critical for JVM\n      - [x] ConstantValue\n      - [x] Code\n      - [x] StackMapTable\n      - [x] Exceptions\n      - [x] BootstrapMethods\n    - [ ] Critical for Java SE\n      - [ ] InnerClasses\n      - [ ] EnclosingMethod\n      - [ ] Synthetic\n      - [ ] Signature\n      - [ ] RuntimeVisibleAnnotations\n      - [ ] RuntimeInvisibleAnnotations\n      - [ ] RuntimeVisibleParameterAnnotations\n      - [ ] RuntimeInvisibleParameterAnnotations\n      - [ ] RuntimeVisibleTypeAnnotations\n      - [ ] RuntimeInvisibleTypeAnnotations\n      - [ ] AnnotationDefault\n      - [X] MethodParameters\n    - [ ] Useful but not critical\n      - [x] SourceFile\n      - [ ] SourceDebugExtension\n      - [ ] LineNumberTable\n      - [ ] LocalVariableTable\n      - [ ] LocalVariableTypeTable\n      - [ ] Deprecated\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpalmr%2Fclassfile-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpalmr%2Fclassfile-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpalmr%2Fclassfile-parser/lists"}