ARTist icon indicating copy to clipboard operation
ARTist copied to clipboard

Log Module name and filter specs for each loaded module once

Open sweisgerber-dev opened this issue 6 years ago • 3 comments

I think it could be really helpful if we would log loaded ARTist module names and their filter spec once, when ARTist loads a module.

Example

HArtist() Version: 00112 Module: `<MODULE-NAME>`
# Filters:
- `com.android.server.AppOpsService`
- `com.android.server.`
- `...`
# Injections:
- Method: `Lsaarland/cispa/artist/codelib/CodeLib;traceLog()V`
    - Targets:
        - METHOD_START: "GENERIC_TARGET"
        - METHOD_CALL_BEFORE: "onTransact("
- Method: `Lsaarland/cispa/artist/codelib/CodeLib;traceLog2()V`
    - Targets:
        - METHOD_CALL_BEFORE: "onCreate("

Helpful files/methods

  • compiler/optimizing/artist/artist.cc
    • void HArtist::LogVersionOnce(const string& VERSION)
  • Module::getMethodFilter()
  • HUniversalArtist::ProvideInjections

sweisgerber-dev avatar Jul 24 '18 09:07 sweisgerber-dev

The current version does log "Loaded ARTist module <package_name>" if a module loaded sucessfully. https://github.com/Project-ARTist/art/blob/4ccd3debc7e96c4c6c676295804eecfdab2f8be2/dex2oat/dex2oat.cc#L1214

partipan-dot avatar Jul 27 '18 10:07 partipan-dot

Thanks @parthipanramesh

That means I would vote for:

  • Adding the additional information, as well as
  • adding some statistics after the instrumentation finished, which could be pretty useful, especially for wildcard target definitions
    • how many different unique injection-targets matched (perhaps listing the matched functions)
    • How many non-unique calls to the method were injected.

What you think?

sweisgerber-dev avatar Jul 30 '18 08:07 sweisgerber-dev

Yes that sound good! 👍

partipan-dot avatar Jul 30 '18 08:07 partipan-dot