org.objectweb.asm.commons.AnalyzerAdapter Java Examples

The following examples show how to use org.objectweb.asm.commons.AnalyzerAdapter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MonitorClassVisitor.java    From bistoury with GNU General Public License v3.0 6 votes vote down vote up
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
    final MethodVisitor methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
    if (name.equals(methodName) && desc.equals(methodDesc)) {
        logger.debug("visit method, name: {}, desc: {}", name, desc);

        MonitorMethodVisitor monitorMV = new MonitorMethodVisitor(methodVisitor, access, name, desc, className);

        AnalyzerAdapter analyzerAdapter = new AnalyzerAdapter(className, access, name, desc, monitorMV);
        monitorMV.setAnalyzerAdapter(analyzerAdapter);
        LocalVariablesSorter localVariablesSorter = new LocalVariablesSorter(access, desc, analyzerAdapter);
        monitorMV.setLocalVariablesSorter(localVariablesSorter);

        return localVariablesSorter;
    } else {
        return methodVisitor;
    }
}
 
Example #2
Source File: ASMTest.java    From bistoury with GNU General Public License v3.0 6 votes vote down vote up
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
    System.out.println(name);
    final MethodVisitor methodVisitor = super.visitMethod(access, name, desc, signature, exceptions);
    /*if (!"setCount".equals(name)) {
        return methodVisitor;
    }*/
    MonitorAdviceAdapter monitorMV = new MonitorAdviceAdapter(ASM7, methodVisitor, access, name, desc, className, exceptions);
    AnalyzerAdapter analyzerAdapter = new AnalyzerAdapter(className, access, name, desc, monitorMV);
    monitorMV.setAnalyzerAdapter(analyzerAdapter);
    LocalVariablesSorter localVariablesSorter = new LocalVariablesSorter(access, desc, analyzerAdapter);
    monitorMV.setLocalVariablesSorter(localVariablesSorter);
    //MonitorAdviceAdapter monitorMV = new MonitorAdviceAdapter(ASM7, new LocalVariablesSorter(access, desc, methodVisitor), access, name, desc, className, exceptions);

    return localVariablesSorter;
}
 
Example #3
Source File: TaintTrackingMethodVisitor.java    From gadgetinspector with MIT License 5 votes vote down vote up
public TaintTrackingMethodVisitor(InheritanceMap inheritanceMap,
                                  Map<MethodReference.Handle, Set<Integer>> passthroughDataflow,
                                  final int api, final MethodVisitor mv, final String owner, int access,
                                  String name, String desc, String signature, String[] exceptions) {
    super(api, new AnalyzerAdapter(owner, access, name, desc, mv));
    this.inheritanceMap = inheritanceMap;
    this.passthroughDataflow = passthroughDataflow;
    this.analyzerAdapter = (AnalyzerAdapter)this.mv;
    this.access = access;
    this.name = name;
    this.desc = desc;
    this.signature = signature;
    this.exceptions = exceptions;
}
 
Example #4
Source File: RegisterSpecAnalyzer.java    From buck with Apache License 2.0 5 votes vote down vote up
@Override
public MethodVisitor visitMethod(
    int access, String name, String desc, String signature, String[] exceptions) {
  RegSpecMethodVisitor mv = new RegSpecMethodVisitor(className, name);
  AnalyzerAdapter adapter = new AnalyzerAdapter(className, access, name, desc, mv);
  mv.adapter = adapter;
  return adapter;
}
 
Example #5
Source File: MonitorMethodVisitor.java    From bistoury with GNU General Public License v3.0 4 votes vote down vote up
public void setAnalyzerAdapter(AnalyzerAdapter analyzerAdapter) {
    this.analyzerAdapter = analyzerAdapter;
}
 
Example #6
Source File: MonitorAdviceAdapter.java    From bistoury with GNU General Public License v3.0 4 votes vote down vote up
public void setAnalyzerAdapter(AnalyzerAdapter analyzerAdapter) {
    this.analyzerAdapter = analyzerAdapter;
}