Program: 62002
Project: 62002
Buggy source:
@SuppressWarnings("String_Node_Str") private static boolean readActionListAtPos(List<DisassemblyListener> listeners,List<GraphTargetItem> output,HashMap<Long,List<GraphSourceItemContainer>> containers,long address,long containerSWFOffset,List<Object> localData,Stack<GraphTargetItem> stack,ConstantPool cpool,SWFInputStream sis,ReReadableInputStream rri,int ip,List<Action> ret,int startIp,int endip,String path,Map<Integer,Integer> visited,boolean indeterminate,Map<Integer,HashMap<String,GraphTargetItem>> decisionStates) throws IOException {
  boolean debugMode=false;
  boolean decideBranch=false;
  boolean deobfuscate=Configuration.getConfig("String_Node_Str",true);
  boolean retv=false;
  rri.setPos(ip);
  Action a;
  long filePos=rri.getPos();
  Scanner sc=new Scanner(System.in,"String_Node_Str");
  int prevIp=ip;
  loopip:   while (((endip == -1) || (endip > ip)) && (a=sis.readAction(rri)) != null) {
    if (!visited.containsKey(ip)) {
      visited.put(ip,0);
    }
    int curVisited=visited.get(ip);
    curVisited++;
    visited.put(ip,curVisited);
    for (int i=0; i < listeners.size(); i++) {
      listeners.get(i).progress("String_Node_Str",rri.getCount(),rri.length());
    }
    if ((ip < ret.size()) && (!(ret.get(ip) instanceof ActionNop))) {
      a=ret.get(ip);
      if (a.getAddress() != ip) {
        Logger.getLogger(SWFInputStream.class.getName()).log(Level.SEVERE,"String_Node_Str" + ip + "String_Node_Str"+ a.getASMSource(new ArrayList<GraphSourceItem>(),new ArrayList<Long>(),new ArrayList<String>(),SWF.DEFAULT_VERSION,false));
      }
    }
    a.containerSWFOffset=containerSWFOffset;
    a.setAddress(prevIp,SWF.DEFAULT_VERSION,false);
    int info=a.actionLength + 1 + ((a.actionCode > 0x80) ? 2 : 0);
    byte b[]=a.getBytes(sis.version);
    int infoCorrect=info;
    if ((!(a instanceof ActionStore)) && (!(a instanceof GraphSourceItemContainer))) {
      int change=info - (rri.getPos() - ip);
      if (change > 0) {
        a.afterInsert=new ActionJump(change);
      }
    }
 else {
      info=rri.getPos() - ip;
    }
    if (ip < startIp) {
      retv=true;
    }
    if (a instanceof ActionPush) {
      if (cpool != null) {
        ((ActionPush)a).constantPool=cpool.constants;
        cpool.count++;
      }
    }
    if (a instanceof ActionDefineFunction) {
      if (cpool != null) {
        cpool.count++;
      }
    }
    if (a instanceof ActionDefineFunction2) {
      if (cpool != null) {
        cpool.count++;
      }
    }
    if (debugMode) {
      String atos=a.getASMSource(new ArrayList<GraphSourceItem>(),new ArrayList<Long>(),cpool.constants,sis.version,false);
      if (a instanceof GraphSourceItemContainer) {
        atos=a.toString();
      }
      System.err.println("String_Node_Str" + (ip - startIp) + "String_Node_Str"+ Helper.formatAddress(ip - startIp)+ "String_Node_Str"+ "String_Node_Str"+ a.actionLength+ "String_Node_Str"+ atos+ (a.isIgnored() ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ Helper.stackToString(stack,Helper.toList(cpool))+ "String_Node_Str"+ Helper.byteArrToString(a.getBytes(SWF.DEFAULT_VERSION)));
      @SuppressWarnings("String_Node_Str") HashMap<String,GraphTargetItem> vars=(HashMap<String,GraphTargetItem>)localData.get(1);
      System.err.print("String_Node_Str");
      for (      Entry<String,GraphTargetItem> v : vars.entrySet()) {
        System.err.print("String_Node_Str" + v + "String_Node_Str"+ v.getValue().toString(false,cpool)+ "String_Node_Str");
      }
      System.err.println();
      String add="String_Node_Str";
      if (a instanceof ActionIf) {
        add="String_Node_Str" + ((ActionIf)a).getJumpOffset();
      }
      if (a instanceof ActionJump) {
        add="String_Node_Str" + ((ActionJump)a).getJumpOffset();
      }
      System.err.println(add);
    }
    long newFilePos=rri.getPos();
    long actionLen=newFilePos - filePos;
    ensureCapacity(ret,ip);
    int newip=-1;
    if (a instanceof ActionConstantPool) {
      if (cpool == null) {
        cpool=new ConstantPool();
      }
      cpool.setNew(((ActionConstantPool)a).constantPool);
    }
    ActionIf aif=null;
    boolean goaif=false;
    if (!a.isIgnored()) {
      String varname=null;
      if (a instanceof StoreTypeAction) {
        StoreTypeAction sta=(StoreTypeAction)a;
        varname=sta.getVariableName(stack,cpool);
      }
      try {
        if (a instanceof ActionIf) {
          aif=(ActionIf)a;
          GraphTargetItem top=null;
          if (deobfuscate) {
            top=stack.pop();
          }
          int nip=rri.getPos() + aif.getJumpOffset();
          if (decideBranch) {
            System.out.print("String_Node_Str" + nip + "String_Node_Str");
            System.out.print("String_Node_Str");
            String next=sc.next();
            if (next.equals("String_Node_Str")) {
              newip=rri.getPos() + aif.getJumpOffset();
              rri.setPos(newip);
            }
 else             if (next.equals("String_Node_Str")) {
            }
 else             if (next.equals("String_Node_Str")) {
              goaif=true;
            }
          }
 else           if (deobfuscate && top.isCompileTime() && (!top.hasSideEffect())) {
            ((ActionIf)a).compileTime=true;
            if (debugMode) {
              System.err.print("String_Node_Str");
            }
            if (EcmaScript.toBoolean(top.getResult())) {
              newip=rri.getPos() + aif.getJumpOffset();
              aif.jumpUsed=true;
              if (aif.ignoreUsed) {
                aif.compileTime=false;
              }
              if (debugMode) {
                System.err.println("String_Node_Str");
              }
            }
 else {
              aif.ignoreUsed=true;
              if (aif.jumpUsed) {
                aif.compileTime=false;
              }
              if (debugMode) {
                System.err.println("String_Node_Str");
              }
            }
          }
 else {
            if (debugMode) {
              System.err.println("String_Node_Str");
            }
            goaif=true;
          }
        }
 else         if (a instanceof ActionJump) {
          newip=rri.getPos() + ((ActionJump)a).getJumpOffset();
        }
 else         if (!(a instanceof GraphSourceItemContainer)) {
          if (deobfuscate) {
            if (((a instanceof ActionEquals) || (a instanceof ActionEquals2)) && (stack.size() == 1) && (stack.peek() instanceof DirectValueActionItem)) {
              stack.push(new DirectValueActionItem(null,0,new Null(),new ArrayList<String>()));
            }
            if ((a instanceof ActionStoreRegister) && stack.isEmpty()) {
              stack.push(new DirectValueActionItem(null,0,new Null(),new ArrayList<String>()));
            }
            a.translate(localData,stack,output,Graph.SOP_USE_STATIC,path);
          }
        }
      }
 catch (      RuntimeException ex) {
        log.log(Level.SEVERE,"String_Node_Str",ex);
        break;
      }
      HashMap<String,GraphTargetItem> vars=(HashMap<String,GraphTargetItem>)localData.get(1);
      if (varname != null) {
        GraphTargetItem varval=vars.get(varname);
        if (varval != null && varval.isCompileTime() && indeterminate) {
          vars.put(varname,new NotCompileTimeItem(null,varval));
        }
      }
    }
    int nopos=-1;
    for (int i=0; i < actionLen; i++) {
      ensureCapacity(ret,ip + i);
      if (a instanceof ActionNop) {
        int prevPos=(int)a.getAddress();
        a=new ActionNop();
        a.setAddress(prevPos,SWF.DEFAULT_VERSION);
        nopos++;
        if (nopos > 0) {
          a.setAddress(a.getAddress() + 1,SWF.DEFAULT_VERSION);
        }
      }
      ret.set(ip + i,a);
    }
    if (a instanceof GraphSourceItemContainer) {
      GraphSourceItemContainer cnt=(GraphSourceItemContainer)a;
      if (a instanceof Action) {
        long endAddr=a.getAddress() + cnt.getHeaderSize();
        String cntName=cnt.getName();
        List<List<GraphTargetItem>> output2s=new ArrayList<>();
        for (        long size : cnt.getContainerSizes()) {
          if (size == 0) {
            output2s.add(new ArrayList<GraphTargetItem>());
            continue;
          }
          List<Object> localData2;
          List<GraphTargetItem> output2=new ArrayList<>();
          if ((cnt instanceof ActionDefineFunction) || (cnt instanceof ActionDefineFunction2)) {
            localData2=Helper.toList(new HashMap<Integer,String>(),new HashMap<String,GraphTargetItem>(),new HashMap<String,GraphTargetItem>());
          }
 else {
            localData2=localData;
          }
          readActionListAtPos(listeners,output2,containers,address,containerSWFOffset,localData2,new Stack<GraphTargetItem>(),cpool,sis,rri,(int)endAddr,ret,startIp,(int)(endAddr + size),path + (cntName == null ? "String_Node_Str" : "String_Node_Str" + cntName),visited,indeterminate,decisionStates);
          output2s.add(output2);
          endAddr+=size;
        }
        if (deobfuscate) {
          cnt.translateContainer(output2s,stack,output,(HashMap<Integer,String>)localData.get(0),(HashMap<String,GraphTargetItem>)localData.get(1),(HashMap<String,GraphTargetItem>)localData.get(2));
        }
        ip=(int)endAddr;
        prevIp=ip;
        rri.setPos(ip);
        filePos=rri.getPos();
        continue;
      }
    }
    if (a instanceof ActionEnd) {
      break;
    }
    if (newip > -1) {
      ip=newip;
    }
 else {
      ip=ip + info;
    }
    rri.setPos(ip);
    filePos=rri.getPos();
    if (goaif) {
      aif.ignoreUsed=true;
      aif.jumpUsed=true;
      indeterminate=true;
      HashMap<String,GraphTargetItem> vars=(HashMap<String,GraphTargetItem>)localData.get(1);
      boolean stateChanged=false;
      if (decisionStates.containsKey(ip)) {
        HashMap<String,GraphTargetItem> oldstate=decisionStates.get(ip);
        if (oldstate.size() != vars.size()) {
          stateChanged=true;
        }
 else {
          for (          String k : vars.keySet()) {
            if (!oldstate.containsKey(k)) {
              stateChanged=true;
              break;
            }
            if (!vars.get(k).isCompileTime() && oldstate.get(k).isCompileTime()) {
              stateChanged=true;
              break;
            }
          }
        }
      }
      HashMap<String,GraphTargetItem> curstate=new HashMap<>();
      curstate.putAll(vars);
      decisionStates.put(ip,curstate);
      if ((!stateChanged) && curVisited > 1) {
        List<Integer> branches=new ArrayList<>();
        branches.add(rri.getPos() + aif.getJumpOffset());
        branches.add(rri.getPos());
        for (        int br : branches) {
          int visc=0;
          if (visited.containsKey(br)) {
            visc=visited.get(br);
          }
          if (visc == 0) {
            ip=br;
            prevIp=ip;
            rri.setPos(br);
            filePos=rri.getPos();
            continue loopip;
          }
        }
        break loopip;
      }
      int oldPos=rri.getPos();
      @SuppressWarnings("String_Node_Str") Stack<GraphTargetItem> substack=(Stack<GraphTargetItem>)stack.clone();
      if (readActionListAtPos(listeners,output,containers,address,containerSWFOffset,prepareLocalBranch(localData),substack,cpool,sis,rri,rri.getPos() + aif.getJumpOffset(),ret,startIp,endip,path,visited,indeterminate,decisionStates)) {
        retv=true;
      }
      rri.setPos(oldPos);
    }
    prevIp=ip;
    if (a.isExit()) {
      break;
    }
  }
  for (  DisassemblyListener listener : listeners) {
    listener.progress("String_Node_Str",rri.getCount(),rri.length());
  }
  return retv;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private static boolean readActionListAtPos(List<DisassemblyListener> listeners,List<GraphTargetItem> output,HashMap<Long,List<GraphSourceItemContainer>> containers,long containerSWFOffset,List<Object> localData,Stack<GraphTargetItem> stack,ConstantPool cpool,SWFInputStream sis,ReReadableInputStream rri,int ip,List<Action> ret,int startIp,int endip,String path,Map<Integer,Integer> visited,boolean indeterminate,Map<Integer,HashMap<String,GraphTargetItem>> decisionStates) throws IOException {
  boolean debugMode=false;
  boolean decideBranch=false;
  boolean deobfuscate=Configuration.getConfig("String_Node_Str",true);
  boolean retv=false;
  rri.setPos(ip);
  Action a;
  long filePos=rri.getPos();
  Scanner sc=new Scanner(System.in,"String_Node_Str");
  int prevIp=ip;
  loopip:   while (((endip == -1) || (endip > ip)) && (a=sis.readAction(rri,cpool)) != null) {
    if (!visited.containsKey(ip)) {
      visited.put(ip,0);
    }
    int curVisited=visited.get(ip);
    curVisited++;
    visited.put(ip,curVisited);
    for (int i=0; i < listeners.size(); i++) {
      listeners.get(i).progress("String_Node_Str",rri.getCount(),rri.length());
    }
    if ((ip < ret.size()) && (!(ret.get(ip) instanceof ActionNop))) {
      a=ret.get(ip);
      if (a.getAddress() != ip) {
        Logger.getLogger(SWFInputStream.class.getName()).log(Level.SEVERE,"String_Node_Str" + ip + "String_Node_Str"+ a.getASMSource(new ArrayList<GraphSourceItem>(),new ArrayList<Long>(),new ArrayList<String>(),SWF.DEFAULT_VERSION,false));
      }
    }
    a.containerSWFOffset=containerSWFOffset;
    a.setAddress(prevIp,SWF.DEFAULT_VERSION,false);
    int info=a.actionLength + 1 + ((a.actionCode > 0x80) ? 2 : 0);
    byte b[]=a.getBytes(sis.version);
    int infoCorrect=info;
    if ((!(a instanceof ActionStore)) && (!(a instanceof GraphSourceItemContainer))) {
      int change=info - (rri.getPos() - ip);
      if (change > 0) {
        a.afterInsert=new ActionJump(change);
      }
    }
 else {
      info=rri.getPos() - ip;
    }
    if (ip < startIp) {
      retv=true;
    }
    if (a instanceof ActionPush) {
      if (cpool != null) {
        ((ActionPush)a).constantPool=cpool.constants;
        cpool.count++;
      }
    }
    if (a instanceof ActionDefineFunction) {
      if (cpool != null) {
        cpool.count++;
      }
    }
    if (a instanceof ActionDefineFunction2) {
      if (cpool != null) {
        cpool.count++;
      }
    }
    if (debugMode) {
      String atos=a.getASMSource(new ArrayList<GraphSourceItem>(),new ArrayList<Long>(),cpool.constants,sis.version,false);
      if (a instanceof GraphSourceItemContainer) {
        atos=a.toString();
      }
      System.err.println("String_Node_Str" + (ip - startIp) + "String_Node_Str"+ Helper.formatAddress(ip - startIp)+ "String_Node_Str"+ "String_Node_Str"+ a.actionLength+ "String_Node_Str"+ atos+ (a.isIgnored() ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ Helper.stackToString(stack,Helper.toList(cpool))+ "String_Node_Str"+ Helper.byteArrToString(a.getBytes(SWF.DEFAULT_VERSION)));
      @SuppressWarnings("String_Node_Str") HashMap<String,GraphTargetItem> vars=(HashMap<String,GraphTargetItem>)localData.get(1);
      System.err.print("String_Node_Str");
      for (      Entry<String,GraphTargetItem> v : vars.entrySet()) {
        System.err.print("String_Node_Str" + v + "String_Node_Str"+ v.getValue().toString(false,cpool)+ "String_Node_Str");
      }
      System.err.println();
      String add="String_Node_Str";
      if (a instanceof ActionIf) {
        add="String_Node_Str" + ((ActionIf)a).getJumpOffset();
      }
      if (a instanceof ActionJump) {
        add="String_Node_Str" + ((ActionJump)a).getJumpOffset();
      }
      System.err.println(add);
    }
    long newFilePos=rri.getPos();
    long actionLen=newFilePos - filePos;
    ensureCapacity(ret,ip);
    int newip=-1;
    if (a instanceof ActionConstantPool) {
      if (cpool == null) {
        cpool=new ConstantPool();
      }
      cpool.setNew(((ActionConstantPool)a).constantPool);
    }
    ActionIf aif=null;
    boolean goaif=false;
    if (!a.isIgnored()) {
      String varname=null;
      if (a instanceof StoreTypeAction) {
        StoreTypeAction sta=(StoreTypeAction)a;
        varname=sta.getVariableName(stack,cpool);
      }
      try {
        if (a instanceof ActionIf) {
          aif=(ActionIf)a;
          GraphTargetItem top=null;
          if (deobfuscate) {
            top=stack.pop();
          }
          int nip=rri.getPos() + aif.getJumpOffset();
          if (decideBranch) {
            System.out.print("String_Node_Str" + nip + "String_Node_Str");
            System.out.print("String_Node_Str");
            String next=sc.next();
            if (next.equals("String_Node_Str")) {
              newip=rri.getPos() + aif.getJumpOffset();
              rri.setPos(newip);
            }
 else             if (next.equals("String_Node_Str")) {
            }
 else             if (next.equals("String_Node_Str")) {
              goaif=true;
            }
          }
 else           if (deobfuscate && top.isCompileTime() && (!top.hasSideEffect())) {
            ((ActionIf)a).compileTime=true;
            if (debugMode) {
              System.err.print("String_Node_Str");
            }
            if (EcmaScript.toBoolean(top.getResult())) {
              newip=rri.getPos() + aif.getJumpOffset();
              aif.jumpUsed=true;
              if (aif.ignoreUsed) {
                aif.compileTime=false;
              }
              if (debugMode) {
                System.err.println("String_Node_Str");
              }
            }
 else {
              aif.ignoreUsed=true;
              if (aif.jumpUsed) {
                aif.compileTime=false;
              }
              if (debugMode) {
                System.err.println("String_Node_Str");
              }
            }
          }
 else {
            if (debugMode) {
              System.err.println("String_Node_Str");
            }
            goaif=true;
          }
        }
 else         if (a instanceof ActionJump) {
          newip=rri.getPos() + ((ActionJump)a).getJumpOffset();
        }
 else         if (!(a instanceof GraphSourceItemContainer)) {
          if (deobfuscate) {
            if (((a instanceof ActionEquals) || (a instanceof ActionEquals2)) && (stack.size() == 1) && (stack.peek() instanceof DirectValueActionItem)) {
              stack.push(new DirectValueActionItem(null,0,new Null(),new ArrayList<String>()));
            }
            if ((a instanceof ActionStoreRegister) && stack.isEmpty()) {
              stack.push(new DirectValueActionItem(null,0,new Null(),new ArrayList<String>()));
            }
            a.translate(localData,stack,output,Graph.SOP_USE_STATIC,path);
          }
        }
      }
 catch (      RuntimeException ex) {
        log.log(Level.SEVERE,"String_Node_Str",ex);
        break;
      }
      HashMap<String,GraphTargetItem> vars=(HashMap<String,GraphTargetItem>)localData.get(1);
      if (varname != null) {
        GraphTargetItem varval=vars.get(varname);
        if (varval != null && varval.isCompileTime() && indeterminate) {
          vars.put(varname,new NotCompileTimeItem(null,varval));
        }
      }
    }
    int nopos=-1;
    for (int i=0; i < actionLen; i++) {
      ensureCapacity(ret,ip + i);
      if (a instanceof ActionNop) {
        int prevPos=(int)a.getAddress();
        a=new ActionNop();
        a.setAddress(prevPos,SWF.DEFAULT_VERSION);
        nopos++;
        if (nopos > 0) {
          a.setAddress(a.getAddress() + 1,SWF.DEFAULT_VERSION);
        }
      }
      ret.set(ip + i,a);
    }
    if (a instanceof GraphSourceItemContainer) {
      GraphSourceItemContainer cnt=(GraphSourceItemContainer)a;
      if (a instanceof Action) {
        long endAddr=a.getAddress() + cnt.getHeaderSize();
        String cntName=cnt.getName();
        List<List<GraphTargetItem>> output2s=new ArrayList<>();
        for (        long size : cnt.getContainerSizes()) {
          if (size == 0) {
            output2s.add(new ArrayList<GraphTargetItem>());
            continue;
          }
          List<Object> localData2;
          List<GraphTargetItem> output2=new ArrayList<>();
          if ((cnt instanceof ActionDefineFunction) || (cnt instanceof ActionDefineFunction2)) {
            localData2=Helper.toList(new HashMap<Integer,String>(),new HashMap<String,GraphTargetItem>(),new HashMap<String,GraphTargetItem>());
          }
 else {
            localData2=localData;
          }
          readActionListAtPos(listeners,output2,containers,containerSWFOffset,localData2,new Stack<GraphTargetItem>(),cpool,sis,rri,(int)endAddr,ret,startIp,(int)(endAddr + size),path + (cntName == null ? "String_Node_Str" : "String_Node_Str" + cntName),visited,indeterminate,decisionStates);
          output2s.add(output2);
          endAddr+=size;
        }
        if (deobfuscate) {
          cnt.translateContainer(output2s,stack,output,(HashMap<Integer,String>)localData.get(0),(HashMap<String,GraphTargetItem>)localData.get(1),(HashMap<String,GraphTargetItem>)localData.get(2));
        }
        ip=(int)endAddr;
        prevIp=ip;
        rri.setPos(ip);
        filePos=rri.getPos();
        continue;
      }
    }
    if (a instanceof ActionEnd) {
      break;
    }
    if (newip > -1) {
      ip=newip;
    }
 else {
      ip=ip + info;
    }
    rri.setPos(ip);
    filePos=rri.getPos();
    if (goaif) {
      aif.ignoreUsed=true;
      aif.jumpUsed=true;
      indeterminate=true;
      HashMap<String,GraphTargetItem> vars=(HashMap<String,GraphTargetItem>)localData.get(1);
      boolean stateChanged=false;
      if (decisionStates.containsKey(ip)) {
        HashMap<String,GraphTargetItem> oldstate=decisionStates.get(ip);
        if (oldstate.size() != vars.size()) {
          stateChanged=true;
        }
 else {
          for (          String k : vars.keySet()) {
            if (!oldstate.containsKey(k)) {
              stateChanged=true;
              break;
            }
            if (!vars.get(k).isCompileTime() && oldstate.get(k).isCompileTime()) {
              stateChanged=true;
              break;
            }
          }
        }
      }
      HashMap<String,GraphTargetItem> curstate=new HashMap<>();
      curstate.putAll(vars);
      decisionStates.put(ip,curstate);
      if ((!stateChanged) && curVisited > 1) {
        List<Integer> branches=new ArrayList<>();
        branches.add(rri.getPos() + aif.getJumpOffset());
        branches.add(rri.getPos());
        for (        int br : branches) {
          int visc=0;
          if (visited.containsKey(br)) {
            visc=visited.get(br);
          }
          if (visc == 0) {
            ip=br;
            prevIp=ip;
            rri.setPos(br);
            filePos=rri.getPos();
            continue loopip;
          }
        }
        break loopip;
      }
      int oldPos=rri.getPos();
      @SuppressWarnings("String_Node_Str") Stack<GraphTargetItem> substack=(Stack<GraphTargetItem>)stack.clone();
      if (readActionListAtPos(listeners,output,containers,containerSWFOffset,prepareLocalBranch(localData),substack,cpool,sis,rri,rri.getPos() + aif.getJumpOffset(),ret,startIp,endip,path,visited,indeterminate,decisionStates)) {
        retv=true;
      }
      rri.setPos(oldPos);
    }
    prevIp=ip;
    if (a.isExit()) {
      break;
    }
  }
  for (  DisassemblyListener listener : listeners) {
    listener.progress("String_Node_Str",rri.getCount(),rri.length());
  }
  return retv;
}