Solved

reading obfuscated code

Posted on 2004-10-28
1,188 Views
Last Modified: 2012-08-13
Just out of curiousity, does reading obfuscated code and deobfuscating it manually improve your Java skills? I was just researching obfuscation and was thinking about that, since it seems like a pretty challenging thing (something to pass the time with ;)
0
Question by:Zyloch
    11 Comments
     
    LVL 14

    Accepted Solution

    by:
    Hmm, if you have too much time on your hands, manually de-obfuscating code might be a 'fun' exercise...;-) For learning/improving Java it would be a pretty bad idea I think!

    \t
    0
     
    LVL 7

    Assisted Solution

    by:tomboshell
    MANUALLY!!!  You simply have too much time on your hands.  The best way to learn is to program, which by your question you have covered.  Have you tried to study the source for some larger projects line TomCat, JUnit, Ant and so on?  Those can be quite instructive, or so I hear...I have not had the time to delve into the source code for those projects.   But it is on my never ending list of things to do if, the imposible happens, and I happen to have time on my hands.

    Or if you are in for a challenge look up byte code engeniering.  There are tools to help with that.  At least that sound challenging to me.  
    0
     
    LVL 11

    Assisted Solution

    by:cjjclifford
    Obfuscation generally does unsavory things, from a good-practices perspective, so I would say trying to learn a language, and good-practices of programming in that language, by reading obfuscated code would indeed be a bad idea...

    Studying source code is not really a good approach, IMO, unless you are searching for solutions to particular problems - you can easily get bogged down with the volume of code, and miss many fine points, etc! Start programming, start coming across the same problems again and again in your own solutions, and then for these look to source codes to see other solutions, or better yet, have a Google for "patterns" - basically a "pattern" is a description of a common problem, and a good approach to solve this problem (approach, not source code - for examples of solutions go to the better Open Source projects...)
    0
     
    LVL 11

    Expert Comment

    by:cjjclifford
    sorry, forgot to mention, if you want to try to make reading obsfucated code, run it through one of the many code beautifiers available - this will at least get rid of poor formatting, etc!
    You could also run it through a refactoring tool (Eclipse apparently does it very well!)
     
    0
     
    LVL 21

    Assisted Solution

    by:MogalManic
    A better way to improve your Java skills is to just take the pubic API of the obfuscated jar and reverse enginerr the classes and API yourself.
    0
     
    LVL 21

    Expert Comment

    by:MogalManic
    I have also used the obfuscated source code to figure out the internals of a JAR so that I could write a wrapper class to implement missing or broken functionalities.
    0
     
    LVL 4

    Assisted Solution

    by:lcwiding
    No, manually, or automatically, deobfuscating Java code will not improve your Java skills.

    To my mind, one of the main reasons for that is because there are many things obfucators do that are very difficult, if not impossible, to deobfuscate. One of those is replacing final static variables in the code with the actual literal value.

    I would stay away from this approach, and instead look into a good book like Better, Faster, Lighter Java or Effective Java.
    0
     
    LVL 14

    Assisted Solution

    by:sudhakar_koundinya
    I believe to improve ourselves in Java Skills

    download open source api from sites like Jakara and sorce forge and try investigating on the API what they did.

    Regards
    Sudhakar
    0
     
    LVL 36

    Author Comment

    by:Zyloch
    Yep :)

    I was just wondering because it sounds like fun :)

    Anyways, thanks for all the help. I've gotta go now but be back and accept some of your answers ;)
    0
     
    LVL 14

    Expert Comment

    by:sudhakar_koundinya
    Split the points between guys whom's answer you think is best.

    Regards
    Sudhakar
    0
     
    LVL 14

    Expert Comment

    by:sudhakar_koundinya
    :)
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Suggested Solutions

    Title # Comments Views Activity
    twoTwo  challenge 35 61
    copyEndy  challenge 15 27
    Enhanced For loop vs ForEach Loop 4 28
    countHi challenge 25 43
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
    This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
    This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

    845 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now