首页
社区
课程
招聘
[旧帖] 求助,一个电子书阅读器的反向编译 0.00雪花
发表于: 2014-12-7 11:59 7587

[旧帖] 求助,一个电子书阅读器的反向编译 0.00雪花

2014-12-7 11:59
7587
udn读书吧的加密pdf和epub,都无法通过常规的pdf、epub阅读器来打开,只能试着自己破解,但是小弟是菜鸟,根本不懂java和编程啊。
在看了一个大大的博客文章后,找了好久,

看到下面这个 解密的jad文件    Decrypter.jad

// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3)

package com.udn.bookreader.security;

import CipherClass.*;

public class Decrypter
{

    public Decrypter()
    {
    }

    public boolean decrypt(String s, String s1, String s2)
    {
        try
        {
            CipherClass.decrypt.decryptPdf(s1, s, s2);
        }
        catch(Exception exception)
        {
            exception.printStackTrace();
            return false;
        }
        return true;
    }

    public String decryptXRML(String s, String s1)
    {
        byte abyte0[] = Base64.decode(s);
        Cipher cipher = new Cipher(s1);
        try
        {
            xrml = new String(cipher.decryptXRML(abyte0), "UTF-8");
        }
        catch(Exception exception)
        {
            exception.printStackTrace();
        }
        return xrml;
    }

    private String xrml;
}

就是无法再继续下去了。 求教这种加密的pdf和epub如何破解,可否提供一种思路给小弟呢。? 感激不尽。从台湾udn网买了一本电子书,两种格式epub和pdf,都是加密的,非drm加密,必须用它的客户端才能看,求如何破解,无法用adobe打开 pdf,epub更是无法打开,不懂代码和编程。我把书上传到这里了。 http://ge.tt/8gTD0P62  求达人指点一二~

[课程]Linux pwn 探索篇!

