Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2569)

Unified Diff: hax/hax.cc

Issue 2268853002: example failure for UncheckedMalloc + DSO (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « hax/BUILD.gn ('k') | hax/haxlib.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: hax/hax.cc
diff --git a/hax/hax.cc b/hax/hax.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7d2906fa1931a41d9e564c3f34a0e870a3969ddf
--- /dev/null
+++ b/hax/hax.cc
@@ -0,0 +1,24 @@
+#include <dlfcn.h>
+
+#include "base/base_paths.h"
+#include "base/debug/stack_trace.h"
+#include "base/files/file_path.h"
+#include "base/path_service.h"
+
+int main(int argc, char* argv[]) {
+ 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;
+}
« no previous file with comments | « hax/BUILD.gn ('k') | hax/haxlib.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698