fix: check CONST_STRING_JUMP instructions for matching string

Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
oSumAtrIX 2023-02-10 05:18:38 +01:00
parent 1029d56a52
commit 058d292ad5
No known key found for this signature in database
GPG key ID: A9B3094ACDB604B4

View file

@ -106,7 +106,10 @@ abstract class MethodFingerprint(
val stringsList = methodFingerprint.strings.toMutableList() val stringsList = methodFingerprint.strings.toMutableList()
implementation.instructions.forEachIndexed { instructionIndex, instruction -> 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 string = ((instruction as ReferenceInstruction).reference as StringReference).string
val index = stringsList.indexOfFirst(string::contains) val index = stringsList.indexOfFirst(string::contains)
@ -244,7 +247,7 @@ data class MethodFingerprintResult(
* The result of scanning strings on the [MethodFingerprint]. * The result of scanning strings on the [MethodFingerprint].
* @param matches The list of strings that were matched. * @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. * Represents a match for a string at an index.
* @param string The string that was matched. * @param string The string that was matched.