Skip to content

Commit

Permalink
Update detector for allatori
Browse files Browse the repository at this point in the history
Fixes #648, but may increase potential for false positives
  • Loading branch information
ThisTestUser committed Dec 12, 2020
1 parent 028b4e4 commit f3ee4b9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ public String test(Deobfuscator deobfuscator) {

isAllatori = isAllatori && TransformerHelper.containsInvokeVirtual(decrypterNode, "java/lang/String", "charAt", "(I)C");
isAllatori = isAllatori && TransformerHelper.containsInvokeVirtual(decrypterNode, "java/lang/String", "length", "()I");
isAllatori = isAllatori && TransformerHelper.countOccurencesOf(decrypterNode, ISHL) > 0;
isAllatori = isAllatori && TransformerHelper.countOccurencesOf(decrypterNode, IXOR) > 2;
isAllatori = isAllatori && TransformerHelper.countOccurencesOf(decrypterNode, NEWARRAY) > 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,10 @@ public boolean canCheckEquality(JavaValue first, JavaValue second, Context conte
private boolean isAllatoriMethod(Map<Integer, AtomicInteger> insnCount, Map<String, AtomicInteger> invokeCount) {
//XXX: Better detector
if(insnCount.get(Opcodes.IXOR) == null ||
insnCount.get(Opcodes.ISHL) == null ||
insnCount.get(Opcodes.NEWARRAY) == null ||
invokeCount.get("charAt") == null || invokeCount.get("length") == null)
return false;
return insnCount.get(Opcodes.IXOR).get() >= 3 &&
insnCount.get(Opcodes.ISHL).get() >= 1 &&
insnCount.get(Opcodes.NEWARRAY).get() >= 1 &&
invokeCount.get("charAt").get() >= 2 &&
invokeCount.get("length").get() >= 1;
Expand Down

0 comments on commit f3ee4b9

Please sign in to comment.