Re: Get imported packages using BCEL

"Dave Brosius" <[email protected]> Fri, 3 Mar 2006 07:48:25 -0500
Newsgroups gmane.comp.jakarta.bcel.user
Message-ID <001101c63ec0$c38516c0$6401a8c0@MeBigFatGuy>
Not directly. You can look at all the instructions and look for 
INVOKEVIRTUAL, INVOKESTATIC, INVOKESPECIAL, INVOKEINTERFACE, and find all of 
the classes specified. And from that assume the list of imports, You would 
have to do the same
for imports for member variables, as well. The problem idea falls apart for 
imports for of classes to access static final variables. In this case
the variable is directly accessed from the importing class, without 
reference to the class where the variable is defined.

So, the answer is no you can't, and what you can get isn't pleasant.

I'm not sure
----- Original Message ----- 
From: "Pico Florin" <[email protected]>
To: <[email protected]>
Sent: Friday, March 03, 2006 4:14 AM
Subject: Get imported packages using BCEL


> Hi!
>    It is possible to use BCEL API to obtain the imported packages(classes) 
> from a java binary code?
>   Thank you in advance,
>          Florin
>
>
> ---------------------------------
> To help you stay safe and secure online, we've developed the all new 
> Yahoo! Security Centre.