{"id":18021582,"url":"https://github.com/ilyagulya/rust-dalvik-vm","last_synced_at":"2025-04-04T17:24:46.094Z","repository":{"id":207917324,"uuid":"720413309","full_name":"IlyaGulya/rust-dalvik-vm","owner":"IlyaGulya","description":" Dalvik VM implemented in Rust","archived":false,"fork":false,"pushed_at":"2024-06-21T17:55:22.000Z","size":391,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-10T02:47:30.511Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/IlyaGulya.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":"2023-11-18T12:13:17.000Z","updated_at":"2024-08-17T20:37:24.000Z","dependencies_parsed_at":"2024-06-22T10:05:16.033Z","dependency_job_id":"927fe4c4-5afc-41c7-b5c9-eda1dbe39603","html_url":"https://github.com/IlyaGulya/rust-dalvik-vm","commit_stats":null,"previous_names":["ilyagulya/rust-dalvik-vm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IlyaGulya%2Frust-dalvik-vm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IlyaGulya%2Frust-dalvik-vm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IlyaGulya%2Frust-dalvik-vm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IlyaGulya%2Frust-dalvik-vm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IlyaGulya","download_url":"https://codeload.github.com/IlyaGulya/rust-dalvik-vm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247218632,"owners_count":20903270,"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":"2024-10-30T06:10:28.249Z","updated_at":"2025-04-04T17:24:46.079Z","avatar_url":"https://github.com/IlyaGulya.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust Dalvik VM\n\n## Introduction\n\nThis is a project I'm writing purely for educational purposes.\n\n## Plan\n\n- [x] Parse DEX file (I'm aware of `dexparser` and `dex` crates, but I want to do it myself to better understand DEX\n  file structure)\n- [ ] Be able to interpret simple DEX file (`hello.dex` in `tests/vm/hello.dex`, compiled\n  from `tests/interpreter/hello.smali`)\n- [ ] Add more tests for DEX file parser.\n- [ ] Fix endianness support in DEX file parser. (currently it's only partial).\n- [ ] Memory allocations?\n- [ ] Garbage collection?\n- [ ] JIT?\n- [ ] AOT?\n- [ ] JNI?\n- [ ] Debugging?\n- [ ] Something else I'm currently not aware of 😀\n\n## Prerequisites\n\n- MacOS / Linux\n- Proguard (`brew install proguard` on MacOS)\n- Android SDK (required for `d8`)\n- `ANDROID_HOME` or `ANDROID_SDK_ROOT` environment variable pointing to Android SDK directory\n\n## Project structure\n\n### DEX file parser\n\n- `src/dex/raw_dex_file.rs` - raw DEX file parser. It parses DEX file to a struct which is almost a 1:1 representation\n  of DEX file structure.\n- `src/dex/dex_file.rs` - DEX file parser. It uses raw dex file parser result to construct full in-memory representation\n  of all parts of DEX file.\n\n### Smali interpreter\n\nAs a first step I wanted to write a smali interpreter before writing an actual DEX interpreter.\nHowever, my current Rust skills are not enough to make it work (lifetimes are evil 😰), so now this pars of VM is\nabandoned.\nMaybe in the future I will add support for direct smali interpretation. It should not be that hard, I will just need to\nparse Smali code to some intermediate representation shared with DEX file parser and then interpret it.\n\n- `src/gen/smali` - smali parser generated by `antlr4rust` official Smali grammar. I'm not going to use it for now.\n- `src/smali/ast` - smali AST parser which I wanted to use for better Smali code representation (`antlr4rust` one is\n  quite inconvenient).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filyagulya%2Frust-dalvik-vm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filyagulya%2Frust-dalvik-vm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filyagulya%2Frust-dalvik-vm/lists"}