angr.state_plugins.javavm_classloader

class angr.state_plugins.javavm_classloader.SimJavaVmClassloader

Bases: SimStatePlugin

JavaVM Classloader is used as an interface for resolving and initializing Java classes.

__init__(initialized_classes=None)
get_class(class_name, init_class=False, step_func=None)

Get a class descriptor for the class.

Parameters:
  • class_name (str) – Name of class.

  • init_class (bool) – Whether the class initializer <clinit> should be executed.

  • step_func (func) – Callback function executed at every step of the simulation manager during the execution of the main <clinit> method

get_superclass(class_)

Get the superclass of the class.

get_class_hierarchy(base_class)

Walks up the class hierarchy and returns a list of all classes between base class (inclusive) and java.lang.Object (exclusive).

is_class_initialized(class_)

Indicates whether the classes initializing method <clinit> was already executed on the state.

init_class(class_, step_func=None)

This method simulates the loading of a class by the JVM, during which parts of the class (e.g. static fields) are initialized. For this, we run the class initializer method <clinit> (if available) and update the state accordingly.

Note: Initialization is skipped, if the class has already been

initialized (or if it’s not loaded in CLE).

property initialized_classes

List of all initialized classes.