Simple android virus analysis and implementation, android virus implementation

Source: Internet
Author: User

Simple android virus analysis and implementation, android virus implementation

Today, I saw a link from everyone in the group. The display method of a virus is fun. I copied it.


Http://mt.sohu.com/20150517/n413220620.shtml? Qq-pf-to = pcqq. C2C





This implementation is not very difficult. The main idea is that it is very easy to understand above.


Based on the changes, we can directly consider how to assign values to TextView in android.


TextView. setText (CharSequence)


This method can assign values to the displayed text. Therefore, the substrate framework is used to write the 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 stubLog. d ("ggz", "I am hook in ------->"); String bb = (String) arg1 [0]; Log. d ("ggz", "string is ----->" + bb); bb = "Love to crack, love ghost Brother"; Log. d ("ggz", "now string is --->" + bb); return old. invoke (arg0, bb) ;}}, old) ;}}}}</span>



Then we run the command to view the defined Log:




The log is normally displayed, so let's take a look at the mobile phone's:






Okay, it's exactly the same as the virus style.


If the virus is used, it can be implemented directly through the custom hook method, without relying on these public injection frameworks such as Xposed, Cydia Substrate, this principle can be easily implemented through the self-compiled injection framework.


About how to use hook, my blog also provides a brief introduction to Cydia Substrate from the ground up. If you are interested, you can refer to it.


This article is only for research purposes. Do not use it for illegal purposes.


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.