MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / ctor

Function ctor

Bcore/src/main/cpp/Dobby/example/android_common_api.cc:76–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74
75#if 1
76__attribute__((constructor)) static void ctor() {
77 void *func = NULL;
78 log_set_level(0);
79
80 func_map = new std::map<void *, const char *>();
81
82 for (int i = 0; i < sizeof(func_array) / sizeof(char *); ++i) {
83 func = DobbySymbolResolver(NULL, func_array[i]);
84 if (func == NULL) {
85 LOG(1, "func %s not resolve", func_array[i]);
86 continue;
87 }
88 func_map->insert(std::pair<void *, const char *>(func, func_array[i]));
89 DobbyInstrument(func, common_handler);
90 }
91 return;
92
93 DobbyInstrument((void *)((addr_t)art::gc::Heap::_11::PreZygoteFork + 1), common_handler);
94
95 pthread_t socket_server;
96 uint64_t socket_demo_server(void *ctx);
97 pthread_create(&socket_server, NULL, (void *(*)(void *))socket_demo_server, NULL);
98
99 usleep(1000);
100 pthread_t socket_client;
101 uint64_t socket_demo_client(void *ctx);
102 pthread_create(&socket_client, NULL, (void *(*)(void *))socket_demo_client, NULL);
103}
104
105#include <sys/socket.h>
106#include <netinet/in.h>

Callers

nothing calls this directly

Calls 4

log_set_levelFunction · 0.85
DobbyInstrumentFunction · 0.85
DobbySymbolResolverFunction · 0.50
insertMethod · 0.45

Tested by

no test coverage detected