MCPcopy Create free account
hub / github.com/WrBug/dumpDex / isExecutableAddr

Function isExecutableAddr

app/src/main/cpp/inlineHook.c:186–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186static bool isExecutableAddr(uint32_t addr) {
187 FILE *fp;
188 char line[1024];
189 uint32_t start;
190 uint32_t end;
191
192 fp = fopen("/proc/self/maps", "r");
193 if (fp == NULL) {
194 return false;
195 }
196
197 while (fgets(line, sizeof(line), fp)) {
198 if (strstr(line, "r-xp") || strstr(line, "rwxp")) {
199 start = strtoul(strtok(line, "-"), NULL, 16);
200 end = strtoul(strtok(NULL, " "), NULL, 16);
201 if (addr >= start && addr <= end) {
202 fclose(fp);
203 return true;
204 }
205 }
206 }
207
208 fclose(fp);
209
210 return false;
211}
212
213static struct inlineHookItem *findInlineHookItem(uint32_t target_addr) {
214 int i;

Callers 1

registerInlineHookFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected