private void considerMethod(ClassContext classContext, Method method) { if ((method.getReturnType() instanceof ReferenceType) && classContext.getMethodGen(method) != null) { if (VERBOSE_DEBUG) { System.out.println("Check " + method); } analyzeMethod(classContext, method); } }
Type returnType = getMethod().getReturnType(); char retSigChar0 = returnType.getSignature().charAt(0); if ((retSigChar0 == 'V') && (seen == Const.RETURN)) {
@Override public java.lang.reflect.Type getReturnType() { return HBCEL.toJava(method.getReturnType()); } }.getFieldName();
private Type getReturnType(Method m) { Signature signature = this.getSignature(m); if(signature != null) { Matcher matcher = methodSignature.matcher(signature.getSignature()); if(matcher.matches()) { String returnSignature = matcher.group(2); if(isVoid.matcher(returnSignature).matches()){ return m.getReturnType(); // returning void } return GenericUtilities.getType(returnSignature); } } return m.getReturnType(); }
private void considerMethod(ClassContext classContext, Method method) { if ((method.getReturnType() instanceof ReferenceType) && classContext.getMethodGen(method) != null) { if (VERBOSE_DEBUG) { System.out.println("Check " + method); } analyzeMethod(classContext, method); } }
private boolean isStringClass(ClassGen cg) { if (cg.getMethods().length == 2 && cg.getMethods()[0].isStatic() && cg.getMethods()[1].isStatic()) { if (cg.getMethods()[0].getReturnType().toString().equals( "java.lang.String") && cg.getMethods()[1].getReturnType().toString().equals( "java.lang.String")) { return true; } } return false; }
private boolean isStringClassB(ClassGen cg) { if (cg.getMethods().length == 1 && cg.getMethods()[0].isStatic()) { if (cg.getMethods()[0].getReturnType().toString().equals("java.lang.String")) { return true; } } return false; }
@Override public int hashCode() { int hash = 7; hash = 67 * hash + bugType.hashCode(); hash = 67 * hash + originalPriority; hash = 67 * hash + classContext.getClassDescriptor().hashCode(); hash = 67 * hash + method.getName().hashCode(); hash = 67 * hash + method.getSignature().hashCode(); hash = 67 * hash + method.getReturnType().hashCode(); hash = 67 * hash + instructionHandle.getInstruction().getOpcode(); hash = 67 * hash + instructionHandle.getPosition(); return hash; }
/** * implements the visitor to filter out methods that don't return Boolean, * * * @param obj * the context object for the currently parsed code block */ @Override public void visitCode(Code obj) { try { Method m = getMethod(); Type retType = m.getReturnType(); if ("Ljava/lang/Boolean;".equals(retType.getSignature())) { stack.resetForMethodEntry(this); super.visitCode(obj); } } catch (StopOpcodeParsingException e) { // if the method was already reported } }
@Override public int hashCode() { int hash = 7; hash = 67 * hash + bugType.hashCode(); hash = 67 * hash + originalPriority; hash = 67 * hash + classContext.getClassDescriptor().hashCode(); hash = 67 * hash + method.getName().hashCode(); hash = 67 * hash + method.getSignature().hashCode(); hash = 67 * hash + method.getReturnType().hashCode(); hash = 67 * hash + instructionHandle.getInstruction().getOpcode(); hash = 67 * hash + instructionHandle.getPosition(); return hash; } }
/** * implements the visitor to filter out methods that don't return Boolean, * * * @param obj * the context object for the currently parsed code block */ @Override public void visitCode(Code obj) { try { Method m = getMethod(); Type retType = m.getReturnType(); if ("Ljava/lang/Boolean;".equals(retType.getSignature())) { stack.resetForMethodEntry(this); super.visitCode(obj); } } catch (StopOpcodeParsingException e) { // if the method was already reported } }
@Override public void visitCode(Code obj) { Method m = getMethod(); if (m.getReturnType() == Type.VOID) { return; } stack.resetForMethodEntry(this); ifBlocks.clear(); activeUnconditional = null; CodeException[] ces = obj.getExceptionTable(); if (CollectionUtils.isEmpty(ces)) { catchPCs = null; } else { catchPCs = new BitSet(); for (CodeException ce : ces) { catchPCs.set(ce.getHandlerPC()); } } gotoBranchPCs.clear(); casePositions.clear(); lookingForResetOp = false; try { super.visitCode(obj); } catch (StopOpcodeParsingException e) { // reported an issue, so get out } }
public boolean isAuthClass(ClassGen cg) { if (cg.getMethods().length == 2 && cg.getMethods()[0].getArgumentTypes().length == 1) { if (cg.getMethods()[0].getArgumentTypes()[0].getSignature().contains("String")) { if (cg.getMethods()[0].getReturnType().toString().contains("boolean")) { return true; } } } return false; }
@Override public void visitCode(Code obj) { Method m = getMethod(); if (m.getReturnType() == Type.VOID) { return; } stack.resetForMethodEntry(this); ifBlocks.clear(); activeUnconditional = null; CodeException[] ces = obj.getExceptionTable(); if (CollectionUtils.isEmpty(ces)) { catchPCs = null; } else { catchPCs = new BitSet(); for (CodeException ce : ces) { catchPCs.set(ce.getHandlerPC()); } } gotoBranchPCs.clear(); casePositions.clear(); lookingForResetOp = false; try { super.visitCode(obj); } catch (StopOpcodeParsingException e) { // reported an issue, so get out } }
MethodDesc( Method meth ) { this(meth.getName(), meth.getReturnType(), meth.getArgumentTypes(), (null == meth.getExceptionTable() ) ? new String[0] : meth.getExceptionTable().getExceptionNames()); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof InjectionSink)) { return false; } final InjectionSink other = (InjectionSink) obj; // include only attributes that cannot change after object construction return this.bugType.equals(other.bugType) && this.originalPriority == other.originalPriority && this.classContext.getClassDescriptor().equals(other.classContext.getClassDescriptor()) && this.method.getName().equals(other.method.getName()) && this.method.getSignature().equals(other.method.getSignature()) && this.method.getReturnType().equals(other.method.getReturnType()) && this.instructionHandle.getInstruction().getOpcode() == other.instructionHandle.getInstruction().getOpcode() && this.instructionHandle.getPosition() == other.instructionHandle.getPosition(); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof InjectionSink)) { return false; } final InjectionSink other = (InjectionSink) obj; // include only attributes that cannot change after object construction return this.bugType.equals(other.bugType) && this.originalPriority == other.originalPriority && this.classContext.getClassDescriptor().equals(other.classContext.getClassDescriptor()) && this.method.getName().equals(other.method.getName()) && this.method.getSignature().equals(other.method.getSignature()) && this.method.getReturnType().equals(other.method.getReturnType()) && this.instructionHandle.getInstruction().getOpcode() == other.instructionHandle.getInstruction().getOpcode() && this.instructionHandle.getPosition() == other.instructionHandle.getPosition(); }
public void setDecryptor() { for (ClassGen cg : cgs.values()) { for (Method m : cg.getMethods()) { try { if (m.isPublic() && m.isStatic() && m.getArgumentTypes()[0].toString().equals("java.lang.String") && m.getReturnType().toString().equals("java.lang.String")) { String dc = cg.getClassName() + "." + m.getName(); decryptor = m.getName(); decryptorclass = cg.getClassName(); logger.debug("Found String Decryptor! " + dc); return; } } catch (Exception e) { continue; } } } logger.error("String decrypt not found!"); }
public boolean isLoader(ClassGen cg) { return cg.getMethods().length == 3 && cg.getMethods()[1].isStatic() && cg.getMethods()[1].isFinal() && cg.getMethods()[1].isPublic() && cg.getMethods()[1].isSynchronized() && cg.getMethods()[1].getReturnType().toString().equals("java.lang.String"); }
addType(t); Type resultType = obj.getReturnType(); addType(resultType); LocalVariableTable lvt = obj.getLocalVariableTable();