2

I want to trace Android Telegram app(open-source) to learn its protocol.

From the source code these two functions AES_set_encrypt_key and AES_ctr128_encrypt are used to do the encryption, and I can verify that these two functions are called when sending packets because the frida-trace can log and print the call:

frida-trace -U -i AES_ctr128_encrypt -i AES_set_encrypt_key org.telegram.messenger.

So I try to hook them and print the parameters:

// telegram.js

Java.perform(function () {
    console.log('tg loaded');

    Interceptor.attach(Module.findExportByName ('libcrypto.so', 'AES_set_encrypt_key'), {
        onEnter: function(args) {
            console.log('enter 1');
        },
        onLeave: function (retval) {
        }
    });
    Interceptor.attach(Module.findExportByName ('libcrypto.so', "AES_ctr128_encrypt"), {
        onEnter: function(args) {
            console.log('enter 2');
        },
        onLeave: function (retval) {
        }
    });
});

And use this telegram.js like: frida -U -l telegram.js org.telegram.messenger

But the hook to onEnter is never called.

1
  • Can you share a link to the application? Commented Dec 15, 2018 at 23:32

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.