예제 #1
0
void callback(uint64_t env, char* name, map_properties_t* props) {
  if (contains_symbol(props, &main) || contains_symbol(props, unmappings) ||
      /* env is on the stack - this prevents it from being unmapped if
         the kernel gets confused by syscallbuf's stack switching */
      contains_symbol(props, &env) || props->start == RR_PAGE_ADDR ||
      strcmp(name, "[stack]") == 0) {
    return;
  }

  unmappings[2 * nunmappings] = (uintptr_t)props->start;
  unmappings[2 * nunmappings + 1] = (uintptr_t)(props->end - props->start);
  ++nunmappings;
}
예제 #2
0
bool Alphabet::contains_string(string string) {
    for (int i = 0; i < string.length(); i++) {
        if (!contains_symbol(string[i])) {
            return false;
        }
    }

    return true;
}