Zygisk injector (#1)

* fix x86

* add lsplt

* transplant from zygisk

* api v4

Signed-off-by: 5ec1cff <ewtqyqyewtqyqy@gmail.com>

* Remove redundant logs

Signed-off-by: 5ec1cff <ewtqyqyewtqyqy@gmail.com>

---------

Signed-off-by: 5ec1cff <ewtqyqyewtqyqy@gmail.com>
This commit is contained in:
5ec1cff
2023-01-31 15:03:01 +08:00
committed by GitHub
parent 50a50a8d39
commit b8678720fb
28 changed files with 2476 additions and 22 deletions

View File

@@ -18,4 +18,5 @@ pub enum DaemonSocketAction {
ReadNativeBridge,
ReadModules,
RequestCompanionSocket,
GetModuleDir,
}

View File

@@ -213,6 +213,17 @@ fn handle_daemon_action(mut stream: UnixStream, context: &Context) -> Result<()>
}
}
}
DaemonSocketAction::GetModuleDir => {
unsafe {
let index = stream.read_usize()?;
let module = &context.modules[index];
let path = format!("{}/{}", constants::PATH_KSU_MODULE_DIR, module.name);
let filename = std::ffi::CString::new(path)?;
let fd = libc::open(filename.as_ptr(), libc::O_PATH | libc::O_CLOEXEC);
stream.send_fd(fd)?;
libc::close(fd);
}
}
}
Ok(())
}