Skip to content

Search

Search allows you to search for identifying aspects of class files, such as constant pool values and class members.

The search tab can be opened like any unscoped tab, using Analysis -> Search or by pressing Ctrl+Shift+F.

There are three search modes, selectable in the dropdown menu:

  • Partial match (case-sensitive)
  • Exact match (case-sensitive)
  • Regular expression (RegEx pattern occurrences)

and a special mode, only available for fields and methods, Reference. As the name implies, it searches for references of members instead of their declarations.

Search example

Strings are the default, most basic search option. This mode searches for string entries in the constant pool, equivalent to string literals in the Java language.

This mode does not search in all string-like entries in the constant pool, so it will never find member names/descriptors or the like, only actual strings. If you wish to search for those, use the pseudocode mode.

The pseudocode mode is useful for checking raw matches against the disassembled representation. It searches through all instructions and constant pool entries, useful for finding number literals, string literals, member references and more.

Commonly searched aspects and queries may look like this:

Searching?ModeQuery
All strings in the class fileRegular expression^STRING
All string-like entries in the class fileRegular expression^UTF8
Reference to a specific classExact match/anyCLASS package/SearchedClass
Reference to a specific fieldExact match/anyNAME_AND_TYPE theField Lthe/Type;
Reference to a specific methodExact match/anyNAME_AND_TYPE theMethod ()V
A ldc instruction with a specific numberExact match/anyldc 123456789
A sipush instruction with a specific numberExact match/anysipush 1234

Members are searched by their name and descriptor, delimited by a space: theField Lthe/Type; or theMethod ()V.

Commonly searched aspects and queries may look like this:

Searching?ModeQuery
Any field/method with a specific nameRegular expression^theField
Any method returning a specific typeRegular expression)Lthe/Type;$
Specific fieldExact match/anytheField Lthe/Type;
Specific methodExact match/anytheMethod ()V

slicer also allows you to search for references of a specific type in the context menu of the code view (Java-only for now).

This is useful for quickly finding references to a specific class without having to type the query in the search tab.

Contextual search example

If you want to find all references and declarations of a specific class, you can use the Find usages option in the context menu of the code view. This is equivalent to searching for the class name in the search tab.

Find usages example

If you want to find all subtypes of a specific class or interface, you can use the Find implementations option in the context menu of the code view. This is equivalent to viewing the inheritance graph of the class with subtypes enabled, minus the super types.

Find implementations example