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.