soot.Body.validate()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(157)

本文整理了Java中soot.Body.validate()方法的一些代码示例,展示了Body.validate()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Body.validate()方法的具体详情如下:
包路径:soot.Body
类名称:Body
方法名:validate

Body.validate介绍

[英]Verifies a few sanity conditions on the contents on this body.
[中]验证此正文内容的一些健全条件。

代码示例

代码示例来源:origin: Sable/soot

/** Verifies a few sanity conditions on the contents on this body. */
public void validate() {
 List<ValidationException> exceptionList = new ArrayList<ValidationException>();
 validate(exceptionList);
 if (!exceptionList.isEmpty()) {
  throw exceptionList.get(0);
 }
}

代码示例来源:origin: Sable/soot

/**
  * Prints out the method corresponding to b Body, (declaration and body), in the textual format corresponding to the IR
  * used to encode b body.
  *
  * @param out
  *          a PrintWriter instance to print to.
  */
 private void printTo(Body b, PrintWriter out) {
  b.validate();

  printStatementsInBody(b, out);

 }
}

代码示例来源:origin: Sable/soot

/**
 * Prints out the method corresponding to b Body, (declaration and body), in the textual format corresponding to the IR
 * used to encode b body.
 *
 * @param out
 *          a PrintWriter instance to print to.
 */
private void printTo(Body b, PrintWriter out) {
 b.validate();
 String decl = b.getMethod().getDavaDeclaration();
 {
  out.println("    " + decl);
  for (Iterator<Tag> tIt = b.getMethod().getTags().iterator(); tIt.hasNext();) {
   final Tag t = tIt.next();
   if (Options.v().print_tags_in_output()) {
    out.println(t);
   }
  }
  out.println("    {");
  /*
   * The locals are now printed out from within the toString method of ASTMethodNode Nomair A Naeem 10-MARCH-2005
   */
  // printLocalsInBody(b, out);
 }
 printStatementsInBody(b, out);
 out.println("    }");
}

代码示例来源:origin: Sable/soot

inlineRelectiveCalls(m, classForNameClassNames, ReflectionTraceInfo.Kind.ClassForName);
if (Options.v().validate()) {
 b.validate();
inlineRelectiveCalls(m, classNewInstanceClassNames, ReflectionTraceInfo.Kind.ClassNewInstance);
if (Options.v().validate()) {
 b.validate();
inlineRelectiveCalls(m, constructorNewInstanceSignatures, ReflectionTraceInfo.Kind.ConstructorNewInstance);
if (Options.v().validate()) {
 b.validate();
inlineRelectiveCalls(m, methodInvokeSignatures, ReflectionTraceInfo.Kind.MethodInvoke);
if (Options.v().validate()) {
 b.validate();
inlineRelectiveCalls(m, fieldSetSignatures, ReflectionTraceInfo.Kind.FieldSet);
if (Options.v().validate()) {
 b.validate();
inlineRelectiveCalls(m, fieldGetSignatures, ReflectionTraceInfo.Kind.FieldGet);
if (Options.v().validate()) {
 b.validate();

代码示例来源:origin: Sable/soot

PackManager.v().getPack("jtp").apply(body);
if (Options.v().validate()) {
 body.validate();

代码示例来源:origin: Sable/soot

newBody.validate();

代码示例来源:origin: Sable/soot

body.validate();

代码示例来源:origin: jayhorn/jayhorn

body.validate();

代码示例来源:origin: jayhorn/jayhorn

body.validate();

代码示例来源:origin: jayhorn/jayhorn

body.validate();

代码示例来源:origin: jayhorn/jayhorn

body.validate();

代码示例来源:origin: jayhorn/jayhorn

body.validate();
} catch (soot.validation.ValidationException e) {
  System.out.println("Unable to validate method body. Possible NullPointerException?");

代码示例来源:origin: ibinti/bugvm

b.validate();

代码示例来源:origin: com.bugvm/bugvm-soot

b.validate();

代码示例来源:origin: secure-software-engineering/FlowDroid

body.validate();

代码示例来源:origin: secure-software-engineering/soot-infoflow-android

body.validate();

代码示例来源:origin: secure-software-engineering/FlowDroid

mainMethod.getActiveBody().validate();

代码示例来源:origin: secure-software-engineering/soot-infoflow

mainMethod.getActiveBody().validate();

代码示例来源:origin: secure-software-engineering/FlowDroid

b.getUnits().add(retStmt);
b.validate();

代码示例来源:origin: secure-software-engineering/FlowDroid

/**
 * Patch android.app.Activity getApplication method in order to return the
 * singleton Application instance created in the dummyMainMethod.
 */
private void patchActivityImplementation() {
  SootClass scApplicationHolder = createOrGetApplicationHolder();
  SootClass sc = Scene.v().getSootClassUnsafe("android.app.Activity");
  if (sc == null || sc.resolvingLevel() < SootClass.SIGNATURES || scApplicationHolder == null)
    return;
  sc.setLibraryClass();
  SootMethod smRun = sc.getMethodUnsafe("android.app.Application getApplication()");
  if (smRun == null || (smRun.hasActiveBody() && !isStubImplementation(smRun.getActiveBody())))
    return;
  smRun.setPhantom(false);
  smRun.addTag(new FlowDroidEssentialMethodTag());
  Body b = Jimple.v().newBody(smRun);
  smRun.setActiveBody(b);
  // add "this" local
  Local thisLocal = Jimple.v().newLocal("this", sc.getType());
  b.getLocals().add(thisLocal);
  b.getUnits().add(Jimple.v().newIdentityStmt(thisLocal, Jimple.v().newThisRef(sc.getType())));
  SootFieldRef appStaticFieldRef = scApplicationHolder.getFieldByName("application").makeRef();
  // creating local to store the mApplication field
  Local targetLocal = Jimple.v().newLocal("retApplication", appStaticFieldRef.type());
  b.getLocals().add(targetLocal);
  b.getUnits().add(Jimple.v().newAssignStmt(targetLocal, Jimple.v().newStaticFieldRef(appStaticFieldRef)));
  Unit retStmt = Jimple.v().newReturnStmt(targetLocal);
  b.getUnits().add(retStmt);
  b.validate();
}

相关文章