Skip to content

Test the MinHash pipeline end to end for Dalvik - #242

Open
r0ny123 wants to merge 2 commits into
familiary:mainfrom
r0ny123:test/239-dalvik-end-to-end
Open

r0ny123 wants to merge 2 commits into
familiary:mainfrom
r0ny123:test/239-dalvik-end-to-end

Conversation

@r0ny123

@r0ny123 r0ny123 commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #239.

testCrossArchMinhashing runs AArch64 and CIL reports through escaper dispatch, both shinglers, storage and MatcherSample, but Dalvik only had its dispatch and fingerprint tested. It now gets the same two checks: its minhashes come from DalvikInstructionEscaper, and two near-duplicates and an identical function match by MinHash and by PicHash.

The fixtures come from two builds of the HackingTeam RCS Android implant (rednaga's write-up), trimmed to three of the implant's own methods each:

method build A (APK 87efe6a1…) build B (APK 07278c56…) match
HttpUtils.uploadFile 0x16d0c, 189 instructions 0x15918, 161 MinHash only, 87.5
Logger.WriteErrorLog 0x205f8 0x1e0f4 MinHash only, 81.25
Serialization.binarySerialize 0x19b10 0x18338 PicHash, 100

For scale, across the whole classes.dex of the two builds MCRIT reports 2,367 PicHash and 212 MinHash-only function matches. The reports are 85–91 KB; their statistics are cut down to the three functions, the rest of the metadata still describes the whole DEX.

Tests only; the full suite is green.

familiary#239)

testCrossArchMinhashing ran AArch64 and CIL reports through shingling,
storage and sample matching, but Dalvik only had its escaper dispatch and
fingerprint tested. It now checks that Dalvik functions are hashed with
DalvikInstructionEscaper and that a known near-duplicate and an identical
function match by MinHash and PicHash respectively.

The fixtures are two functions of smda's own Dalvik test sample
(blockblast_classes_xored): report A as smda disassembles it, report B
from a copy with one instruction changed (sput-object to const-string,
the same 21c format) and its checksum and signature recomputed, since no
second build of that app is at hand.
The first Dalvik fixtures paired smda's BlockBlast test DEX with a copy
that had one instruction changed, for lack of a second build. They now
come from two real builds of the HackingTeam RCS Android implant: three
of its own methods in each, two of which changed between the builds
(MinHash-only matches at 87.5 and 81.25) and one that did not (PicHash).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant