Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

...actually the answer may be easier than this.

Decompilers are fine, and without this being legal advice, I find (as a human) nothing provocative in digging through class files to expose the data that is being presented. If your purpose is to access the data (which they have given you relative to a contractual obligation), the means by which you gain access to the data are probably your own business.

"But," (as Vincent Vega said,) "that don't matter, cause check this out..."

Java classes expose their details through a process known as reflection and introspection. Even if your vendor has obfuscated the class files, the encapsulated data you are trying to gather is probably quite accessible through this mechanism.

The purpose of reflection is to allow java classes to be used in environments other than more java code. What that means is that we want to be able to manipulate java objects from scripting environments, from tool builders and from other places that don't have us writing more code to use our object. (In fact, a lot of the java "instant application makers" take advantage of this fact.)

What it means to us here is that we can use the reflection API to query the objects about their characteristics, even if we don't have the original source. This is how decompilers do their thing.

It sounds like you are trying to get at the data held in the various objects with your own code, and again, I don't see any "reverse engineering" implications in this, any more than if you wrote some code to extract the plain text content of a PDF file or a Word document. (But you should ask an attorney to be safe.)

What I can't tell you is how to write code in Perl that will allow you to introspect the class files. (I would do that work in Java myself.) I believe (from a glimpse of related discussions) that this may be possible. It certainly is relatively easy to write a little Java that will extract the information you want.

And it may prove to be instructive as you contemplate how you might do it in Perl. If you take a look at the details of object introspection in Java and discover how you would do this, you may be able to relate that to something that you would do in Perl to accomplish the same effect.

Thanks for your questions BTW, this will stimulate me to engage in the long overdue reading about the current state of interfacing Perl with Java.

---v


In reply to Re: Java Decompilation in Perl by agentv
in thread Java Decompilation in Perl by Stegalex

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-04-18 23:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found