1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Resource [Educational] Reverse Engineering Example - IntelliJ 15.0.2 & Other JetBrains Products

Discussion in 'Tutorials & Resources' started by Arbiter, Dec 16, 2015.

  1. Arbiter

    Arbiter Mod Automation

    Joined:
    Jul 26, 2013
    Messages:
    2,938
    Likes Received:
    1,266
    Whipped up a quickie example of how to apply reverse engineering principles and Java ASM Tree API to an existing code base. I hope some of you find it useful for purely educational purposes. The GNU General Public License applies, as included in the source zip.

    Executable: idea-toolkit-1.0.1.jar
    Example Usage: java -jar idea-toolkit-1.0.1.jar "C:\Program Files (x86)\JetBrains\IntelliJ 15.0.3\lib\idea.jar"
    Source: idea-toolkit-1.0.1-sources.zip

    The process itself is simple. It locates a particular class of interest with some crude identifiers. Then it manipulates a key method that originally decrypts the user submitted input and returns the decrypted, (mostly) JSON result. It replaces this method with simply piping the input through to the output with no decryption. Now one could provide an un-encrypted input like the one below and the whole decryption process would be avoided. Since this logic is common among their multiple products, this process will work across all of them.

    For any curious souls, this method works for all of the following products.
    • IntelliJ 15.0.3 [Confirmed - C:\Program Files (x86)\JetBrains\IntelliJ 15.0.2\lib\idea.jar]
    • PhpStorm 10.0.3, 10.0.4, 2016.2.1 [Confirmed - C:\Program Files (x86)\JetBrains\PhpStorm 10.0.3\lib\phpstorm.jar]
    • WebStorm
    • PyCharm
    • RubyMine
    • AppCode
    • CLion
    • ReSharper
    • dotMemory
    • dotCover

    Code (Javascript):
    1. Commercial-
    2. {
    3.   "licenseId": "Commercial",
    4.   "licenseeName": "Arbiter",
    5.   "products": [
    6.   {
    7.   "code": "II",
    8.   "paidUpTo": "2038-01-19"
    9.   },
    10.    {
    11.   "code": "PS",
    12.   "paidUpTo": "2038-01-19"
    13.   },
    14.    {
    15.   "code": "WS",
    16.   "paidUpTo": "2038-01-19"
    17.   },
    18.    {
    19.   "code": "PC",
    20.   "paidUpTo": "2038-01-19"
    21.   },
    22.    {
    23.   "code": "RM",
    24.   "paidUpTo": "2038-01-19"
    25.   },
    26.    {
    27.   "code": "AC",
    28.   "paidUpTo": "2038-01-19"
    29.   },
    30.    {
    31.   "code": "CL",
    32.   "paidUpTo": "2038-01-19"
    33.   },
    34.    {
    35.   "code": "RS0",
    36.   "paidUpTo": "2038-01-19"
    37.   },
    38.    {
    39.   "code": "DM",
    40.   "paidUpTo": "2038-01-19"
    41.   },
    42.    {
    43.   "code": "DC",
    44.   "paidUpTo": "2038-01-19"
    45.   }
    46.   ]
    47. }
    Legacy Versions:
    Executable: idea-toolkit-1.0.0.jar
    Example Usage: java -jar idea-toolkit-1.0.0.jar "C:\Program Files (x86)\JetBrains\IntelliJ 15.0.2\lib\idea.jar"
    Source: idea-toolkit-1.0.0-sources.zip
     
    #1 Arbiter, Dec 16, 2015
    Last edited: Oct 16, 2016
    Defeat3d, Derk and CantSeeMeHomie like this.
  2. Viewer

    Viewer Discretion is advised

    Joined:
    Jan 2, 2014
    Messages:
    306
    Likes Received:
    77
  3. InfidelAllah

    Joined:
    Nov 22, 2015
    Messages:
    45
    Likes Received:
    8
    Woah, This is a really good starting point for me, I never really bothered to look into java RE but this gives me a good place to start. Any small games/projects that you would suggest tinkering with?
     
  4. creativeself

    Joined:
    Jul 16, 2015
    Messages:
    212
    Likes Received:
    42
    Thats awesome, as an aspiring reverse engineer I find this highly motivational. Did you just use a Java Decompiler and locate the "Particular class of interest"?. How did you know which class to find?
     
  5. Savior

    Savior Java Warlord

    Joined:
    Nov 17, 2014
    Messages:
    4,906
    Likes Received:
    2,748
    I wish it was educational, but just looking at the source doesn't help me understand shit lol. GJ tho! :)
     
  6. Eagles13

    Eagles13 The only thing Alpha about me is my bots

    Joined:
    Sep 22, 2014
    Messages:
    618
    Likes Received:
    186
    @Arbiter It doesn't seem to work with PyCharm.
     
  7. Arbiter

    Arbiter Mod Automation

    Joined:
    Jul 26, 2013
    Messages:
    2,938
    Likes Received:
    1,266
    Haven't tested with PyCharm, but what jar are you running this tool yet? You could unzip it and make sure the path it's looking for exists. Let me know your findings.
    --- Double Post Merged, Jan 11, 2016, Original Post Date: Jan 8, 2016 ---
    Version 1.0.1 adapts to some changes JetBrains made in an update to certain products, such as PhpStorm and PyCharm, that broke the previous pattern. New pattern has been tested against both those that were and weren't broken by this update. @Eagles13 @frazboyz
     
  8. Arbiter

    Arbiter Mod Automation

    Joined:
    Jul 26, 2013
    Messages:
    2,938
    Likes Received:
    1,266
  9. InfidelAllah

    Joined:
    Nov 22, 2015
    Messages:
    45
    Likes Received:
    8
  10. Arbiter

    Arbiter Mod Automation

    Joined:
    Jul 26, 2013
    Messages:
    2,938
    Likes Received:
    1,266
    Search for simple Java games. Those are always a good place to start. Plus infinite health is always fun. :)
    --- Double Post Merged, Jan 23, 2016, Original Post Date: Jan 13, 2016 ---
    Confirmed working with IntelliJ 15.0.3 and PyCharm.
     
  11. Eagles13

    Eagles13 The only thing Alpha about me is my bots

    Joined:
    Sep 22, 2014
    Messages:
    618
    Likes Received:
    186
    Works on OSX. Noice.
     
    Arbiter likes this.
  12. frazboyz

    Joined:
    Nov 15, 2013
    Messages:
    339
    Likes Received:
    56
    @Arbiter This works for RubyMine, Clion and Webstorm aswell.
     
    Arbiter likes this.
  13. liamjke

    Joined:
    Mar 14, 2016
    Messages:
    1
    Likes Received:
    0
    Hey @Arbiter, is it possible that you could reupload the source?

    I am curious about how you knew what to look for with the identifier. I am a noob at this and want to learn, how did you know where to look once you decompiled idea.jar, is there a way to step through the obfuscated code or see what happens?
     
  14. Sami Muhammed

    Joined:
    Aug 4, 2017
    Messages:
    1
    Likes Received:
    0
    Starting with version 2017.2.1 , even though the class of interest is found and manipulated, it doesn't seem to work
     
  15. InfidelAllah

    Joined:
    Nov 22, 2015
    Messages:
    45
    Likes Received:
    8
    Can we get a reupload or source on svn/git somewhere?
     
    mcm3rl1n likes this.

Share This Page

Loading...