收藏
免费 0
支持
分享
最新回复 (18)
雪    币: 438
活跃值: (178)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
byte abyte0[] = Base64.decode(s);
Cipher cipher = new Cipher(s1);
try
{
xrml = new String(cipher.decryptXRML(abyte0), "UTF-8");
base64加密 utf_8编码格式
2014-12-7 12:17
0
雪    币: 438
活跃值: (178)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
byte abyte0[] = Base64.decode(s);

Cipher cipher = new Cipher(s1);

try

{

xrml = new String(cipher.decryptXRML(abyte0), "UTF-8");
base64加密 utf_8编码格式
你的文件不能下载,请从传
2014-12-7 12:18
0
雪    币: 180
活跃值: (11)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
[QUOTE=qqsunqiang;1336313]byte abyte0[] = Base64.decode(s);

Cipher cipher = new Cipher(s1);

try

{

xrml = new String(cipher.decryptXRML(abyte0), "UTF-8");
base64加密 ...[/QUOTE]

感谢回复,已上传到快传, 其中22.jar是对apk反向编译生成的jar文件,反向编译用的是dex2jar,我也附上了udn读书吧的apk安装包,以及电子书pdf和epub  http://kuai.xunlei.com/d/400lAH-.GNeDVAQA85b
2014-12-7 12:28
0
雪    币: 180
活跃值: (11)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
这种pdf 用base64加密,解密的基本思路是怎样呢? 是不是比当当的加密方式还要简单些?
2014-12-7 12:43
0
雪    币: 438
活跃值: (178)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
6
将42380.epub文件改为.zip打开里面html文件base64加密
2014-12-7 13:16
0
雪    币: 438
活跃值: (178)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
7
pdf不一定你把阅读程序发过来。你的反编译文章没有decryptPdf方法
2014-12-7 13:20
0
雪    币: 438
活跃值: (178)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
8
我用手机发的,你用百度网盘分享吧。
2014-12-7 13:33
0
雪    币: 180
活跃值: (11)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
9
还有个cipher.jad

里面的内容是:
// Decompiled by DJ v3.12.12.98 Copyright 2014 Atanas Neshkov  Date: 2014/12/7 1:09:54
// Home Page: http://www.neshkov.com/dj.html - Check often for new version!
// Decompiler options: packimports(3)

package CipherClass;

import java.io.*;
import org.apache.commons.codec.digest.DigestUtils;
import org.bouncycastle.crypto.BufferedBlockCipher;
import org.bouncycastle.crypto.engines.AESFastEngine;
import org.bouncycastle.crypto.modes.CBCBlockCipher;
import org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher;
import org.bouncycastle.crypto.params.KeyParameter;

public class Cipher
{

    public Cipher(String s)
    {
        password = s;
    }

    private void transform(boolean flag, String s, String s1)
        throws Exception
    {
        byte abyte0[] = DigestUtils.md5(password.getBytes("UTF-8"));
        PaddedBufferedBlockCipher paddedbufferedblockcipher = new PaddedBufferedBlockCipher(new CBCBlockCipher(new AESFastEngine()));
        paddedbufferedblockcipher.init(flag, new KeyParameter(abyte0));
        FileInputStream fileinputstream = new FileInputStream(new File(s));
        byte abyte1[] = new byte[0x100000];
        byte abyte2[] = new byte[paddedbufferedblockcipher.getOutputSize(abyte1.length)];
        FileOutputStream fileoutputstream = new FileOutputStream(s1);
        do
        {
            int j;
            do
            {
                int i = fileinputstream.read(abyte1);
                if(i == -1)
                {
                    int k = paddedbufferedblockcipher.doFinal(abyte2, 0);
                    if(k > 0)
                        fileoutputstream.write(abyte2, 0, k);
                    fileinputstream.close();
                    fileoutputstream.close();
                    return;
                }
                j = paddedbufferedblockcipher.processBytes(abyte1, 0, i, abyte2, 0);
            } while(j <= 0);
            fileoutputstream.write(abyte2, 0, j);
        } while(true);
    }

    private byte[] transformXRML(boolean flag, byte abyte0[])
        throws Exception
    {
        byte abyte1[] = DigestUtils.md5(password.getBytes("UTF-8"));
        PaddedBufferedBlockCipher paddedbufferedblockcipher = new PaddedBufferedBlockCipher(new CBCBlockCipher(new AESFastEngine()));
        paddedbufferedblockcipher.init(flag, new KeyParameter(abyte1));
        ByteArrayInputStream bytearrayinputstream = new ByteArrayInputStream(abyte0);
        ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
        byte abyte2[] = new byte[1024];
        byte abyte3[] = new byte[paddedbufferedblockcipher.getOutputSize(abyte2.length)];
        do
        {
            int j;
            do
            {
                int i = bytearrayinputstream.read(abyte2);
                if(i <= -1)
                {
                    int k = paddedbufferedblockcipher.doFinal(abyte3, 0);
                    if(k > 0)
                        bytearrayoutputstream.write(abyte3, 0, k);
                    return bytearrayoutputstream.toByteArray();
                }
                j = paddedbufferedblockcipher.processBytes(abyte2, 0, i, abyte3, 0);
            } while(j <= 0);
            bytearrayoutputstream.write(abyte3, 0, j);
        } while(true);
    }

    public void decrypt(String s, String s1)
        throws Exception
    {
        transform(false, s, s1);
    }

    public byte[] decryptXRML(byte abyte0[])
        throws Exception
    {
        return transformXRML(false, abyte0);
    }

    public void encrypt(String s, String s1)
        throws Exception
    {
        transform(true, s, s1);
    }

    private final String password;
}
2014-12-7 14:36
0
雪    币: 180
活跃值: (11)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
10
http://pan.baidu.com/s/1ntLtmDb 已上传! 多谢!
2014-12-7 14:37
0
雪    币: 180
活跃值: (11)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
11
书的目录下还有个license.txt 的文件,里面是base64加密过的内容。  反编译的jar里面有个 bouncycastle 的文件夹,是不是也用了这个算法库?
2014-12-7 14:39
0
雪    币: 438
活跃值: (178)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
12
password是密码储存有没有这个CipherClass类
2014-12-7 16:03
0
雪    币: 438
活跃值: (178)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
13
BouncyCastle是一个开源的加解密
2014-12-7 16:05
0
雪    币: 438
活跃值: (178)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
14
aes加密
2014-12-7 16:07
0
雪    币: 180
活跃值: (11)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
15
请问高手研究的咋样啦~
2014-12-8 11:04
0
雪    币: 42
活跃值: (70)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
16
这高手不在这的
2014-12-10 11:33
0
雪    币: 180
活跃值: (11)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
17
求指点迷津,真的喜欢这本书~ 花了165新台币刷信用卡刷的~
2014-12-13 16:31
0
雪    币: 438
活跃值: (178)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
18
在线不,快啊。
2014-12-31 13:38
0
雪    币: 438
活跃值: (178)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
19
你的看书软件密码。
2014-12-31 13:52
0
游客
登录 | 注册 方可回帖
返回
//