Skip to content

Problem Code Method Getprotectiondomain

Featured Replies

helpme code in java base l2f

 

import l2f.gameserver.utils.VgConfig;
import l2f.commons.util.Base64;
import l2f.commons.crypt.NewCrypt;
import java.io.*;
import java.net.URL;
import java.net.URLConnection;
import java.security.CodeSource;
import java.security.ProtectionDomain;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

 

 

public Class forName(String className)
    {
        String classFile;
        ZipFile z;
        Enumeration list;
        if(VgConfig.NPROTECT_KEY == -1)
            throw new Exception();
        classFile = className.replace(".", "/");
        z = new ZipFile(VLoaderKey.getProtectionDomain().getCodeSource().getLocation().toURI());
        list = z.entries();
        byte data[];
        ZipEntry ze;
        do
        {
            if(!list.hasMoreElements())
            ze = (ZipEntry)list.nextElement();
        } while(!ze.getName().startsWith(classFile));
        InputStream is = z.getInputStream(ze);
        data = new byte[(int)ze.getSize()];
        is.read(data);
        is.close();
        if(data[0] != -54 || data[1] != -2)
        {
            NewCrypt nc = new NewCrypt(String.format("%X", new Object[] {
                Integer.valueOf(VgConfig.NPROTECT_KEY)
            }));
            data = nc.decrypt(data);
        }
        try
        {
            Class result = defineClass(className, data, 0, data.length);
            z.close();
            return result;
        }
        catch(ClassFormatError e)
        {
            System.out.println(" - Fxn 64 Protect: Unable to load protection components");
        }
        z.close();
        System.exit(0);
        return null;
        throw new Exception();
        Exception e;
        
        System.out.println("WARNING: Unable to load protection components");
        System.exit(0);
        return null;
    }

 

 

erro compile

 

compile:
    [javac] \java\l2f\gameserver\utils\VLoaderKey.java:91: error: cannot find symbol
    [javac]         z = new ZipFile(VLoaderKey.getProtectionDomain().getCodeSource().getLocation().toURI());
    [javac]                                   ^
    [javac]   symbol:   method getProtectionDomain()
    [javac]   location: class VLoaderKey

 

    [javac] \java\l2f\gameserver\utils\VLoaderRev.java:112: error: cannot find symbol
    [javac]             Class result = defineClass(className, data, 0, data.length);
    [javac]                            ^
    [javac]   symbol:   method defineClass(String,byte[],int,int)
    [javac]   location: class VLoaderRev

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.