Page 3 of 3 FirstFirst 123
Results 51 to 73 of 73

Thread: A Basic Updater Primer

  1. #51
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by evilid View Post
    Can someone help me with the viewport height and width hook.

    I'm now searching for:
    getstatic client.or:int
    ldc 711889975 (java.lang.Integer)
    imul
    iconst_2
    idiv

    But in rev 119 for example it will give the viewportwidth, but in 125, 126 etc. it gives the viewportheight.

    So there's two patterns (ONE if your deob is good -- I will assume worst case for this example) to identify the ViewPort-Width and ViewPort-Height.

    The first is:

    IMUL, ILOAD_X, IMUL, ILOAD_1, IDIV
    followed by:
    GETSTATIC, LDC, IMUL, ICONST_2, IDIV.


    ---

    The second is:

    GETSTATIC, LDC, IMUL, ICONST_2, IDIV, IMUL, GETSTATIC, LDC
    followed by:
    IMUL, ILOAD_X, IMUL, ILOAD_1, IDIV.


    The are pretty much the exact same pattern (it just matters whether or not you normalize all multipliers to be on the right or left side of the variable).



    ---


    In both cases the following are common:

    IMUL, ILOAD_X, IMUL, ILOAD_1, IDIV
    and
    GETSTATIC, LDC, IMUL, ICONST_2, IDIV.


    To determine which is the "Width", the "ILOAD_X" will be "ILOAD_0" and for the "Height" it will be "ILOAD_4".


    Example:

    Java Code:
    if(var1 >= 50) {
        client.gq = 1603721491 * (client.oe * 1778564539 * var0 / var1 + client.op * 1026734741 / 2); //Width has "var0" / "var1".
        client.gc = -512248033 * (client.or * 711889975 / 2 + client.oe * 1778564539 * var9 / var1);  //Height has "var9" / "var1".
    }


    //Another revision:
    if(var1 >= 50) {
        client.gt = (client.ol * -504930707 / 2 + client.oz * -483184759 * var0 / var1) * 1568639237;  //Again "var0" / "var1".
        client.ga = (client.ou * 695601873 / 2 + client.oz * -483184759 * var9 / var1) * 1892081559;   //Again "var9" / "var1".
    }





    Both are found in a method with the signature: "(III)V" with accessors STATIC and FINAL.



    Now put it together:

    Java Code:
    //Usage

    findField(nodes, "ViewPort-Width", 0);
    findField(nodes, "ViewPort-Height", 4);


    //----

    private ClassField findField(Collection<ClassNode> nodes, String fieldName, int identifierValue) {

        final int[] pattern = new int[]{Opcodes.GETSTATIC, Opcodes.LDC, Opcodes.IMUL, Opcodes.ICONST_2, Opcodes.IDIV};
        final int[] idPattern = new int[]{Opcodes.IMUL, Opcodes.ILOAD, Opcodes.IMUL, Opcodes.ILOAD, Opcodes.IDIV};

        for (ClassNode n : nodes) {
            for (MethodNode m : n.methods) {
                if (hasAccess(m, Opcodes.ACC_STATIC) && hasAccess(m, Opcodes.ACC_FINAL) && m.desc.equals("(III)V")) {
                    int i = new Finder(m).findPattern(pattern);
                    while (i != -1) {

                        int j = -1;

                        if (m.instructions.get(i - 1).getOpcode() == Opcodes.IDIV) {
                            j = new Finder(m).findPreviousPattern(i, idPattern);
                        }
                        else {
                            j = new Finder(m).findNextPattern(i, idPattern);
                        }


                        if (j != -1) {
                            if (((VarInsnNode)m.instructions.get(j + 1)).var == identifierValue || ((VarInsnNode)m.instructions.get(j + 3)).var == identifierValue) {
                                FieldInsnNode f = (FieldInsnNode)m.instructions.get(i);
                                long multi = (int) ((LdcInsnNode)m.instructions.get(i + 1)).cst;

                                if (f.owner.equals("client") && f.desc.equals("I")) {
                                    return new ClassField(fieldName, f.owner + "." + f.name, f.desc, multi);
                                }
                            }
                        }

                        i = new Finder(m).findPattern(pattern, i + 1);
                    }
                }
            }
        }
        return new ClassField("ViewPortWidth", "N/A");
    }
    Last edited by Brandon; 11-12-2016 at 04:46 AM.
    I am Ggzz..
    Hackintosher

  2. #52
    Join Date
    Nov 2016
    Posts
    31
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    Introduction


    Recently myself and @elfyyy; wrote updaters and I thought.. Why not release mine.. Then the idea that everyone would just copy it (instead of learning from it) hit us and so we decided a tutorial is in order.


    Everyone everywhere on the RS scene keeps saying that an updater is hard work. The answer is that it really isn't. An updater is more TIME-CONSUMING than hard work.

    So it's been more than a year since the OP and not one person other than you or Kyle has made a completed updater for reflection in OSRS. Why is it such an issue to just release the source for a reflection updater? Maybe a completed open-source updater for reflection can be shared with SRL and people can learn how to maintain the updater rather than attempting to write new ones. Most of the information needed for maintaining the updater would come from this thread.

  3. #53
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Quote Originally Posted by Nito View Post
    So it's been more than a year since the OP and not one person other than you or Kyle has made a completed updater for reflection in OSRS. Why is it such an issue to just release the source for a reflection updater? Maybe a completed open-source updater for reflection can be shared with SRL and people can learn how to maintain the updater rather than attempting to write new ones. Most of the information needed for maintaining the updater would come from this thread.
    There isn't an issue with releasing the source? if @Kyle; wanted to release it publicly, He would have done so. If you want a public open-source updater that everyone can use, maybe make an "unofficial SRL updater" yourself and post the source. Many of us just learn the concepts that OP posts and are content enough to leech Kyle's hooks.

  4. #54
    Join Date
    Nov 2016
    Posts
    31
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    I know there isn't any problems with releasing source code for an updater I make. No one else has had any success with making one of their own (or at least any evidence to suggest so). I really would like to use simba but it's impossible when there isn't any public updater for the unofficial reflection include that take a while for hooks to be updated.0 I know it's an unoffical include and not really supported "officially" but by now it has been around long enough and used long enough to make it essential since the SRL-OSR include doesn't really work. I would have to make an updater from the ground up just to get the client to work but when 2 of the higher ups in this community have these updaters yet don't want to release their source it's a bit disheartening to say the least especially when this post is so old and no one has had any success. This post has been around long enough to have people learn from it, so why not just release the source for the updater now that people have learned the basics of making an updater?
    Last edited by Nito; 11-12-2016 at 11:35 PM.

  5. #55
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Quote Originally Posted by Nito View Post
    I know there isn't any problems with releasing source code for an updater I make. No one else has had any success with making one of their own (or at least any evidence to suggest so). I really would like to use simba but it's impossible when there isn't any public updater for the unofficial reflection include that take a while for hooks to be updated.0 I know it's an unoffical include and not really supported "officially" but by now it has been around long enough and used long enough to make it essential since the SRL-OSR include doesn't really work. I would have to make an updater from the ground up just to get the client to work but when 2 of the higher ups in this community have these updaters yet don't want to release their source it's a bit disheartening to say the least especially when this post is so old and no one has had any success. This post has been around long enough to have people learn from it, so why not just release the source for the updater now that people have learned the basics of making an updater?
    Hooks are up pretty fast though? Anyhow, its unlikely the private updaters would get released. If they were to get released, its highly unlikely it'd be public, maybe SSRL+. You do realize that the hooks are one of the things that separates most of the other java bots out there? If i know Brandon, the aim of this thread is to learn not really to make an updater. This post doesn't really have an expiry date. There isn't a promise of an updater at x time. You could always try directly asking them.

  6. #56
    Join Date
    Nov 2016
    Posts
    31
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    There was an update 3 days ago and hooks aren't up. I'd say that's pretty slow and really the only thing needed to update hooks is to run the updater and have the deobb'd classes renamed. I saw another thread that has an open-source updater on another website so I'll try that for fixing the broken definitions in the reflection include if there are more like the incorrect WorldX/Y coordinate classes. I just don't see any reasons to keep it closed-source so I have to rely on offsite updaters for maintaining reflection hooks. Keeping it closed source makes it difficult for people who actually want to use the client.

    @Kyle @Brandon Could either of you release an updater for the unofficial lape reflection include (open-source or not)?

  7. #57
    Join Date
    Mar 2013
    Posts
    1,010
    Mentioned
    35 Post(s)
    Quoted
    620 Post(s)

    Default

    Quote Originally Posted by Nito View Post
    There was an update 3 days ago and hooks aren't up. I'd say that's pretty slow and really the only thing needed to update hooks is to run the updater and have the deobb'd classes renamed. I saw another thread that has an open-source updater on another website so I'll try that for fixing the broken definitions in the reflection include if there are more like the incorrect WorldX/Y coordinate classes. I just don't see any reasons to keep it closed-source so I have to rely on offsite updaters for maintaining reflection hooks. Keeping it closed source makes it difficult for people who actually want to use the client.

    @Kyle @Brandon Could either of you release an updater for the unofficial lape reflection include (open-source or not)?
    It was updated but the some hooks broke (the updater couldn't find them/the correct ones) requiring manual intervention to fix it which could take from a few minutes to a few hours... ye so you can't just "run the updater" things brake which take time and effort to fix.

    Edit: just took a quick look and you're right (swear I saw kyle post about updating a few days ago) but anyway releasing updaters open source never really achieves anything. Normally just a lot of leaching and either no one contributes anything to it or it just turns into spaghetti code so either way it horribly breaks.
    Last edited by Harrier; 11-13-2016 at 02:11 AM.
    #slack4admin2016
    <slacky> I will build a wall
    <slacky> I will ban reflection and OGL hooking until we know what the hell is going on

  8. #58
    Join Date
    Nov 2016
    Posts
    31
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    I'd take that alternative instead of what we have to deal with now where no one has an updater, updates take longer, and updates are frequently broken. Also no one can contribute anything related to the updater as is because there isn't one to work with.

  9. #59
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by Nito View Post
    I'd take that alternative instead of what we have to deal with now where no one has an updater, updates take longer, and updates are frequently broken. Also no one can contribute anything related to the updater as is because there isn't one to work with.

    I don't mind releasing an updater but then people will bitch when I don't maintain it. I don't have time to maintain it and barely anyone else will.. I've seen open source updaters before and they just die out easily. Also, I'd have to update my updater slightly to work with the latest client AND to have all the hooks OSRS requires (I'm probably missing very few but still..). I haven't updated it in over a year and it works very well but a few hooks are broken (maybe 3 or 4). If I get around to fixing it, perhaps I'll upload it but no promises.

    Again, I don't have time to maintain it and I'm fairly certain no one else will.. I only check this forum a few times a week to see if there's any new posts at the bottom of the page and if there aren't I don't even bother logging in.
    Last edited by Brandon; 11-13-2016 at 03:54 AM.
    I am Ggzz..
    Hackintosher

  10. #60
    Join Date
    Oct 2006
    Posts
    6,752
    Mentioned
    95 Post(s)
    Quoted
    532 Post(s)

    Default

    Huh? https://github.com/KyleHunter/OSR-Re...480dd5e0cebbca

    Am I missing something? If the was another update since then you guys have to understand I don't follow rs or villavu much anymore. But I do get pm's. So if you don't let me know there is an update, don't expect me to update hooks..
    “The long-lived and those who will die soonest lose the same thing. The present is all that they can give up, since that is all you have, and what you do not have, you cannot lose.” - Marcus Aurelius

  11. #61
    Join Date
    Nov 2016
    Posts
    31
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Idk how I double posted but I did

  12. #62
    Join Date
    Nov 2016
    Posts
    31
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by Kyle View Post
    Huh? https://github.com/KyleHunter/OSR-Re...480dd5e0cebbca

    Am I missing something? If the was another update since then you guys have to understand I don't follow rs or villavu much anymore. But I do get pm's. So if you don't let me know there is an update, don't expect me to update hooks..
    Actor_WorldX is incorrect and yes there was an update on the 8th. Xltb12 fixed it with these names instead:

    Quote Originally Posted by xltb12 View Post
    I noticed this yesterday and thought I would have a look at some opensource updaters today. I managed to find the problem within the actor (ap.class). Kyles updater parsed the values for X,Y incorrectly

    please update your hooks.simba accordingly.

    Code:
    Actor_WorldX: THook = ['al', 1658128947];
    Actor_WorldY: THook = ['av', 776925187];
    Thanks for the consideration on an open source updater for reflection. @Brandon
    Last edited by Nito; 11-13-2016 at 05:03 AM.

  13. #63
    Join Date
    Jun 2013
    Posts
    15
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    So there's two patterns (ONE if your deob is good -- I will assume worst case for this example) to identify the ViewPort-Width and ViewPort-Height.


    To determine which is the "Width", the "ILOAD_X" will be "ILOAD_0" and for the "Height" it will be "ILOAD_4".


    [/Highlight]
    Thanks, I didn't know you could check the value of the ILOAD. I just checked if the pattern contained a ILOAD, but they both have the same pattern. Thanks man!

  14. #64
    Join Date
    Oct 2006
    Posts
    6,752
    Mentioned
    95 Post(s)
    Quoted
    532 Post(s)

    Default

    Quote Originally Posted by Nito View Post
    Actor_WorldX is incorrect and yes there was an update on the 8th. Xltb12 fixed it with these names instead:



    Thanks for the consideration on an open source updater for reflection. @Brandon
    So the current hooks are updated, just the world x/y are wrong? I'll try to get around to posting my updater open source in a bit
    “The long-lived and those who will die soonest lose the same thing. The present is all that they can give up, since that is all you have, and what you do not have, you cannot lose.” - Marcus Aurelius

  15. #65
    Join Date
    Mar 2013
    Posts
    1,010
    Mentioned
    35 Post(s)
    Quoted
    620 Post(s)

    Default

    Quote Originally Posted by Kyle View Post
    So the current hooks are updated, just the world x/y are wrong? I'll try to get around to posting my updater open source in a bit
    It seems like rs is up to rev #126 and the hooks are for #125 so the hooks aren't up to date (assuming the reflection hook rev is following the rs rev)
    #slack4admin2016
    <slacky> I will build a wall
    <slacky> I will ban reflection and OGL hooking until we know what the hell is going on

  16. #66
    Join Date
    Oct 2006
    Posts
    6,752
    Mentioned
    95 Post(s)
    Quoted
    532 Post(s)

    Default

    Quote Originally Posted by Harrier View Post
    It seems like rs is up to rev #126 and the hooks are for #125 so the hooks aren't up to date (assuming the reflection hook rev is following the rs rev)
    Thanks pal, updated them

    @Nito; Have fun, and watch, @Kasi;'s comment will be 100% true. Nobody will contribute to it or help me with it even though it is now opensource. But, it is worth a try

    https://villavu.com/forum/showthread.php?t=116829
    “The long-lived and those who will die soonest lose the same thing. The present is all that they can give up, since that is all you have, and what you do not have, you cannot lose.” - Marcus Aurelius

  17. #67
    Join Date
    Nov 2016
    Posts
    31
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by Kyle View Post
    Thanks pal, updated them

    @Nito; Have fun, and watch, @Kasi;'s comment will be 100% true. Nobody will contribute to it or help me with it even though it is now opensource. But, it is worth a try

    https://villavu.com/forum/showthread.php?t=116829
    Much appreciated for the open source updater. Hopefully, we will find someone who is interested enough in keeping the OSRS updater working.

  18. #68
    Join Date
    Jun 2013
    Posts
    15
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Dear members,

    I'm trying to load all the worlds to my clients (invoking get all worlds method) and than the worldlist page will open. Do you guys know how I can close that screen so I can load all the worlds but don't have to show the list itself.

    Thanks in advance!

  19. #69
    Join Date
    Dec 2017
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    It would be cool if someone could follow this thread up with a more in-depth tutorial on how to make deobfuscation methods (i.e. dead code removal, string decryption, unused local variables etc.) and/or a tutorial focused solely on pattern searching.

    I realize this thread has been inactive for a year, but I think it is still relevant today. Aside from rs-hacking and thebytecodeclub, this seems to be the only other forum that discusses java reversing.

  20. #70
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by jknox View Post
    It would be cool if someone could follow this thread up with a more in-depth tutorial on how to make deobfuscation methods (i.e. dead code removal, string decryption, unused local variables etc.) and/or a tutorial focused solely on pattern searching.

    I realize this thread has been inactive for a year, but I think it is still relevant today. Aside from rs-hacking and thebytecodeclub, this seems to be the only other forum that discusses java reversing.

    The methods you are asking for will require knowledge of Control Flow Graphs.. You'd use this to detect if code can be reached.. or if local variables are used or not.. You can also use it to determine if a local variable has been assigned to but never used. Do you really need a tutorial on decrypting strings?
    Last edited by Brandon; 12-11-2017 at 01:24 AM.
    I am Ggzz..
    Hackintosher

  21. #71
    Join Date
    Dec 2017
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    The methods you are asking for will require knowledge of Control Flow Graphs..
    Is there any particular place to read on control flow graphs?

  22. #72
    Join Date
    Jul 2018
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Code:
    Download jar..
    Deobfuscating Multipliers..
    Changed: 5636 multipliers of 7218
    
    Exception in thread "main" java.lang.ClassCastException: jdk.internal.org.objectweb.asm.tree.LabelNode cannot be cast to jdk.internal.org.objectweb.asm.tree.IntInsnNode
    	at Analysers.ClientAnalyser.findVersion(ClientAnalyser.java:38)
    	at Analysers.ClientAnalyser.identify(ClientAnalyser.java:30)
    	at Utilities.ClassParser.lambda$analyse$0(ClassParser.java:51)
    	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
    	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
    	at Utilities.ClassParser.analyse(ClassParser.java:47)
    	at TutorialUpdater.Main.main(Main.java:14)
    
    Process finished with exit code 1
    How do I get this to run correctly?
    Seems simple I just cant figure it out.
    Ive got the jar file with the correct classfiles.

    Edit: Any enlightenment on what is going on would be much appreciated.
    Last edited by gottapercha2; 07-20-2018 at 04:56 AM.

  23. #73
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by gottapercha2 View Post
    Code:
    Download jar..
    Deobfuscating Multipliers..
    Changed: 5636 multipliers of 7218
    
    Exception in thread "main" java.lang.ClassCastException: jdk.internal.org.objectweb.asm.tree.LabelNode cannot be cast to jdk.internal.org.objectweb.asm.tree.IntInsnNode
    	at Analysers.ClientAnalyser.findVersion(ClientAnalyser.java:38)
    	at Analysers.ClientAnalyser.identify(ClientAnalyser.java:30)
    	at Utilities.ClassParser.lambda$analyse$0(ClassParser.java:51)
    	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
    	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
    	at Utilities.ClassParser.analyse(ClassParser.java:47)
    	at TutorialUpdater.Main.main(Main.java:14)
    
    Process finished with exit code 1
    How do I get this to run correctly?
    Seems simple I just cant figure it out.
    Ive got the jar file with the correct classfiles.

    Edit: Any enlightenment on what is going on would be much appreciated.

    Java Code:
    private ClassField findVersion(ClassNode node) {
            for (MethodNode m : node.methods) {
                if (m.name.equals("init") && m.desc.equals("()V")) {
                    int i  = new Finder(m).findPattern(new int[]{Opcodes.SIPUSH, Opcodes.SIPUSH, Opcodes.SIPUSH, Finder.CONSTANT, Opcodes.INVOKEVIRTUAL});
                    if (i != -1) {
                        AbstractInsnNode insnNode = m.instructions.get(i + 2);
                        if (insnNode instanceof IntInsnNode) {
                            IntInsnNode revision = (IntInsnNode) insnNode;
                            return new ClassField("Revision", String.valueOf(revision.operand), "I");
                        }
                    }
                }
            }
            return new ClassField("Revision", "-1", "I");
        }
    I am Ggzz..
    Hackintosher

Page 3 of 3 FirstFirst 123

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •