| Index: hax/hax.cc
|
| diff --git a/hax/hax.cc b/hax/hax.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..66b82eb7d536db19f55cb5c1afa48f06074f1f98
|
| --- /dev/null
|
| +++ b/hax/hax.cc
|
| @@ -0,0 +1,36 @@
|
| +#include <dlfcn.h>
|
| +
|
| +#include "base/base_paths.h"
|
| +#include "base/debug/stack_trace.h"
|
| +#include "base/files/file_path.h"
|
| +#include "base/process/memory.h"
|
| +
|
| +#include "base/path_service.h"
|
| +
|
| + extern "C" void* tc_malloc();
|
| +
|
| +
|
| +int main(int argc, char* argv[]) {
|
| +
|
| +
|
| + printf("MAIN malloc: %p\n", &malloc);
|
| + printf("MAIN tc_malloc: %p\n", &tc_malloc);
|
| + printf("MAIN free: %p\n", &free);
|
| + printf("MAIN UncheckedMalloc: %p\n", &base::UncheckedMalloc);
|
| +
|
| + base::debug::EnableInProcessStackDumping();
|
| +
|
| + base::FilePath path;
|
| + base::PathService::Get(base::DIR_EXE, &path);
|
| + void* haxlib = dlopen(path.Append("libhaxlib.so").value().c_str(), RTLD_LAZY);
|
| + CHECK(haxlib);
|
| +
|
| + using HaxFunc = void (*)();
|
| + HaxFunc hax = reinterpret_cast<HaxFunc>(dlsym(haxlib, "Hax"));
|
| + CHECK(hax);
|
| +
|
| + hax();
|
| +
|
| + dlclose(haxlib);
|
| + return 0;
|
| +}
|
|
|