crmulliner / ddi

ddi - Dynamic Dalvik Instrumentation Toolkit
http://www.mulliner.org/android/
395 stars 159 forks source link

multithreaded programs with ddi tool #10

Open seoyoonm opened 9 years ago

seoyoonm commented 9 years ago

Hi, I am very impressed the research VirtualSwindle based on ddi tool. :) So, I want to use this tool to see method call. But, when I hook a method with ddi tool, some apps crash with segmentation fault.

I just hooked a method named toString() as the sample code strmon.c. My toy app works well; but some apps crash with segmentation fault. For example, I tried hooking toString() in the application Kakao talk, which is famous messenger app in Korea.

I asked this issue to Collin by mail. He answered it is likely that the function is called by multiple threads. It will lead to a crash. I confirmed that kakaotalk is implemented with threads.

So, my question is how can I make this tool work in multithread environment. Do you have any idea? Can you give me a hint where I should modify the tool?

seoyoonm commented 9 years ago

I want to know the reason why the ddi tool gives segmentation fault in the multithreaded application. Do they race on the library function? But, the application works well with the function( e.x.,toString() ) in java. Then, why the application have segmentation fault not in java method but in library function?