Examples of decodeInstruction()


Examples of org.jakstab.disasm.x86.X86Disassembler.decodeInstruction()

    pltSize = pltSection.sh_size;
    logger.debug("Reading PLT from " + getVirtualAddress(pltIdx));

    X86Disassembler disasm = new X86Disassembler(inBuf);
    // push GOT + 4
    Instruction instr = disasm.decodeInstruction(pltIdx);
    assert instr.getName().equals("pushl");
    pltIdx += instr.getSize();
    // jmp *(GOT + 8)
    instr = disasm.decodeInstruction(pltIdx);
    assert instr instanceof X86JmpInstruction;
View Full Code Here

Examples of org.jakstab.disasm.x86.X86Disassembler.decodeInstruction()

    // push GOT + 4
    Instruction instr = disasm.decodeInstruction(pltIdx);
    assert instr.getName().equals("pushl");
    pltIdx += instr.getSize();
    // jmp *(GOT + 8)
    instr = disasm.decodeInstruction(pltIdx);
    assert instr instanceof X86JmpInstruction;
    pltIdx += instr.getSize();

    while (true) {
      if (data[pltIdx] == 0) {
View Full Code Here

Examples of org.jakstab.disasm.x86.X86Disassembler.decodeInstruction()

    while (true) {
      if (data[pltIdx] == 0) {
        pltIdx++;
      } else {
        instr = disasm.decodeInstruction(pltIdx);
        pltIdx += instr.getSize();
        if (!instr.getName().equals("nop")) break;
      }
    }
    // now we should be at the first PLT jump
View Full Code Here

Examples of org.jakstab.disasm.x86.X86Disassembler.decodeInstruction()

      inBuf.seek(getFilePointer(pltSlot));
      AbsoluteAddress trampolineDest = new AbsoluteAddress(inBuf.readDWORD());
      //logger.debug("Trampoline destination is " + trampolineDest);
      pltIdx = (int)getFilePointer(trampolineDest);
      // Read the push instruction
      instr = disasm.decodeInstruction(pltIdx);
      X86Instruction pushSTOff = (X86Instruction)instr;
      // The push instruction's parameter is an index into the symbol table
      int symbolTableOff = ((Immediate)pushSTOff.getOperand1()).getNumber().intValue();
      // Read function name from symbol table
      //String functionName = elf.getSymbols()[symbolTableOff].toString();
View Full Code Here

Examples of org.jakstab.disasm.x86.X86Disassembler.decodeInstruction()

      imports.add(importSymbol);
      symbolMap.put(jmpLocation, functionName);
      symbolMap.put(pltSlot, "__imp_" + functionName);
      // Now skip the following jump to PLT0 (a call to the dynamic loader)
      pltIdx += instr.getSize();
      instr = disasm.decodeInstruction(pltIdx);
      assert instr instanceof X86JmpInstruction : "Expected jmp to PLT[0] in PLT at this offset!";
      pltIdx += instr.getSize();
      // And now pltIdx points to the next PLT entry

      // Check if there are more plt entries.
View Full Code Here

Examples of org.jakstab.disasm.x86.X86Disassembler.decodeInstruction()

      // Check if there are more plt entries.
      if (data[pltIdx] == 0) {
        break;
      }
      instr = disasm.decodeInstruction(pltIdx);
      if (!(instr instanceof X86JmpInstruction)) {
        break;
      }
    }
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.