2011-10-17
12:14:20
昨天想要下载个CS来玩,结果发现好多下载链接都是迅雷的链接的。
心头一阵无名火起,于是想要弄一个迅雷地址的解码器出来。
其实网上已经有好多这样的在线解码网站了,我弄出这个来纯属娱乐。
前段时间在论坛的时候有人发了个非常二的帖子,就是用base64编码的。然后就知道了还有base64这么个好玩的东西。
现在一看迅雷的下载链接,感觉和base64异常的相似。
迅雷的下载链接一般都是thunder://xxxxxxxxxx;后面是一大串形似乱码的东西,其实这个不是乱码,只不过是是用base64加密过的url地址而已。
我抱着试试看的态度,base64 -d了一下,嘿,还真对得起咱这张脸。
出来了个AAhttp://xxxxxZZ形式的链接。
看来迅雷就是在链接的头尾加上了AA和ZZ之后再用base64加密了一下。
既然原理搞清楚了,那么接下来的事情就非常好办了。
同理可破解快车的下载链接。
下面是源码,各位大牛请多指正。
=====================分割线==========================
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
public class ThunderDecoder extends JFrame
{
JPanel
panel_1 = new JPanel();
JButton
decode = new JButton("解码");
JLabel
label_1 = new JLabel("链接地址:(包括thunder://)");
JLabel
label_2 = new JLabel("解码结果:");
JTextField
tf_1 = new JTextField();
JTextField
tf_2 = new JTextField();
String
thunder = "";
String code
= "";
String url =
"";
public
ThunderDecoder()
{
super("迅雷地址解码器");
setSize(400,300);
setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
Container c = getContentPane();
c.setLayout(null);
c.add(panel_1);
panel_1.setBounds(0, 0, 400,300);
panel_1.setLayout(null);
panel_1.add(label_1);
label_1.setBounds(5,5,300,20);
panel_1.add(tf_1);
tf_1.setBounds(5,30,300,20);
tf_1.setEditable(true);
panel_1.add(label_2);
label_2.setBounds(5,80,300,20);
panel_1.add(tf_2);
tf_2.setBounds(5,105,300,20);
tf_2.setEditable(true);
BHandler h = new BHandler();
panel_1.add(decode);
decode.setBounds(100,160,100,30);
decode.addActionListener(h);
setVisible(true);
}
class
BHandler implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
thunder = tf_1.getText();
code = thunder.substring(10);
File f = new File("./temp.txt");
OutputStream out = null;
try
{
out = new FileOutputStream(f);
}
catch(IOException e1)
{
e1.printStackTrace();
}
byte codebyte[] = code.getBytes();
try
{
out.write(codebyte);
}
catch(IOException e2)
{
e2.printStackTrace();
}
String command_1 = "base64 -d ./temp.txt";
try
{
Runtime run = Runtime.getRuntime();
Process p1 = run.exec(command_1);
InputStreamReader ir = new
InputStreamReader(p1.getInputStream());
LineNumberReader input = new LineNumberReader(ir);
String line;
line = input.readLine();
url = line.substring(2,line.length()-2);
tf_2.setText(url);
input.close();
ir.close();
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
}
public
static void main(String args[])
{
ThunderDecoder thd = new ThunderDecoder();
}
}
昨天想要下载个CS来玩,结果发现好多下载链接都是迅雷的链接的。
心头一阵无名火起,于是想要弄一个迅雷地址的解码器出来。
其实网上已经有好多这样的在线解码网站了,我弄出这个来纯属娱乐。
前段时间在论坛的时候有人发了个非常二的帖子,就是用base64编码的。然后就知道了还有base64这么个好玩的东西。
现在一看迅雷的下载链接,感觉和base64异常的相似。
迅雷的下载链接一般都是thunder://xxxxxxxxxx;后面是一大串形似乱码的东西,其实这个不是乱码,只不过是是用base64加密过的url地址而已。
我抱着试试看的态度,base64 -d了一下,嘿,还真对得起咱这张脸。
出来了个AAhttp://xxxxxZZ形式的链接。
看来迅雷就是在链接的头尾加上了AA和ZZ之后再用base64加密了一下。
既然原理搞清楚了,那么接下来的事情就非常好办了。
同理可破解快车的下载链接。
下面是源码,各位大牛请多指正。
=====================分割线==========================
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
public class ThunderDecoder extends JFrame
{
}