예제 #1
0
static void FixUpSection(uintptr_t load_address,
                         unsigned char *code,
                         size_t code_size) {
  struct NaClValidatorState *vstate;
  int bundle_size = 32;
  vstate = NaClValidatorStateCreate(load_address, code_size, bundle_size,
                                    RegR15);
  CHECK(vstate != NULL);
  NaClValidatorStateSetDoStubOut(vstate, TRUE);
  NaClValidateSegment(code, load_address, code_size, vstate);
  NaClValidatorStateDestroy(vstate);
}
예제 #2
0
파일: ncvalidate.c 프로젝트: camuel/zvm
NaClValidationStatus NaClApplyValidatorStubout_x86_64(
    uintptr_t guest_addr,
    uint8_t *data,
    size_t size,
    int bundle_size,
    Bool local_cpu) {
  CPUFeatures features;
  struct NaClValidatorState *vstate =
      NaClValidatorStateCreate(guest_addr, size, bundle_size, RegR15);
  if (vstate == NULL) return NaClValidationFailedOutOfMemory;
  NaClValidatorStateSetDoStubOut(vstate, TRUE);
  if (!local_cpu) {
    NaClSetAllCPUFeatures(&features);
    NaClValidatorStateSetCPUFeatures(vstate, &features);
  }
  NaClValidateSegment(data, guest_addr, size, vstate);
  NaClValidatorStateDestroy(vstate);
  return NaClValidationSucceeded;
}