heros icon indicating copy to clipboard operation
heros copied to clipboard

How to analyse a specific method ?

Open fynch3r opened this issue 4 years ago • 3 comments

I run an easy code:

public class IFDSDemo {
    public static void main(String[] args) {
        int x = secret();
        int y = 0;
        y = foo(x);
        print(y);
    }

    private static void print(int y) {
        System.out.println(y);
    }

    private static int secret() {
        return 88;
    }
    private static int foo(int p){
        return p;
    }
}

I use the wiki way to analysis. I wonder that how to analyse a specific method as an entry method. Because I find that the wiki says:

// Set the main class of the application to be analysed
        Options.v().set_main_class(mainClass);

I think that heros must has a way to implement of specific functions as entry points. If not , please tell me why. Thanks.

fynch3r avatar Jul 20 '21 11:07 fynch3r

Please, I would appreciate some help.

fynch3r avatar Jul 21 '21 11:07 fynch3r

Hi. You may want to look at the documentation of the Soot framework. Heros is using Soot to do class loading and call-graph construction.

ericbodden avatar Jul 22 '21 12:07 ericbodden

In heros IFDS, you need to give some seeds to start the analysis.

canliture avatar Aug 03 '21 13:08 canliture