1
0
mirror of https://github.com/0O0o0oOoO00/Alas.git synced 2026-05-20 11:39:28 +08:00
Files
Alas/blcrack/cracker/Dobby/tests/test_native.cpp
2025-11-01 00:23:46 +08:00

31 lines
532 B
C++

#include "dobby.h"
#include <unistd.h>
#include <stdio.h>
#define LOG(fmt, ...) printf("[test_native] " fmt, ##__VA_ARGS__)
void test_execve() {
char *argv[] = {NULL};
char *envp[] = {NULL};
LOG("test execve");
DobbyInstrument(DobbySymbolResolver(0, "_execve"), [](void *, DobbyRegisterContext *ctx) {
LOG("execve: %s", (char *)ctx->general.regs.rdi);
return;
});
execve("ls", argv, envp);
return;
}
int main(int argc, char *argv[]) {
log_set_level(0);
test_execve();
return 0;
}