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

Side by Side Diff: hax/hax.cc

Issue 2270923003: Alternative solution for crbug.com/594674 base ond DEEPBIND Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « hax/BUILD.gn ('k') | hax/haxlib.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #include <dlfcn.h>
2
3 #include "base/base_paths.h"
4 #include "base/debug/stack_trace.h"
5 #include "base/files/file_path.h"
6 #include "base/process/memory.h"
7
8 #include "base/path_service.h"
9
10 extern "C" void* tc_malloc();
11
12
13 int main(int argc, char* argv[]) {
14
15
16 printf("MAIN malloc: %p\n", &malloc);
17 printf("MAIN tc_malloc: %p\n", &tc_malloc);
18 printf("MAIN free: %p\n", &free);
19 printf("MAIN UncheckedMalloc: %p\n", &base::UncheckedMalloc);
20
21 base::debug::EnableInProcessStackDumping();
22
23 base::FilePath path;
24 base::PathService::Get(base::DIR_EXE, &path);
25 void* haxlib = dlopen(path.Append("libhaxlib.so").value().c_str(),
26 RTLD_NOW | RTLD_GLOBAL | RTLD_DEEPBIND);
27 CHECK(haxlib);
28
29 using HaxFunc = void (*)();
30 HaxFunc hax = reinterpret_cast<HaxFunc>(dlsym(haxlib, "Hax"));
31 CHECK(hax);
32
33 hax();
34
35 dlclose(haxlib);
36 return 0;
37 }
OLDNEW
« 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