Skip to content

Commit

Permalink
use zero-legacy library
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackerl committed Oct 20, 2023
1 parent 0b68814 commit 57f8627
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ int main(int argc, char *argv[]) {

LOG_INFO("exec %s", zero::strings::join(arguments, " ").c_str());

std::optional<zero::os::procfs::Process> 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<std::list<pid_t>> 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;
}

Expand Down
8 changes: 4 additions & 4 deletions ptrace/executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,17 +343,17 @@ Executor::call(void *shellcode, size_t length, uintptr_t base, uintptr_t stack,
}

std::optional<uintptr_t> Executor::findExecMemory() const {
std::optional<zero::os::procfs::Process> 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<std::list<zero::os::procfs::MemoryMapping>> 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;
}

Expand Down
4 changes: 2 additions & 2 deletions vcpkg-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
{
"kind": "git",
"repository": "https://github.com/Hackerl/vcpkg-registry",
"baseline": "0688d7a1a7a24bb3a65c3e7805affc84c6ed2eb4",
"baseline": "fab60abc30e6ee4b22e190f27dff4e8b91459369",
"packages": [
"zero"
"zero-legacy"
]
}
]
Expand Down
4 changes: 2 additions & 2 deletions vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"builtin-baseline": "69efe9cc2df0015f0bb2d37d55acde4a75c9a25b",
"dependencies": [
{
"name": "zero",
"version>=": "1.0.2"
"name": "zero-legacy",
"version>=": "1.0.0"
}
]
}

0 comments on commit 57f8627

Please sign in to comment.