{"id":25563684,"url":"https://github.com/vector35/llil_transpiler","last_synced_at":"2025-04-12T08:25:00.388Z","repository":{"id":89394871,"uuid":"203506936","full_name":"Vector35/llil_transpiler","owner":"Vector35","description":"transpile llil to c++ for execution and testing","archived":false,"fork":false,"pushed_at":"2024-01-11T17:16:33.000Z","size":212,"stargazers_count":42,"open_issues_count":0,"forks_count":3,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-05T22:06:37.014Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vector35.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":"2019-08-21T04:34:58.000Z","updated_at":"2024-12-23T13:37:49.000Z","dependencies_parsed_at":"2024-01-11T19:51:06.070Z","dependency_job_id":null,"html_url":"https://github.com/Vector35/llil_transpiler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vector35%2Fllil_transpiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vector35%2Fllil_transpiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vector35%2Fllil_transpiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vector35%2Fllil_transpiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vector35","download_url":"https://codeload.github.com/Vector35/llil_transpiler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248538454,"owners_count":21120992,"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-02-20T20:27:11.473Z","updated_at":"2025-04-12T08:25:00.357Z","avatar_url":"https://github.com/Vector35.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LLIL Transpiler\n\nConvert LLIL to compileable and executable C++.\n\n**GOALS**:\n\n* test lifting: accurate LLIL should compute like native code\n* provide LLIL semantics - [runtime.cpp](./runtime.cpp) contains a C/C++ implementation for many LLIL operations\n\n**QUICK START**: `make -f Makefile_x86_x64` `./main`\n\n**EXAMPLE**: [transpiled A64](./assets/tests_il_A64.cpp)\n\n## How does it work?\n\nThe LLIL gets mapped to C/C++ code:\n\n| LLIL         | C/C++                                      |\n| ------------ | ------------------------------------------ |\n| LLIL_IF      | if                                         |\n| LLIL_GOTO    | goto, with labels generated at every block |\n| LLIL_CALL    | function call                              |\n| LLIL_JUMP_TO | switch                                     |\n| LLIL_REG     | `REG16()`, `REG32()`, `REG64()`, etc.      |\n| LLIL_ADD     | `ADD16()`, `ADD32()`, `ADD64()`, etc.      |\n| LLIL_XXX     | `XXX()`                                    |\n\nSee [ildump2cpp.py](./ildump2cpp.py) for the mapper, and [runtime.cpp](./runtime.cpp) for the C/C++ implementation of the LLIL operations.\n\n## Workflow\n\n1. compile tests.cpp into tests.o with the architecture you want to lift\n2. extract the llil into tests\\_il.cpp using ildump2cpp.py\n3. compile tests\\_il.cpp with runtime.cpp and main.cpp to main\n4. `./main`\n\nUsing make: `make x64` or `make arm` then `./main`\n\n## How can I test my own architecture?\n\n1. atop runtime.h, do an `#ifdef ARCH_XXX` and inside define your arch's register types, etc.\n2. in main.cpp, do an `#ifdef ARCH_XXX` and inside define `vm_init_stack()`, `vm_set_arg0()`, etc.\n3. create a Makefile, being sure to pass `-DARCH_XXX`\n4. run `./main`\n\n## What else?\n\nYou could compile a routine in one architecture, transpile it's LLIL to C++, then compile the result to a new architecture.\n\nYou could do the above many times, even with the same architecture, increasing code size and obfuscation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvector35%2Fllil_transpiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvector35%2Fllil_transpiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvector35%2Fllil_transpiler/lists"}