From 57f86277f424c0cef45b0f78570fb5932cd34783 Mon Sep 17 00:00:00 2001 From: Hackerl <490021209@qq.com> Date: Fri, 20 Oct 2023 11:50:48 +0800 Subject: [PATCH] use zero-legacy library --- main.cpp | 8 ++++---- ptrace/executor.cpp | 8 ++++---- vcpkg-configuration.json | 4 ++-- vcpkg.json | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/main.cpp b/main.cpp index 2645f23..fc5c63a 100644 --- a/main.cpp +++ b/main.cpp @@ -42,17 +42,17 @@ int main(int argc, char *argv[]) { LOG_INFO("exec %s", zero::strings::join(arguments, " ").c_str()); - std::optional process = zero::os::procfs::openProcess(pid); + auto process = zero::os::procfs::openProcess(pid); if (!process) { - LOG_ERROR("open process %d failed", pid); + LOG_ERROR("open process %d failed[%s]", pid, process.error().message().c_str()); return -1; } - std::optional> tasks = process->tasks(); + auto tasks = process->tasks(); if (!tasks) { - LOG_ERROR("get process tasks failed"); + LOG_ERROR("get process tasks failed[%s]", tasks.error().message().c_str()); return -1; } diff --git a/ptrace/executor.cpp b/ptrace/executor.cpp index acb231f..c1641b2 100644 --- a/ptrace/executor.cpp +++ b/ptrace/executor.cpp @@ -343,17 +343,17 @@ Executor::call(void *shellcode, size_t length, uintptr_t base, uintptr_t stack, } std::optional Executor::findExecMemory() const { - std::optional process = zero::os::procfs::openProcess(mPID); + auto process = zero::os::procfs::openProcess(mPID); if (!process) { - LOG_ERROR("open process %d failed", mPID); + LOG_ERROR("open process %d failed[%s]", mPID, process.error().message().c_str()); return std::nullopt; } - std::optional> memoryMappings = process->maps(); + auto memoryMappings = process->maps(); if (!memoryMappings) { - LOG_ERROR("get process %d memory mappings failed", mPID); + LOG_ERROR("get process %d memory mappings failed[%s]", mPID, memoryMappings.error().message().c_str()); return std::nullopt; } diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json index e6920e9..d036fe5 100644 --- a/vcpkg-configuration.json +++ b/vcpkg-configuration.json @@ -3,9 +3,9 @@ { "kind": "git", "repository": "https://github.com/Hackerl/vcpkg-registry", - "baseline": "0688d7a1a7a24bb3a65c3e7805affc84c6ed2eb4", + "baseline": "fab60abc30e6ee4b22e190f27dff4e8b91459369", "packages": [ - "zero" + "zero-legacy" ] } ] diff --git a/vcpkg.json b/vcpkg.json index d8dcf44..c8ac12c 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -4,8 +4,8 @@ "builtin-baseline": "69efe9cc2df0015f0bb2d37d55acde4a75c9a25b", "dependencies": [ { - "name": "zero", - "version>=": "1.0.2" + "name": "zero-legacy", + "version>=": "1.0.0" } ] }