GithubHelp home page GithubHelp logo

recat's Introduction

recat

A colorful and highly configurable alternative to the adb logcat command from the Android SDK with on the fly deobfuscation! (based on Marshall Culpepper's great logcat-color).

recat uses pyretrace to deobfuscate logs.

Note: recat (logcat-color) is targetted at OS X and Linux, and does not currently work in Windows.

PyPI version

Installation

Installation via pip

$ pip install recat-color

Installation from source (requires setuptools, may require sudo)

You can clone the recat git repository directly:

$ git clone https://github.com/EverythingMe/recat.git

To install logcat-color from the source directory, run:

$ sudo pip install .

or

$ sudo python setup.py install

Examples

for logcat-color usage examples, configuration and profiles, go to (logcat-color's original README)

##Deobfuscation recat retraces obfuscated logs using pyretrace, a python reimplementation on Proguard's Retrace, with a deobfuscation API for python.

When looking at logs from an obfuscated release build, trace messages are obfuscated too, here's a crash log from EverythingMe Launcher's release build:

original log output

Supplying a mapping file path as a command line argument will trigger the deobfuscation mechanism, causing every log line to go through pyretrace's deobfuscator.

$ recat -m path/to/mapping/file.txt

Same log, now with mapping file path added:

With Recat

This will make the best effort to deobfuscate the 'message' in each line.

Deobfuscating tags

The following snippet is taken from iosched. It became a pretty popular strategy for log tag creation.

    public static String makeLogTag(String str) {
        if (str.length() > MAX_LOG_TAG_LENGTH - LOG_PREFIX_LENGTH) {
            return LOG_PREFIX + str.substring(0, MAX_LOG_TAG_LENGTH - LOG_PREFIX_LENGTH - 1);
        }

        return LOG_PREFIX + str;
    }

    /**
     * Don't use this when obfuscating class names!
     */
    public static String makeLogTag(Class cls) {
        return makeLogTag(cls.getSimpleName());
    }

If you use this type of deobfuscation and wish to deobfuscate the tag as well, you must supply a prefix for your tags (i.e. LOG_PREFIX), here's an example:

EverythingMe Launcher used ev. as its base log prefix, adding -t ev will now deobfuscate the tags as well:

$ recat -m path/to/mapping/file.txt -t ev

Same output, now with deobfuscated tags:

Deobfuscated with tags

TODO - Mapping Fetcher

I also added a skeleton for a mapping file fetcher. It should auto download a mapping file from a file server by supplying a mapping file path template.

Thanks

Thanks to Marshall Culpepper for the great logcat-color.

recat's People

Contributors

coi-l avatar ethankhall avatar johnjohndoe avatar marshall avatar mykmelez avatar rotemmiz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

recat's Issues

"Issues" when running setup.py

Hello, I was trying to work with recat but it have an error when I run the setup.py, stacktrace : https://hasteb.in/ziqeqeta.sql.

I think this might be a problem with my current python version (Python 3.8.1).
What version of python is recommended to run this software ?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.