Skip to content

Commit

Permalink
fix: check CONST_STRING_JUMP instructions for matching string
Browse files Browse the repository at this point in the history
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
  • Loading branch information
oSumAtrIX committed Feb 10, 2023
1 parent 1029d56 commit 058d292
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -106,7 +106,10 @@ abstract class MethodFingerprint(
val stringsList = methodFingerprint.strings.toMutableList()

implementation.instructions.forEachIndexed { instructionIndex, instruction ->
if (instruction.opcode.ordinal != Opcode.CONST_STRING.ordinal) return@forEachIndexed
if (
instruction.opcode != Opcode.CONST_STRING &&
instruction.opcode != Opcode.CONST_STRING_JUMBO
) return@forEachIndexed

val string = ((instruction as ReferenceInstruction).reference as StringReference).string
val index = stringsList.indexOfFirst(string::contains)
Expand Down Expand Up @@ -244,7 +247,7 @@ data class MethodFingerprintResult(
* The result of scanning strings on the [MethodFingerprint].
* @param matches The list of strings that were matched.
*/
data class StringsScanResult(val matches: List<StringMatch>){
data class StringsScanResult(val matches: List<StringMatch>) {
/**
* Represents a match for a string at an index.
* @param string The string that was matched.
Expand Down

0 comments on commit 058d292

Please sign in to comment.