本来是打算看wifi万能钥匙怎么在服务器查密码的,好写个在线版的工具出来,结果发现了这个
public static final boolean a(File paramFile)
{
q localq1 = new q(paramFile.getAbsolutePath(), paramFile, "file");
while (true)
{
q[] arrayOfq;
int k;
int i6;
StringBuilder localStringBuilder1;
try
{
HashMap localHashMap = c();
arrayOfq = new q[] { localq1 };
int j = arrayOfq.length;
k = 0;
m = 0;
if (k >= j)
continue;
q localq3 = arrayOfq[k];
StringBuilder localStringBuilder3 = new StringBuilder();
localStringBuilder3.append("--");
localStringBuilder3.append("---------------------------7da2137580612");
localStringBuilder3.append("\r\n");
localStringBuilder3.append("Content-Disposition: form-data;name=\"" + localq3.e() + "\";filename=\"" + localq3.d() + "\"\r\n");
localStringBuilder3.append("Content-Type: " + localq3.f() + "\r\n\r\n");
localStringBuilder3.append("\r\n");
int i5 = m + localStringBuilder3.length();
if (localq3.b() == null)
continue;
i6 = (int)(i5 + localq3.a().length());
break label946;
i6 = i5 + localq3.c().length;
break label946;
localStringBuilder1 = new StringBuilder();
Iterator localIterator = localHashMap.entrySet().iterator();
if (localIterator.hasNext())
{
Map.Entry localEntry = (Map.Entry)localIterator.next();
localStringBuilder1.append("--");
localStringBuilder1.append("---------------------------7da2137580612");
localStringBuilder1.append("\r\n");
localStringBuilder1.append("Content-Disposition: form-data; name=\"" + (String)localEntry.getKey() + "\"\r\n\r\n");
localStringBuilder1.append((String)localEntry.getValue());
localStringBuilder1.append("\r\n");
continue;
}
}
catch (Exception localException)
{
new StringBuilder("Error while uploadCrashLog:").append(localException.getMessage()).toString();
i = 0;
return i;
}
int n = m + localStringBuilder1.toString().getBytes().length + "-----------------------------7da2137580612--\r\n".getBytes().length;
URL localURL = new URL("http://wifi01.51y5.com/app2/upcrash.php");
int i1;
if (localURL.getPort() == -1)
i1 = 80;
Socket localSocket;
OutputStream localOutputStream;
int i3;
q localq2;
while (true)
{
localSocket = new Socket(InetAddress.getByName(localURL.getHost()), i1);
localOutputStream = localSocket.getOutputStream();
localOutputStream.write(("POST " + localURL.getPath() + " HTTP/1.1\r\n").getBytes());
localOutputStream.write("Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap, application/x-ms-application, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*\r\n".getBytes());
localOutputStream.write("Accept-Language: zh-CN\r\n".getBytes());
localOutputStream.write("Content-Type: multipart/form-data; boundary=---------------------------7da2137580612\r\n".getBytes());
localOutputStream.write(("Content-Length: " + n + "\r\n").getBytes());
localOutputStream.write("Connection: Keep-Alive\r\n".getBytes());
localOutputStream.write(("Host: " + localURL.getHost() + ":" + i1 + "\r\n").getBytes());
localOutputStream.write("\r\n".getBytes());
localOutputStream.write(localStringBuilder1.toString().getBytes());
int i2 = arrayOfq.length;
i3 = 0;
if (i3 >= i2)
break label868;
localq2 = arrayOfq[i3];
StringBuilder localStringBuilder2 = new StringBuilder();
localStringBuilder2.append("--");
localStringBuilder2.append("---------------------------7da2137580612");
localStringBuilder2.append("\r\n");
localStringBuilder2.append("Content-Disposition: form-data;name=\"" + localq2.e() + "\";filename=\"" + localq2.d() + "\"\r\n");
localStringBuilder2.append("Content-Type: " + localq2.f() + "\r\n\r\n");
localOutputStream.write(localStringBuilder2.toString().getBytes());
if (localq2.b() == null)
break;
byte[] arrayOfByte = new byte[1024];
while (true)
{
int i4 = localq2.b().read(arrayOfByte, 0, 1024);
if (i4 != -1)
{
localOutputStream.write(arrayOfByte, 0, i4);
continue;
i1 = localURL.getPort();
break;
}
}
localq2.b().close();
}
while (true)
{
localOutputStream.write("\r\n".getBytes());
i3++;
break;
localOutputStream.write(localq2.c(), 0, localq2.c().length);
}
label868: localOutputStream.write("-----------------------------7da2137580612--\r\n".getBytes());
BufferedReader localBufferedReader = new BufferedReader(new InputStreamReader(localSocket.getInputStream()));
if (localBufferedReader.readLine().indexOf("200") == -1)
{
i = 0;
continue;
}
localOutputStream.flush();
localOutputStream.close();
localBufferedReader.close();
localSocket.close();
int i = 1;
continue;
label946: k++;
int m = i6;
}
}
其余代码还没看,不过奇怪的是这里面怎么有上传文件的代码

近期评论