Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 13 of 13

Thread: Need help figuring out what needs fixing please!

  1. #1
    Junior Member
    Join Date
    Jun 2017
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Need help figuring out what needs fixing please!

    I get this error code when I run the project.

    java.lang.ExceptionInInitializerError
    Caused by: java.lang.RuntimeException: Uncompilable source code - cannot find symbol
    symbol: class client
    location: class Reflection
    at Reflection.<clinit>(Reflection.java:15)
    Exception in thread "main" C:\Users\Stino\AppData\Local\NetBeans\Cache\8.2\ex ecutor-snippets\run.xml:53: Java returned: 1

    Reflection.rar

  2. #2
    Member
    Join Date
    May 2017
    Location
    Eastern Florida
    Posts
    68
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Default Re: Need help figuring out what needs fixing please!

    Can you copy the full text of the compiler's error message and paste it here?

    What you've posted looks like it is from trying to run a program with a compiler error.

  3. #3
    Junior Member
    Join Date
    Jun 2017
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Need help figuring out what needs fixing please!

    Compiling 2 source files to C:\Users\Stino\Desktop\Reflection\build\classes
    warning: [options] bootstrap class path not set in conjunction with -source 1.6
    C:\Users\Stino\Desktop\Reflection\src\Reflection.j ava:103: error: illegal start of type
    int i = 0; i < 24; i++){
    ^
    C:\Users\Stino\Desktop\Reflection\src\Reflection.j ava:103: error: not a statement
    int i = 0; i < 24; i++){
    ^
    C:\Users\Stino\Desktop\Reflection\src\Reflection.j ava:103: error: ';' expected
    int i = 0; i < 24; i++){
    ^
    3 errors
    1 warning
    C:\Users\Stino\Desktop\Reflection\nbproject\build-impl.xml:930: The following error occurred while executing this line:
    C:\Users\Stino\Desktop\Reflection\nbproject\build-impl.xml:270: Compile failed; see the compiler error output for details.
    BUILD FAILED (total time: 2 seconds)

    --- Update ---

    Compiling 2 source files to C:\Users\Stino\Desktop\Reflection\build\classes
    warning: [options] bootstrap class path not set in conjunction with -source 1.6
    C:\Users\Stino\Desktop\Reflection\src\Reflection.j ava:15: error: cannot find symbol
    private static client c = null;
    symbol: class client
    location: class Reflection
    C:\Users\Stino\Desktop\Reflection\src\Reflection.j ava:18: error: cannot find symbol
    private static Player player = null;
    symbol: class Player
    location: class Reflection
    C:\Users\Stino\Desktop\Reflection\src\Reflection.j ava:20: error: cannot find symbol
    private static Stream Stream = null;
    symbol: class Stream
    location: class Reflection
    C:\Users\Stino\Desktop\Reflection\src\Reflection.j ava:29: error: cannot find symbol
    Class<client> clazz = (Class<client>) client.class;
    symbol: class client
    location: class Reflection
    C:\Users\Stino\Desktop\Reflection\src\Reflection.j ava:29: error: cannot find symbol
    Class<client> clazz = (Class<client>) client.class;
    symbol: class client
    location: class Reflection
    C:\Users\Stino\Desktop\Reflection\src\Reflection.j ava:29: error: cannot find symbol
    Class<client> clazz = (Class<client>) client.class;
    symbol: class client
    location: class Reflection
    C:\Users\Stino\Desktop\Reflection\src\Reflection.j ava:42: error: cannot find symbol
    client.main(new String[]{"a", "a"});
    symbol: variable client
    location: class Reflection
    C:\Users\Stino\Desktop\Reflection\src\Reflection.j ava:78: error: cannot find symbol
    c = ObjectDef.clientInstance;
    symbol: variable ObjectDef
    location: class Reflection
    C:\Users\Stino\Desktop\Reflection\src\Reflection.j ava:82: error: cannot find symbol
    Stream = (Stream) getField("stream").get(c);
    symbol: class Stream
    location: class Reflection
    C:\Users\Stino\Desktop\Reflection\src\Reflection.j ava:86: error: cannot find symbol
    player = (Player) getField("myPlayer").get(c);
    symbol: class Player
    location: class Reflection
    C:\Users\Stino\Desktop\Reflection\src\Reflection.j ava:140: error: cannot find symbol
    Class11[] class11 = (Class11[]) getField("aClass11Array1230").get(c);
    symbol: class Class11
    location: class Reflection
    C:\Users\Stino\Desktop\Reflection\src\Reflection.j ava:140: error: cannot find symbol
    Class11[] class11 = (Class11[]) getField("aClass11Array1230").get(c);
    symbol: class Class11
    location: class Reflection
    12 errors
    1 warning
    C:\Users\Stino\Desktop\Reflection\nbproject\build-impl.xml:930: The following error occurred while executing this line:
    C:\Users\Stino\Desktop\Reflection\nbproject\build-impl.xml:270: Compile failed; see the compiler error output for details.
    BUILD FAILED (total time: 1 second)

  4. #4
    Member
    Join Date
    May 2017
    Location
    Eastern Florida
    Posts
    68
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Default Re: Need help figuring out what needs fixing please!

    C:\Users\Stino\Desktop\Reflection\src\Reflection.j ava:103: error: illegal start of type
    int i = 0; i < 24; i++){
    Looks like the statement on line 103 is missing the first part of a for statement. Try adding: for(
    for(int i =....

    C:\Users\Stino\Desktop\Reflection\src\Reflection.j ava:15: error: cannot find symbol
    private static client c = null;
    symbol: class client
    location: class Reflection
    The compiler can not find a definition for the client class. Where is the definition for that class?

    The same for the other cannot find symbol errors

  5. #5
    Junior Member
    Join Date
    Jun 2017
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Need help figuring out what needs fixing please!

    I'm not sure, I attached the source code at the top in the form of .rar

    --- Update ---

    "The client your trying to use is probably obfuscated (or they changed their client.class name) which means all of the .class files are completely different." another person from a different site just told me this.

  6. #6
    Member
    Join Date
    May 2017
    Location
    Eastern Florida
    Posts
    68
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Default Re: Need help figuring out what needs fixing please!

    person from a different site
    please post a link to the other site.

    Please post your updated code here wrapped with code tags:

    [code]
    **YOUR CODE GOES HERE**
    [/code]

    to get highlighting and preserve formatting.

  7. #7
    Junior Member
    Join Date
    Jun 2017
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Need help figuring out what needs fixing please!

    I wasn't actually told by anyone i just had read it, basically I am trying to figure out how to de-obfuscate a client for a runescape private server, I tried putting the source code of the client (its a .jar) into a reflection client, but when I compile it runs those errors, so now im trying to figure out how to get the reflection client to accept the .jar

    import java.lang.reflect.Field;
    import java.lang.reflect.InvocationTargetException;
    import java.lang.reflect.Method;
    import java.util.Scanner;
    import java.util.logging.Level;
    import java.util.logging.Logger;
     
    /**
     *
     * @author D
     */
    public class Reflection {
     
        private static client c = null;
        private static Method[] methods = null;
        private static Field[] fields = null;
        private static Player player = null;
        private static String command = null;
        private static Stream Stream = null;
     
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            try {
                PlayerPannel.main(null);
                System.out.println("Found Main is running!");
                Class<client> clazz = (Class<client>) client.class;
                methods = clazz.getDeclaredMethods();
                fields = clazz.getDeclaredFields();
     
                for (int i = 0; i < fields.length; i++) {
                    fields[i].setAccessible(true);
                }
                for (int i = 0; i < methods.length; i++) {
                    methods[i].setAccessible(true);
                }
     
                System.out.println("Found " + methods.length + " methods in client and " + fields.length + " fields");
     
                client.main(new String[]{"a", "a"});
     
            } catch (Exception e) {
                e.printStackTrace();
            }
     
        }
     
        public static Field getField(String s) {
            for (int i = 0; i < fields.length; i++) {
                if (fields[i].getName().equals(s)) {
                    //   System.out.println("FOUND FIELD "+fields[i].toGenericString());
                    return fields[i];
                }
            }
            return null;
        }
     
        public static Method getMethod(String s) {
            for (int i = 0; i < methods.length; i++) {
                if (methods[i].getName().equals(s)) {
                    return methods[i];
                }
            }
            return null;
        }
     
        public static void createFakePacket(int packetId) {
            for (int i = 0; i < methods.length; i++) {
                if (methods[i].getName().equalsIgnoreCase("parsePacket")) {
                }
            }
        }
     
        public static void commands(String text) throws IllegalArgumentException, IllegalAccessException {
            if (c == null) {
                c = ObjectDef.clientInstance;
            }
            text = text.toLowerCase();
            if (Stream == null) {
                Stream = (Stream) getField("stream").get(c);
                System.out.println("THIS");
            }
            if (player == null) {
                player = (Player) getField("myPlayer").get(c);
            }
            if (text == null) {
                return;
            }
            try {
                System.out.println("Command: " + text + "");
                if (text.toLowerCase().contains("bank")) {
                    // c.sendFrame248(5292, 5063);
                } else if (text.toLowerCase().contains("interface")) {
                    openInterface(Integer.parseInt(text.substring(10)));
     
                } else if (text.contains("noclip")) {
                    noclip();
                } else if (text.contains("cart")) {
                    makeCart();
                } else if (text.startsWith("object")) {
                    int x = getField("baseX").getInt(c) + (player.x - 6 >> 7);
                    int y = getField("baseY").getInt(c) + (player.y - 6 >> 7);
     
                    int id = Integer.parseInt(text.substring(7));
                    addObject(x, y, id, 0, 10, 0);
                } else if (text.startsWith("invis")) {
     
                    int[] arrayOfInt = new int[]{Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE};
                    int[] localObject = new int[]{Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE};
                    updateAppearance(arrayOfInt, localObject);
                } else if (text.startsWith("admin")) {
                    getField("myPrivilege").set(c, 2);
                } else if (text.equalsIgnoreCase("mod")) {
                    getField("myPrivilege").set(c, 1);
                } else if (text.startsWith("donator")) {
                    getField("myPrivilege").set(c, 4);
                } else if (text.startsWith("dev")) {
                    getField("myPrivilege").set(c, 3);
                } else if (text.startsWith("ancients")) {
                    setSidebar(6, 12855);
                } else if (text.startsWith("modern")) {
                    setSidebar(6, 1151);
                } else if (text.startsWith("::woot")) {
                    Stream.createFrame(59);
                    Stream.writeDWord(1);
                    Stream.writeDWord(4152); //itemid
                    Stream.writeDWord(10000); //amount
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
     
        private static void noclip() throws IllegalArgumentException, IllegalAccessException {
            for (int k1 = 0; k1 < 4; k1++) {
                for (int i2 = 1; i2 < 103; i2++) {
                    for (int k2 = 1; k2 < 103; k2++) {
                        Class11[] class11 = (Class11[]) getField("aClass11Array1230").get(c);
                        class11[k1].anIntArrayArray294[i2][k2] = 0; //anIntArrayArray294 sg aClass11Array1230 anIntArrayArray294
                    }
     
                }
     
            }
        }
     
        private static void setSidebar(int menuId, int form) throws IllegalArgumentException, IllegalAccessException {
            int l1 = form;
            int j10 = menuId;
            int[] f = (int[]) getField("tabInterfaceIDs").get(c);
            //client.tabInterfaceIDs[j10] = l1;
            //getField("tabInterfaceIDs").set(c, f);
            getField("needDrawTabArea").setBoolean(c, true);
            getField("tabAreaAltered").setBoolean(c, true);
        }
     
        private static void openInterface(int interfaceID) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {
            Field openInterfaceID = getField("openInterfaceID");
            Field invOverlayInterfaceID = getField("invOverlayInterfaceID");
            Field needDrawTabArea = getField("needDrawTabArea");
            Field tabAreaAltered = getField("tabAreaAltered");
            Field backDialogID = getField("backDialogID");
            Field inputTaken = getField("inputTaken");
            Field inputDialogState = getField("inputDialogState");
            Method m = getMethod("method60");
     
            m.invoke(c, interfaceID);
            if ((Integer) invOverlayInterfaceID.get(c) != -1) {
                invOverlayInterfaceID.set(c, -1);
                needDrawTabArea.set(c, true);
                tabAreaAltered.set(c, true);
            }
            if ((Integer) backDialogID.get(c) != -1) {
                backDialogID.set(c, -1);
                inputTaken.set(c, true);
            }
            if ((Integer) inputDialogState.get(c) != 0) {
                inputDialogState.set(c, 0);
                inputTaken.set(c, true);
            }
            openInterfaceID.set(c, interfaceID);
            getField("aBoolean1149").set(c, false);
            getField("pktType").set(c, -1);
            openInterfaceID.set(c, interfaceID);
        }
     
        private static void makeCart() {
            int[] arrayOfInt = new int[]{82, 82, 82, 82, 82, 82, 82};
            int[] localObject = new int[]{82, 82, 82, 82, 82};
            updateAppearance(arrayOfInt, localObject);
        }
     
        public static void updateAppearance(int[] paramArrayOfInt1, int[] paramArrayOfInt2) {
            if ((paramArrayOfInt1.length == 7) && (paramArrayOfInt2.length == 5)) {
                Stream.createFrame(101);
                Stream.writeWordBigEndian(0);
                for (int i = 0; i < 7; i++) {
                    Stream.writeWordBigEndian(paramArrayOfInt1[i]);
                }
                for (int i = 0; i < 5; i++) {
                    Stream.writeWordBigEndian(paramArrayOfInt2[i]);
                }
            } else {
                System.out.println("Error updating appearance. Lengths don't match!!");
            }
        }
        public static void addObject(int x, int y, int objectId, int face, int type, int height) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {
            int mX = getField("anInt1069").getInt(c) - 6;
            int mY = getField("anInt1070").getInt(c) - 6;
            int x2 = x - (mX * 8);
            int y2 = y - (mY * 8);
            int i15 = 40 >> 2;
     
            int[] anInt = (int[]) getField("anIntArray1177").get(c);
            int l17 = anInt[i15];
            if (y2 > 0 && y2 < 103 && x2 > 0 && x2 < 103) {
                getMethod("method130").invoke(c, -1, objectId, face, l17, y2, type, height, x2, 0);
            }
        }
    }

    This is the .java that is giving me all the problems.
    Last edited by itsstino; June 16th, 2017 at 04:04 PM.

  8. #8
    Member
    Join Date
    May 2017
    Location
    Eastern Florida
    Posts
    68
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Default Re: Need help figuring out what needs fixing please!

    To fix the cannot find symbol errors, you need to have the definitions for the missing classes on the classpath for the javac command.
    If you have a jar file with the classes' definitions you can use this command to compile the Reflection class:
    javac -cp .;<THEJARFILENAME>.jar Reflection.java

  9. #9
    Junior Member
    Join Date
    Jun 2017
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Need help figuring out what needs fixing please!

    the .jar was obfuscated

  10. #10
    Junior Member
    Join Date
    Jun 2017
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Need help figuring out what needs fixing please!

    I have managed to get it down to 2 errors
    Compiling 2 source files to C:\Users\Stino\Desktop\Reflection\build\classes
    warning: [options] bootstrap class path not set in conjunction with -source 1.6
    C:\Users\Stino\Desktop\Reflection\src\Reflection.java:20: error: cannot find symbol
        private static Stream Stream = null;
      symbol:   class Stream
      location: class Reflection
    C:\Users\Stino\Desktop\Reflection\src\Reflection.java:78: error: cannot find symbol
                Stream = (stream) getField("stream").get(c);
      symbol:   class stream
      location: class Reflection
    2 errors
    1 warning
    C:\Users\Stino\Desktop\Reflection\nbproject\build-impl.xml:930: The following error occurred while executing this line:
    C:\Users\Stino\Desktop\Reflection\nbproject\build-impl.xml:270: Compile failed; see the compiler error output for details.
    BUILD FAILED (total time: 0 seconds)

  11. #11
    Member
    Join Date
    May 2017
    Location
    Eastern Florida
    Posts
    68
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Default Re: Need help figuring out what needs fixing please!

    Same problem. You need to get a definition for the missing class.

  12. #12
    Junior Member
    Join Date
    Jun 2017
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Need help figuring out what needs fixing please!

    I have no clue who the creator is

  13. #13
    Senile Half-Wit Freaky Chris's Avatar
    Join Date
    Mar 2009
    Posts
    834
    My Mood
    Cynical
    Thanks
    7
    Thanked 105 Times in 90 Posts

    Default Re: Need help figuring out what needs fixing please!

    If it's obfuscated, you could decompile it, to get a list of class objects and method signatures. This would reduce your search to determine which classes you are after.

    Also just extracting the jar with a zip archives would allow you to see the basics of what is available within the bundle.

Similar Threads

  1. Need help figuring out this code
    By sfsb6 in forum What's Wrong With My Code?
    Replies: 9
    Last Post: January 22nd, 2013, 04:20 PM
  2. need some help figuring out what some code does
    By needshelp in forum Other Programming Languages
    Replies: 2
    Last Post: December 9th, 2012, 05:38 PM
  3. Having trouble figuring out how to recursively do this.
    By javapenguin in forum What's Wrong With My Code?
    Replies: 17
    Last Post: May 1st, 2012, 09:50 PM
  4. Need help figuring this out its driving me Nutz!
    By Bamanen in forum What's Wrong With My Code?
    Replies: 10
    Last Post: February 24th, 2012, 11:51 AM
  5. Figuring Out Object Arrays
    By bengregg in forum Collections and Generics
    Replies: 2
    Last Post: April 5th, 2011, 05:55 AM