Package org.jakstab.asm

Examples of org.jakstab.asm.AbsoluteAddress


  protected abstract long getBaseAddress();
 
  @Override
  public RTLNumber readMemoryLocation(RTLMemoryLocation m) throws IOException {
    if (!(m.getAddress() instanceof RTLNumber)) return null;
    AbsoluteAddress va = new AbsoluteAddress((RTLNumber)m.getAddress());
    long fp = getFilePointer(va);
    if (getSectionNumber(fp) >= 0) {
      assert m.getBitWidth() % 8 == 0 : "Non-byte-aligned memory reference!";
      long val = 0;
      int bytes = m.getBitWidth()/8;
View Full Code Here


      }

      @Override
      public AbsoluteAddress next() {
        if (!hasNext()) throw new IndexOutOfBoundsException();
        AbsoluteAddress res =  getVirtualAddress(fp);
        moveToNextCodeByte();
        return res;
      }

      @Override
View Full Code Here

      // Add import symbol (hackish)
      if (targetExpression instanceof RTLMemoryLocation) {
        RTLMemoryLocation m = (RTLMemoryLocation)targetExpression;
        if (m.getAddress() instanceof RTLNumber) {
          long v = ((RTLNumber)m.getAddress()).longValue();
          AbsoluteAddress va = new AbsoluteAddress(v);
          ExecutableImage module = Program.getProgram().getModule(va);
          if (module != null) {
            String symbol = module.getSymbolFinder().getSymbolFor(va);
            if (!symbol.equals("")) res.append("(" + symbol + ")");
          } else {
View Full Code Here

    }
  }

  @Override
  public String getSymbolFor(long address) {
    return getSymbolFor(new AbsoluteAddress(address));
  }
View Full Code Here

   
    if (aMemVal.containsKey(m)) return aMemVal.get(m);
    else {
      // Check if the memory location references the program's data area or imports
      if (m.getAddress() instanceof RTLNumber) {
        AbsoluteAddress a = new AbsoluteAddress((RTLNumber)m.getAddress());
        ExecutableImage module = Program.getProgram().getModule(a);
        if (module == null) return NumberElement.getTop(m.getBitWidth());
        // only read memory from image if we havn't overapproximated yet or it's a read only section
        if (!dataIsTop || module.isReadOnly(a)) {
          try {
View Full Code Here

    ExplicitPrecision p = new ExplicitPrecision(varThreshold.getValue());
   
    // Increase precision of ecx, esi, edi for REP prefixed instructions
    Program program = Program.getProgram();
    if (BoundedAddressTracking.repPrecBoost.getValue()) {
      AbsoluteAddress addr = location.getAddress();
      X86Instruction instr = (X86Instruction)program.getInstruction(addr);
      if (instr != null && (instr.hasPrefixREPZ() || instr.hasPrefixREPNZ())) {
        logger.debug("boost-rep: REP instruction at " + location + ", increasing precision of loop registers.");
        p.setThreshold(ExpressionFactory.createVariable("%ecx"), 1000);
        p.setThreshold(ExpressionFactory.createVariable("%esi"), 1000);
View Full Code Here

              ExpressionFactory.createEqual(
                  stmt.getTargetExpression(),
                  targetValue)
          );
          // set next label to jump target
          nextLabel = new Location(new AbsoluteAddress(targetValue));
        }
      }
      assumption = assumption.evaluate(new Context());
      RTLAssume assume = new RTLAssume(assumption, stmt);
      assume.setLabel(stmt.getLabel());
View Full Code Here

              ExpressionFactory.createEqual(
                  stmt.getTargetExpression(),
                  targetValue)
              );
          // set next label to jump target
          nextLabel = new Location(new AbsoluteAddress(targetValue));
        }
      }
      assumption = assumption.evaluate(new Context());
      RTLAssume assume = new RTLAssume(assumption, stmt);
      assume.setLabel(stmt.getLabel());
View Full Code Here

              ExpressionFactory.createEqual(
                  stmt.getTargetExpression(),
                  targetValue)
              );
          // set next label to jump target
          nextLabel = new Location(new AbsoluteAddress(targetValue));
        }
      }
      assumption = assumption.evaluate(new Context());
      RTLAssume assume = new RTLAssume(assumption, stmt);
      assume.setLabel(stmt.getLabel());
View Full Code Here

            for (Iterator<AbsoluteAddress> it = Program.getProgram().codeAddressIterator(); it.hasNext();) {
              targetValue = it.next().toNumericConstant();
              assumption = ExpressionFactory.createEqual(stmt.getTargetExpression(), targetValue);
              // set next label to jump target
              nextLabel = new Location(new AbsoluteAddress(targetValue));
              RTLAssume assume = new RTLAssume(assumption, stmt);
              assume.setLabel(stmt.getLabel());
              assume.setNextLabel(nextLabel);
              results.add(new CFAEdge(assume.getLabel(), assume.getNextLabel(), assume));
            }

            continue;
          }
        } else {
          // assume (condition = true AND targetExpression = targetValue)
          assumption = ExpressionFactory.createAnd(
              assumption,
              ExpressionFactory.createEqual(
                  stmt.getTargetExpression(),
                  targetValue)
              );
          // set next label to jump target
          nextLabel = new Location(new AbsoluteAddress(targetValue));
        }
      }
      assumption = assumption.evaluate(new Context());
      RTLAssume assume = new RTLAssume(assumption, stmt);
      assume.setLabel(stmt.getLabel());
View Full Code Here

TOP

Related Classes of org.jakstab.asm.AbsoluteAddress

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.