{"id":22489486,"url":"https://github.com/jingmatrix/demo","last_synced_at":"2025-04-10T00:17:47.040Z","repository":{"id":265588747,"uuid":"896298921","full_name":"JingMatrix/Demo","owner":"JingMatrix","description":"A demo app to detect Zygote injections","archived":false,"fork":false,"pushed_at":"2025-03-25T05:07:17.000Z","size":145,"stargazers_count":68,"open_issues_count":5,"forks_count":14,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-10T00:17:41.597Z","etag":null,"topics":["android","injection","linker"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JingMatrix.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-30T01:58:49.000Z","updated_at":"2025-04-07T15:49:39.000Z","dependencies_parsed_at":"2024-11-30T03:17:48.551Z","dependency_job_id":"360ba91f-2a04-4c40-9a71-a8ac2f06c37f","html_url":"https://github.com/JingMatrix/Demo","commit_stats":null,"previous_names":["jingmatrix/demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JingMatrix%2FDemo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JingMatrix%2FDemo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JingMatrix%2FDemo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JingMatrix%2FDemo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JingMatrix","download_url":"https://codeload.github.com/JingMatrix/Demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131318,"owners_count":21052820,"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","injection","linker"],"created_at":"2024-12-06T17:19:56.617Z","updated_at":"2025-04-10T00:17:47.013Z","avatar_url":"https://github.com/JingMatrix.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Detecting library injection in memory\n\n## Detection using `solist`\n\nIn Bionic linker, the [soinfo](https://cs.android.com/android/platform/superproject/main/+/main:bionic/linker/linker_soinfo.h) structure has a [field next](https://cs.android.com/android/platform/superproject/main/+/main:bionic/linker/linker_soinfo.h;l=186), which points to the next loaded library in a linked list consisting of all loaded libraries.\n\nHence, an injected application can easily find all loaded libraries.\n\n### Detection criteria\n\nThe following cases are considered as injections:\n1. some `soinfo` object has empty pathname;\n2. the linked list of all `soinfo` has gaps between elements, and such gap appears before [specializeAppProcess](https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/core/java/com/android/internal/os/Zygote.java;l=436).\n\n## Detection using `virtual maps`\n\nSee blog [Android 用户态注入隐藏已死](https://nullptr.icu/index.php/archives/182/).\n\n## Detection using `module counter`\n\nA call to `dlclose` will increase the counter [g_module_unload_counter](https://cs.android.com/android/platform/superproject/main/+/main:bionic/linker/linker.cpp;l=1956).\n\nThis detection highly depends on Android OS and vendor customization, which is shown to be false positive on Samsung and OnePlus.\n\n## State of bypassing current test\n\n- [ ] [Zygisk of Magisk](https://github.com/topjohnwu/Magisk)\n- [ ] [ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext)\n- [x] [ReZygisk](https://github.com/PerformanC/ReZygisk) (fixed by JingMatrix in https://github.com/PerformanC/ReZygisk/pull/101)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjingmatrix%2Fdemo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjingmatrix%2Fdemo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjingmatrix%2Fdemo/lists"}