Skip to content

Analysis

To enable features, such as the integrated pseudocode disassembler and the class view, slicer creates in-memory models of classes.

By default, a partial version of the model is created for all classes in the background - this is called background analysis. When a class is to be disassembled or the like, a full version of the model is created and cached.

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)

Search example

Constant pool

Searching in the constant pool is done by checking for matches against disassembled representations of the underlying entries.

Commonly searched aspects and queries may look like this:

Searching?ModeQuery
All strings in the class fileRegular expression^STRING
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

Members

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

Transformers

Transformers are a convenient way to transform class files before they’re analyzed (just-in-time). They can be applied in the Analysis -> Transformers menu.

slicer includes several options that may improve the chances of successful disassembly when dealing with obfuscated code.

Readability

Readability transformers perform destructive transformations, which may help with readability of decompiled output in particular.

NameDescription
Strip annotationsRemoves annotation-related attributes (*Annotations, AnnotationDefault), useful for mitigating “ASM crashers”.
Strip try-catchesRemoves exception table entries in Code attributes, useful when dealing with flow obfuscation.
Strip local variablesRemoves LocalVariable(Type)Table and MethodParameters attributes, useful when dealing with name obfuscation.
Strip synchronized blocksReplaces all monitorenter and monitorexit instructions with nop instructions.
Strip generic signaturesRemoves Signature attributes, useful when dealing with name obfuscation.
Strip debug informationRemoves Deprecated, SourceFile, SourceDebugExtension and LineNumberTable attributes.

Normalization

Normalization transformers perform functionally equivalent transformations, which mitigate common obfuscation techniques.

NameDescription
Verify attributesAttempts to selectively strip attributes containing garbled data, mainly intended to mitigate “ASM crashers”.
Remove unnecessary modifiersRemoves ACC_SYNTHETIC and ACC_BRIDGE access modifiers where appropriate, useful when dealing with access obfuscation.
Remove unnecessary try-catchesRemoves exception table entries with nonsense ranges and/or handlers that only rethrow the caught exception.
No-op unreachable codeReplaces unreachable code with nop instructions.

Verification

The verification algorithm used in the Verify attributes transformer modifies the class file in an attempt to make it readable by bytecode libraries that were not designed with JVMS violations in mind.

Violations of the class file specification are usually a product of an obfuscator attempting to thwart analysis, as in many cases, these class files are still readable by JVMs.

The transformer does the following:

  • remove attributes that couldn’t be parsed
  • remove attributes defined in an invalid context (e.g. Code attribute on an abstract method)
  • remove attributes with invalid constant pool references (index out of bounds, wrong entry type)