[Soot-list] How to set -process-dir and -cp correctly in this case? I got the error: class small.DataClass read in from a classfile in which DataClass was expected.

Guru Devanla gdevan2 at uic.edu
Fri Nov 22 18:12:51 EST 2013


Hi Khanh,

I looked at the current version of Soot. I think the problem is in

PackManager.runPacksForOneClassAtATime().  This methods loops through all
files it files under -process-dir and *does not check/respect*  attributes
set with -x option.

The looping structure in that method can have a conditional check to see if
the class being processed is part of the excluded package.

Eric et all: So, is it okay to exclude classes at this method level. Does
anyone see any incompatibility issues with excluded class under process-dir
not being part of application class list?

Thanks
Guru



























On Fri, Nov 22, 2013 at 1:20 PM, Khanh Nguyen <khanhtn1 at uci.edu> wrote:

> Even with -no-bodies-for-excluded I still see my transformation touches
> the excluded packages
> My command is this:  -w -pp -keep-line-number -f J -p jb
> use-original-names:false  -process-dir C:\test\bin -exclude small
> -no-bodies-for-excluded -cp C:\test\bin
> Anything that is unusual?
>
> Thank you,
>
> Khanh Nguyen
>
>
> On Fri, Nov 22, 2013 at 12:12 PM, Guru Devanla <gdevan2 at uic.edu> wrote:
>
>> I think you also need to use -no-bodies-for-excluded.  I have seen
>> excluded packages being touched for different analysis when I just use the
>> -x option.
>>
>> Hope that helps.
>>
>> -Guru
>>
>>
>> On Fri, Nov 22, 2013 at 10:38 AM, Khanh Nguyen <khanhtn1 at uci.edu> wrote:
>>
>>> Hi Eric,
>>>
>>> Unfortunately, that doesnt work for me. I set the "-x small" then
>>> use Scene.v().getApplicationClasses() to get the application classes to
>>> check. And there are classes from package "small" being analyzed.
>>> I'm using the released soot 2.5. My analysis is in pack "wjtp" if that
>>> info helps.
>>>
>>>
>>>
>>> Thank you,
>>>
>>> Khanh Nguyen
>>>
>>>
>>> On Fri, Nov 22, 2013 at 12:20 AM, Bodden, Eric <
>>> eric.bodden at sit.fraunhofer.de> wrote:
>>>
>>>> Hi Khanh.
>>>>
>>>> When you set Soot's classpath or process dir then the path must always
>>>> point to the root of the package hierarchy, not to some particular package
>>>> folder, i.e., in your setting it must point to C:\test\bin\
>>>> You can then the include/exclude options to include/exclude certain
>>>> packages from analysis. See here:
>>>> http://www.sable.mcgill.ca/soot/tutorial/usage/index.html
>>>>
>>>> Does that work for you?
>>>>
>>>>
>>>> Cheers,
>>>> Eric
>>>>
>>>>
>>>>
>>>> On 18.11.2013, at 08:47, Khanh Nguyen <khanhtn1 at uci.edu> wrote:
>>>>
>>>> > Hello,
>>>> >
>>>> > I know that this question has been in the list since a long time ago,
>>>> I read all those posts and got what I wanted to do but still, I want it
>>>> work in another way (if possible)
>>>> > The background is this: In C:\test\bin I have 2 folders, "simple" and
>>>> "small" (equivalent to 2 different packages) in "small", I have one class:
>>>> DataClass.class, in "simple", I also have one class called DataClass.class
>>>> >
>>>> > I want to apply my analysis only on folder "small". Thus I used the
>>>> command line :-process-dir C:\test\bin\small -cp C:\test\bin\small.
>>>> > I understand that by setting -process-dir C:\test\bin\small, the
>>>> class Soot will find to load is DataClass.class (i.e. no info about the
>>>> package 'small') which is okay, that's why I thought the -cp must be set as
>>>> C:\test\bin\small. So now the file structure is identical. But I got the
>>>> error instead("class small.DataClass read in from a classfile in which
>>>> DataClass was expected.")
>>>> > Is it because even when setting -cp: C:\test\bin\small the class
>>>> loaded is still be considered as small.DataClass? (because the actual class
>>>> is read and thus, the name is small.DataClass?)
>>>> >
>>>> >
>>>> > Of course I can make my analysis to work only on "small" by deleting
>>>> the "simple" and set both -process-dir and -cp to C:\test\bin (so that
>>>> -process-dir sets the target class is actually small.DataClass and -cp will
>>>> let me see small\DataClass.class)
>>>> > But, even with only "small" under C:\test\bin, I cant do -process-dir
>>>> C:\test\bin -cp C:\test\bin\small, either (Soot will complain there is no
>>>> small.DataClass on classpath- why? now -cp only see DataClass.class?)
>>>> >
>>>> > But, bottom line is, isnt there anyway to just set the target of the
>>>> analysis restricted to only 1 package like what I wanted?
>>>> >
>>>> > Thank you,
>>>> >
>>>> > Khanh Nguyen
>>>> > UC Irvine
>>>> > _______________________________________________
>>>> > Soot-list mailing list
>>>> > Soot-list at sable.mcgill.ca
>>>> > http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>>>>
>>>> --
>>>> Prof. Eric Bodden, Ph.D., http://sse.ec-spride.de/ http://bodden.de/
>>>> Head of Secure Software Engineering  at Fraunhofer SIT, TU Darmstadt
>>>> and EC SPRIDE
>>>> Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
>>>> Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt
>>>>
>>>>
>>>
>>> _______________________________________________
>>> Soot-list mailing list
>>> Soot-list at sable.mcgill.ca
>>> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20131122/202f7d90/attachment.html 


More information about the Soot-list mailing list