Simple Android virus analysis and its effects

Source: Internet
Author: User

Today in the group to see everyone sent a link, a virus display way, quite fun, Imitation wrote the next.


http://mt.sohu.com/20150517/n413220620.shtml?qq-pf-to=pcqq.c2c





This realization is not very difficult, mainly is the idea above can understand is very simple.


Depending on the text, we can directly consider how to assign a value to TextView in Android.


Textview.settext (charsequence)


This method enables the assignment of the text to be displayed, so the substrate framework is used to simply write the next hook script.


<span style= "FONT-SIZE:18PX;" >public class Main {public static void Initialize () {ms.hookclassload ("Android.widget.TextView", New MS.  Classloadhook () {@Overridepublic void classloaded (class<?> arg0) {//TODO auto-generated method Stubmethod smstest  try {smstest=arg0.getmethod ("SetText", Charsequence.class),} catch (SecurityException e) {//TODO auto-generated catch Blocksmstest=null;e.printstacktrace ();} catch (Nosuchmethodexception e) {//TODO auto-generated catch block Smstest=null;e.printstacktrace ();} if (smstest!=null) {final MS. Methodpointer old = new MS. Methodpointer (); Ms.hookmethod (arg0, Smstest, new MS. Methodhook () {@Overridepublic object invoked (object arg0, Object ... arg1) throws Throwable {//TODO auto-generated method s TUBLOG.D ("Ggz", "I am hook in------->"); String bb= (String) arg1[0]; LOG.D ("Ggz", "string is----->" +bb); bb= "Love Hack, Love ghost brother";   LOG.D ("Ggz", "now string is--->" +bb); return Old.invoke (arg0, BB); }}, old);    }}      }); }}</span> 



Then we run to look at our defined log log:




The logs are displayed properly, so we'll look at the phone:






All right, it's the same as the viral pattern.


If the virus to do, you can directly through the custom hook way to achieve, do not rely on these open injection framework such as Xposed,cydia substrate, can be written by the injection framework can also be very convenient to implement this principle.


about how hooks are used, my blog also has a brief introduction of Cydia substrate from the beginning of teaching, we are interested to see.


This article is for research purposes only and should not be used illegally.


Simple Android virus analysis and its effects

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.