Package diStorm3

Examples of diStorm3.Opcodes


    byte[] buf = new byte[4];
    buf[0] = (byte)0xc3;
    buf[1] = (byte)0x33;
    buf[2] = (byte)0xc0;
    buf[3] = (byte)0xc3;
    CodeInfo ci = new CodeInfo((long)0x1000, buf, DecodeType.Decode32Bits, 0);
    DecodedResult dr = new DecodedResult(10);
    distorm3.Decode(ci, dr);

    for (DecodedInst x : dr.mInstructions) {
      String s = String.format("%x %s %s", x.getOffset(), x.getMnemonic(), x.getOperands());
View Full Code Here


    DecomposedResult dr2 = new DecomposedResult(10);
    distorm3.Decompose(ci, dr2);

    for (DecomposedInst y: dr2.mInstructions) {
      if (y.getOpcode() != OpcodeEnum.RET) {
        DecodedInst x = distorm3.Format(ci, y);
        String s = String.format("%x %s %s", x.getOffset(), x.getMnemonic(), x.getOperands());
        System.out.println(s);
      }
    }

  }
View Full Code Here

    buf[0] = (byte)0xc3;
    buf[1] = (byte)0x33;
    buf[2] = (byte)0xc0;
    buf[3] = (byte)0xc3;
    CodeInfo ci = new CodeInfo((long)0x1000, buf, DecodeType.Decode32Bits, 0);
    DecodedResult dr = new DecodedResult(10);
    distorm3.Decode(ci, dr);

    for (DecodedInst x : dr.mInstructions) {
      String s = String.format("%x %s %s", x.getOffset(), x.getMnemonic(), x.getOperands());
      System.out.println(s);
View Full Code Here

    for (DecodedInst x : dr.mInstructions) {
      String s = String.format("%x %s %s", x.getOffset(), x.getMnemonic(), x.getOperands());
      System.out.println(s);
    }

    DecomposedResult dr2 = new DecomposedResult(10);
    distorm3.Decompose(ci, dr2);

    for (DecomposedInst y: dr2.mInstructions) {
      if (y.getOpcode() != OpcodeEnum.RET) {
        DecodedInst x = distorm3.Format(ci, y);
View Full Code Here

                                methodBuilder.getMethodImplementation())));

        MemoryDataStore dexStore = new MemoryDataStore();
        dexBuilder.writeTo(dexStore);

        DexBackedDexFile dexFile = new DexBackedDexFile(new Opcodes(15), dexStore.getData());

        ClassDef classDef = Iterables.getFirst(dexFile.getClasses(), null);
        Assert.assertNotNull(classDef);

        Method method = Iterables.getFirst(classDef.getMethods(), null);
View Full Code Here

                                methodImpl)));

        MemoryDataStore dexStore = new MemoryDataStore();
        dexBuilder.writeTo(dexStore);

        DexBackedDexFile dexFile = new DexBackedDexFile(new Opcodes(15), dexStore.getData());

        ClassDef classDef = Iterables.getFirst(dexFile.getClasses(), null);
        Assert.assertNotNull(classDef);

        Method method = Iterables.getFirst(classDef.getMethods(), null);
View Full Code Here

                int consoleWidth = ConsoleUtil.getConsoleWidth();
                if (consoleWidth <= 0) {
                    consoleWidth = 120;
                }

                RawDexFile rawDexFile = new RawDexFile(new Opcodes(apiLevel), dexFile);
                DexAnnotator annotator = new DexAnnotator(rawDexFile, consoleWidth);
                annotator.writeAnnotations(writer);
            } catch (IOException ex) {
                System.err.println("There was an error while dumping the dex file to " + dumpFileName);
                ex.printStackTrace(System.err);
View Full Code Here

            DexPool.writeTo(dataStore, new ImmutableDexFile(ImmutableSet.of(classDef)));
        } catch (IOException ex) {
            throw new RuntimeException(ex);
        }

        DexBackedDexFile dexFile = new DexBackedDexFile(new Opcodes(15), dataStore.getData());
        ClassDef dbClassDef = Iterables.getFirst(dexFile.getClasses(), null);
        Assert.assertNotNull(dbClassDef);
        Annotation dbAnnotation = Iterables.getFirst(dbClassDef.getAnnotations(), null);
        Assert.assertNotNull(dbAnnotation);
        List<AnnotationElement> dbElements = Lists.newArrayList(dbAnnotation.getElements());
View Full Code Here

        MemoryDataStore dataStore = new MemoryDataStore();

        dexBuilder.writeTo(dataStore);

        DexBackedDexFile dexFile = new DexBackedDexFile(new Opcodes(15), dataStore.getData());

        return Iterables.getFirst(dexFile.getClasses(), null);
    }
View Full Code Here

TOP

Related Classes of diStorm3.Opcodes

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.