Package org.jakstab.ssl

Examples of org.jakstab.ssl.Architecture


      }
     
      @Override
      public Set<AbstractState> visit(RTLAssume stmt) {

        Architecture arch = Program.getProgram().getArchitecture();
        /////////
        // Special case for non-exit edges of x86 REP/REPNZ prefixes (for loops using ecx)
        if (stmt.getSource().getType() == RTLGoto.Type.STRING_LENGTH_CHECK) {
          BasedNumberElement loopCounter = getValue(arch.loopCounter());
          if (loopCounter.isTop() || loopCounter.isNumberTop()) {
            X86Instruction instr = (X86Instruction)Program.getProgram().getInstruction(stmt.getAddress());
            BasedNumberValuation post = copyThisState();
            if (instr.hasEsiBasedMemorySource()) {
              logger.debug(stmt.getLabel() + ": ecx is unknown in REP/REPNZ, widening esi");
              post.setValue(arch.stringSource(), new BasedNumberElement(
                  getValue(arch.stringSource()).getRegion(),
                  NumberElement.getTop(arch.getAddressBitWidth())));
            }
            if (instr.hasEdiBasedMemoryTarget()) {
              logger.debug(stmt.getLabel() + ": ecx is unknown in REP/REPNZ, widening edi");
              post.setValue(arch.stringTarget(), new BasedNumberElement(
                  getValue(arch.stringTarget()).getRegion(),
                  NumberElement.getTop(arch.getAddressBitWidth())));
            }
            // STRING_LENGTH_CHECK assumptions are ecx == 0 or !(ecx == 0)
            RTLOperation operation = (RTLOperation)stmt.getAssumption();
            if (operation.getOperator() == Operator.EQUAL) {
              assert operation.getOperands()[0] == arch.loopCounter();
              assert ((RTLNumber)operation.getOperands()[1]).longValue() == 0;
              post.setValue(arch.loopCounter(), abstractEval(operation.getOperands()[1]));
            }
           
            return Collections.singleton((AbstractState)post);
          }
        }
View Full Code Here


    logger.error(Characters.DOUBLE_LINE_FULL_WIDTH);

    /////////////////////////
    // Parse SSL file

    Architecture arch;
    try {
      arch = new Architecture(Options.sslFilename.getValue());
    } catch (IOException e) {
      logger.fatal("Unable to open SSL file!", e);
      return;
    } catch (ANTLRException e)  {
      logger.fatal("Error parsing SSL file!", e);
View Full Code Here

  private static Location l4;

 
  @Before
  public void setUp() throws Exception {
    Program.createProgram(new Architecture("ssl/pentium.ssl"));

    l1 = new Location(new AbsoluteAddress(0x12345678));
    l2 = new Location(new AbsoluteAddress(0xFF241111));
    l3 = new Location(new AbsoluteAddress(0xEE345678));
    l4 = new Location(new AbsoluteAddress(0xDD345678));
View Full Code Here

  /**
   * @throws java.lang.Exception
   */
  @Before
  public void setUp() throws Exception {
    arch = new Architecture("ssl/pentium.ssl");
  }
View Full Code Here

TOP

Related Classes of org.jakstab.ssl.Architecture

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.