{"id":25563654,"url":"https://github.com/vector35/arch-sh4","last_synced_at":"2026-03-11T04:30:21.150Z","repository":{"id":89394621,"uuid":"199319809","full_name":"Vector35/arch-sh4","owner":"Vector35","description":"SuperH architecture plugin ","archived":false,"fork":false,"pushed_at":"2024-03-13T15:39:55.000Z","size":124,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-13T15:05:37.211Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","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}},"created_at":"2019-07-28T17:53:13.000Z","updated_at":"2024-11-19T11:08:54.000Z","dependencies_parsed_at":"2024-03-13T17:01:33.361Z","dependency_job_id":null,"html_url":"https://github.com/Vector35/arch-sh4","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%2Farch-sh4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vector35%2Farch-sh4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vector35%2Farch-sh4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vector35%2Farch-sh4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vector35","download_url":"https://codeload.github.com/Vector35/arch-sh4/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239909299,"owners_count":19716947,"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:06.734Z","updated_at":"2026-03-11T04:30:21.116Z","avatar_url":"https://github.com/Vector35.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# arch-sh4\n\nThis is an experimental SH4 architecture plugin for Binary Ninja.\n\n## What's What\n\n- [arch_sh4.cpp](./arch_sh4.cpp) implements the Architecture class\n- [disassembler/*](./disassembler/) is the disassembler\n- [disassembler/disasm_test.py](./disassembler/disasm_test.py) tests disassembler in isolation\n- [test_disasm.py](./test_disasm.py) tests disassembler through the binja/architecture plugin\n- [sh4test.py](./sh4test.py) tests some lifting\n\n## Testing\n\n- [disassembler/disasm_test.py](./disassembler/disasm_test.py) implements a very basic \"disassemble to string and compare\" set of unit tests\n\nPersonal Binary Ninja users can test via the built in console:\n\n```\n\u003e\u003e\u003e sys.path.append('C:/users/x/documents/binja/arch-sh4') # Path directory containing sh4test.py\n\u003e\u003e\u003e from importlib import reload\n\u003e\u003e\u003e import sh4test\nsuccess!\n\u003e\u003e\u003e # Add or fix any testcases\n\u003e\u003e\u003e reload(sh4test)\nsuccess!\n```\n\nAnd, of course, you can open a test binary in Binary Ninja with this architecture built and activated to see if results are as expected.\n\n## Pull Requests\n\nPlease follow whatever formatting conventions are present in the file you edit. Pay attention to curly brackets, spacing, tabs vs. spaces, etc.\n\nIf you're making an architecture or lifter change, add a test case to [sh4test.py](./sh4test.py) that fails before your change and succeeds after your change.\n\nIf you're making a disassembler change, add a test case to [disassembler/test.py](./disassembler/test.py) that fails before your change and succeeds after your change.\n\nWhen you submit your first PR to one of Vector 35's repositories, you'll receive a notice from [CLA Assistant](https://cla-assistant.io/) that allows you to sign our [Contribution License Agreement](https://binary.ninja/cla.pdf) online. \n\n\n## Building\n\nBuilding the architecture plugin requires `cmake` 3.9 or above. You will also need the\n[Binary Ninja API source](https://github.com/Vector35/binaryninja-api).\n\nFirst, set the `BN_API_PATH` environment variable to the path containing the\nBinary Ninja API source tree.\n\nRun `cmake \u003cpath\u003e`. This can be done either from a separate build directory or from the source\ndirectory. If your app is installed in a non-default location, set BN_INSTALL_DIR in your\ncmake invocation, like `cmake -DBN_INSTALL_DIR=/Applications/Binary\\ Ninja\\ DEV.app/ \u003cpath\u003e`.\nOnce that is complete, run `make` in the build directory to compile the plugin.\n\nThe plugin can be found in the root of the build directory as `libarch_sh4.so`,\n`libarch_sh4.dylib` or `arch_sh4.dll` depending on your platform.\n\nTo install the plugin, first launch Binary Ninja and uncheck the \"SH4 architecture plugin\"\noption in the \"Core Plugins\" section. This will cause Binary Ninja to stop loading the\nbundled plugin so that its replacement can be loaded. Once this is complete, you can copy\nthe plugin into the user plugins directory (you can locate this by using the \"Open Plugin Folder\"\noption in the Binary Ninja UI).\n\n**Do not replace the architecture plugin in the Binary Ninja install directory. This will\nbe overwritten every time there is a Binary Ninja update. Use the above process to ensure that\nupdates do not automatically uninstall your custom build.**\n\n## Build Example\n\n### acquire repositories\n\n```\nmkdir ~/repos/vector35\ncd ~/repos/vector35\ngit clone git@github.com:Vector35/binaryninja-api.git\ngit clone git@github.com:Vector35/arch-sh4.git\n```\n\n### environment variables\n\n`export BN_API_PATH=~/repos/vector35/binaryninja-api`\n\n### cmake, make\n\n```\ncd arch-sh4\ncmake -DBN_INSTALL_DIR=/Applications/Binary\\ Ninja\\ DEV.app/ .\nmake\n```\n\n## Build Troubleshooting\n\n### example\n\n    CMake Error at CMakeLists.txt:8 (message):\n      Provide path to Binary Ninja API source in BN_API_PATH\n    resolution:\n    ensure BN_API_PATH is in your environment\n\n### example\n\n    CMake Error at /Users/andrewl/repos/vector35/binaryninja-api/CMakeLists.txt:53 (message):\n      Binary Ninja Core Not Found\n    resolution:\n    ensure BN_INSTALL_DIR is supplied at command line invocation of cmake\n    ensure some bad directory is not cached in CMakeCache.txt\n\n### example\n\n    cmake seems to ignore your setting of BN_INSTALL_DIR and other cmake variables\n    resolution:\n    rm CMakeCache.txt\n\n### example\n\n    undefined symbols at link time, like:\n    Undefined symbols for architecture x86_64:\n      \"_BNClearUserVariableValue\", referenced from:\n      BinaryNinja::Function::ClearUserVariableValue(BinaryNinja::Variable const\u0026, unsigned long long) in libbinaryninjaapi.a(function.cpp.o)\n    resolution:\n    ensure that your api repo is on the same channel and at the same commit as the libbinaryninjacore you're linking against\n    eg: binaryninja is on dev update channel and is up-to-date and binaryninja-api repo is on branch dev with latest pulled\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvector35%2Farch-sh4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvector35%2Farch-sh4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvector35%2Farch-sh4/lists"}