Package org.rsbot.loader.asm

Examples of org.rsbot.loader.asm.ClassReader


      for (final Map.Entry<String, byte[]> entry : classes.entrySet()) {
        entry.setValue(script.process(entry.getKey(), entry.getValue()));
      }

      final ClassReader reader = new ClassReader(new ByteArrayInputStream(classes.get("client")));
      final VersionVisitor vv = new VersionVisitor();
      reader.accept(vv, ClassReader.SKIP_FRAMES);
      version[1] = vv.getVersion();

      final ZipOutputStream zip = new ZipOutputStream(new FileOutputStream(cache));
      zip.setMethod(ZipOutputStream.STORED);
      zip.setLevel(0);
View Full Code Here


  }

  public byte[] process(final String key, final byte[] data) {
    final ClassAdapter adapter = adapters.get(key);
    if (adapter != null) {
      final ClassReader reader = new ClassReader(data);
      reader.accept(adapter, ClassReader.SKIP_FRAMES);
      return writers.get(key).toByteArray();
    }
    return data;
  }
View Full Code Here

  }

  public byte[] process(final String key, final InputStream is) throws IOException {
    final ClassAdapter adapter = adapters.get(key);
    if (adapter != null) {
      final ClassReader reader = new ClassReader(is);
      reader.accept(adapter, ClassReader.SKIP_FRAMES);
      return writers.get(key).toByteArray();
    }
    final ByteArrayOutputStream os = new ByteArrayOutputStream();
    final byte[] buffer = new byte[4096];
    int n;
View Full Code Here

    if (clazz == null) {
      try {
        final InputStream in = getResourceAsStream(name.replace('.', '/') + ".class");
        byte[] bytes = IOHelper.read(in);

        final ClassReader reader = new ClassReader(bytes);
        final ClassWriter writer = new ClassWriter(0);
        reader.accept(new RemappingClassAdapter(writer, ScriptMapper.getInstance()), ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES);
        bytes = writer.toByteArray();

        clazz = defineClass(name, bytes, 0, bytes.length, domain);
        if (resolve) {
          resolveClass(clazz);
View Full Code Here

TOP

Related Classes of org.rsbot.loader.asm.ClassReader

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.