...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":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.