{"id":23353554,"url":"https://github.com/revengisquad/smalig","last_synced_at":"2025-10-28T22:30:49.760Z","repository":{"id":268794375,"uuid":"896164967","full_name":"RevEngiSquad/smalig","owner":"RevEngiSquad","description":"Dalvik(Smali) ByteCode info (grammar) fetch tool written in Python.","archived":false,"fork":false,"pushed_at":"2025-01-30T11:52:56.000Z","size":61,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-30T12:31:42.735Z","etag":null,"topics":["android","dalvik","dalvik-bytecode","smali","smali-baksmali"],"latest_commit_sha":null,"homepage":"","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/RevEngiSquad.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-29T17:19:40.000Z","updated_at":"2025-01-02T04:19:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"69d84b71-a10f-41ab-ac5e-5aaa73cb0f70","html_url":"https://github.com/RevEngiSquad/smalig","commit_stats":null,"previous_names":["revengisquad/smalig"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RevEngiSquad%2Fsmalig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RevEngiSquad%2Fsmalig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RevEngiSquad%2Fsmalig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RevEngiSquad%2Fsmalig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RevEngiSquad","download_url":"https://codeload.github.com/RevEngiSquad/smalig/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238734082,"owners_count":19521557,"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":["android","dalvik","dalvik-bytecode","smali","smali-baksmali"],"created_at":"2024-12-21T09:14:07.175Z","updated_at":"2025-10-28T22:30:49.449Z","avatar_url":"https://github.com/RevEngiSquad.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# smalig\n\nDalvik(Smali) ByteCode info (grammar) fetch tool written in Python.\n\n## Description\n\n`smalig` is a tool designed to fetch information about Dalvik(Smali) bytecode instructions. It allows users to specify a target instruction and retrieve detailed information about it, either in plain text or JSON format. This tool is particularly useful for developers and reverse engineers working with Android bytecode. Although there are many tools \u0026 resources available which does same job like [Dalvik Bytecode Reference](https://source.android.com/devices/tech/dalvik/dalvik-bytecode), Some chinese applications like MT Manager, NP, etc. but they all are very limited or little complex to understand and some are even outdated with no new instructions added. We created it for our use in RevEngi project and decided to share it in the hope that it will be useful to others.\n\n## Features\n\n- Fetch information for specific Dalvik(Smali) instructions.\n- Output results in plain text or JSON format.\n- Save output to a specified file or print to the console.\n- Interactive mode for prompting user input.\n\n\n## Installation\n\nTo install `smalig`, you can use `pip`:\n\n```sh\npip install smalig\n```\n\nor you can install it from source:\n\n```sh\npip install git+https://github.com/RevEngiSquad/smalig.git\n```\n\n## Usage/Examples\n\nYou can use `smalig` from the command line. Below are some examples of how to use the tool:\n\n```sh\nsmalig -t \"move\"  # Fetch information for the 'move' instruction.\nsmalig -t \"invoke-virtual\" -j -o output.json # Fetch and save as JSON\nsmalig -o my_output.txt # Prompts for instruction then saves to my_output.txt\nsmalig -t \"move\" -m # Enable fuzzy matching\n```\n\n**Output:**\nNormal output:\n```plaintext\nOpcode: 01\nName: move\nFormat: B|A|op\nFormat ID: 12x\nSyntax: move vA, vB\nArgs: A: destination register (4 bits), B: source register (4 bits)\nShort Info: Move the contents of one non-object register to another.\nDetailed Info: Moves the content of vB into vA. Both registers must be in the first 16 register range (0-15).\nExample: 0110 - move v0, v1\n  Desc: Moves the content of v1 into v0.\n```\n\nWith Fuzzy matching:\n```plaintext\nResult 1:\nOpcode: 01\nName: move\nFormat: B|A|op\nFormat ID: 12x\nSyntax: move vA, vB\nArgs: A: destination register (4 bits), B: source register (4 bits)\nShort Info: Move the contents of one non-object register to another.\nDetailed Info: Moves the content of vB into vA. Both registers must be in the first 16 register range (0-15).\nExample: 0110 - move v0, v1\n  Desc: Moves the content of v1 into v0.\n\nResult 2:\nOpcode: 02\nName: move/from16\nFormat: AA|op BBBB\nFormat ID: 22x\nSyntax: move/from16 vAA, vBBBB\nArgs: A: destination register (8 bits), B: source register (16 bits)\nShort Info: Move the contents of one non-object register to another.\nDetailed Info: Moves the content of vB into vA. vB must be in the 64k register range (0-65535) while vA is one of the first 256 registers (0-255).\nExample: 0200 1900 - move/from16 v0, v25\n  Desc: Moves the content of v25 into v0.\n\n....(Redacted for brevity)\n```\n\nJSON output:\n```json\n{\n    \"opcode\": \"01\",\n    \"name\": \"move\",\n    \"format\": \"B|A|op\",\n    \"format_id\": \"12x\",\n    \"syntax\": \"move vA, vB\",\n    \"args_info\": \"A: destination register (4 bits), B: source register (4 bits)\",\n    \"short_desc\": \"Move the contents of one non-object register to another.\",\n    \"long_desc\": \"Moves the content of vB into vA. Both registers must be in the first 16 register range (0-15).\",\n    \"note\": \"\",\n    \"example\": \"0110 - move v0, v1\",\n    \"example_desc\": \"Moves the content of v1 into v0.\"\n}\n```\n\nAs shown in the above example output, we've gone ahead and provided more detailed information about the instruction. This includes the opcode, format, syntax, arguments, and examples. This information can be useful for understanding the instruction and how it is used in Dalvik bytecode even for beginners.\n\n### Command Line Options\n\n- `-t TARGET`: Specify the Smali instruction to fetch. If omitted, prompts the user for input.\n- `-j`: Output the result as JSON. If `-o` is also specified and the `OUTPUT_FILE` ends in `.json`, this flag is automatically set.\n- `-m`: Enable fuzzy matching for the target instruction. This allows for partial matches.\n- `-o OUTPUT_FILE`: Write the output to the specified file. If omitted, prints to console.\n\n## Contributing\nWe welcome contribution(s) to `smalig`! They are what makes the open-source community such an amazing place to learn, inspire, and create. Any contribution(s) you make is/are greatly appreciated.\n\nIf you have a feature request or found a bug, please create an issue on the repo. You can also simply open an issue with the tag \"enhancement\" or \"bug\" and we will look into it.\n\nIf you would like to contribute, please follow these steps:\n\n1. **Fork the repository**: Click the \"Fork\" button in the top right corner of the repository page to create a copy of the repository in your GitHub account.\n\n2. **Create a new branch**: Create a new branch for your feature or bug fix:\n    ```sh\n    git checkout -b my-feature-branch\n    ```\n\n3. **Make your changes**: Implement your feature or bug fix.\n\n4. **Commit your changes**: Commit your changes with a descriptive commit message:\n    ```sh\n    git commit -m \"Description of my changes\"\n    ```\n\n5. **Push to your fork**: Push your changes to your forked repository:\n    ```sh\n    git push origin my-feature-branch\n    ```\n\n6. **Create a pull request**: Go to the original repository and create a pull request from your forked repository. Provide a clear description of your changes and any related issues.\n\n### Guidelines\n\n- Write clear and concise commit messages.\n- Update documentation if necessary.\n- Write tests for new features or bug fixes if applicable.\n\nThank you for contributing to `smalig`!\n\nDon't forget to star the repository if you found it useful.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frevengisquad%2Fsmalig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frevengisquad%2Fsmalig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frevengisquad%2Fsmalig/lists"}