Skip to content

False positive when run on x86 architecture #31

@flikkr

Description

@flikkr

Firstly, thanks for the repo. I wanted to try and get this sample project to run on 32-bit architecture since it would just crash on older devices, so I added x86 to the list of valid ABIs in build.gradle.

...
ndk {
     abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64', 'x86'
}
...

Because of that, all system calls using the my_ prefix are broken once we try to run in x86. After removing all the my_ prefixes from the system calls, the sample app seems to be working as expected except for the check in the detect_frida_memdiskcompare function. The logs indicate that the libc library has a mismatching checksum despite the device being clean. I encountered this issue when running the app on a Pixel 4 emulator on x86 ABI with API version 30. This checksum mismatch did not occur on different x86 emulator running on API 29. Any idea what could be causing this?

Logcat

2022-12-27 18:10:33.630 7534-7561/com.darvin.security V/DetectFrida: Map [b9c26000-b9c29000 r-xp 00000000 fd:05 49183                              /data/app/~~CdhyIBdGvW9M9-2j_yxpNg==/com.darvin.security-HX80p3_DA5ykyXtiMkYaKQ==/lib/x86/libnative-lib.so]
2022-12-27 18:10:33.630 7534-7561/com.darvin.security V/DetectFrida: Checksum:[44199][44199]
2022-12-27 18:10:33.630 7534-7561/com.darvin.security V/DetectFrida: Checksum:[494221][494221]
2022-12-27 18:10:33.630 7534-7561/com.darvin.security V/DetectFrida: Map [b9c29000-b9c2a000 r--p 00002000 fd:05 49183                              /data/app/~~CdhyIBdGvW9M9-2j_yxpNg==/com.darvin.security-HX80p3_DA5ykyXtiMkYaKQ==/lib/x86/libnative-lib.so]
2022-12-27 18:10:33.630 7534-7561/com.darvin.security V/DetectFrida: Map [b9c2a000-b9c2b000 rw-p 00003000 fd:05 49183                              /data/app/~~CdhyIBdGvW9M9-2j_yxpNg==/com.darvin.security-HX80p3_DA5ykyXtiMkYaKQ==/lib/x86/libnative-lib.so]
2022-12-27 18:10:33.806 7534-7561/com.darvin.security V/DetectFrida: Map [e5e61000-e5ea3000 r--p 00000000 07:60 17                                 /apex/com.android.runtime/lib/bionic/libc.so]
2022-12-27 18:10:33.806 7534-7561/com.darvin.security V/DetectFrida: Map [e5ea3000-e5f4f000 r-xp 00041000 07:60 17                                 /apex/com.android.runtime/lib/bionic/libc.so]
2022-12-27 18:10:33.808 7534-7561/com.darvin.security V/DetectFrida: Checksum:[67333658][67435579]
2022-12-27 18:10:33.808 7534-7561/com.darvin.security V/DetectFrida: Executable Section Manipulated, maybe due to Frida or other hooking framework.Act Now!!!
2022-12-27 18:10:33.808 7534-7561/com.darvin.security V/DetectFrida: Checksum:[1008449][1051236]
2022-12-27 18:10:33.809 7534-7561/com.darvin.security V/DetectFrida: Executable Section Manipulated, maybe due to Frida or other hooking framework.Act Now!!!
2022-12-27 18:10:33.809 7534-7561/com.darvin.security V/DetectFrida: Map [e5f4f000-e5f52000 r--p 000ec000 07:60 17                                 /apex/com.android.runtime/lib/bionic/libc.so]
2022-12-27 18:10:33.809 7534-7561/com.darvin.security V/DetectFrida: Map [e5f52000-e5f54000 rw-p 000ee000 07:60 17                                 /apex/com.android.runtime/lib/bionic/libc.so]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions