在学习aspose这个插件的时候,发现java版本的pdf的资料真的很少,破解版也基本找不到,没得办法只能自己来。
使用到的工具可以参考我上一篇破解word的那个文章。
直入主题,首先我们通过JByteMod找到License.class
很不幸的是我这里打开看到的已经报错根本看不到源码。
就很绝望,根本就看不到任何信息,但是我们不能放弃呀,艺高人胆大,直接调用jar包运行签名,看看到底是那个类确切实现了签名
就抓到z123这个小可爱啦!!!
打得开,很好,于是开始找到底是哪里开始验证的,找到m1这个验证方法,为什么确定他是呢?因为The signature is invalid这句话,验证无效就直接跳出了!!!(我也是靠猜的,哈哈哈哈哈)
于是跳过验证就好啦,此处用到javassist工具类(不清楚的可以看看破解word那个文章哦,这里就不多说啦)
然后替换z123.class这个类
到这里破解就结束啦,附上使用代码
public static void pdftoimag(String inPath, String outPath) {
if (!getpdfLicense()) { // 验证License 若不验证则转化出的会有水印产生
return;
}
try {
com.aspose.pdf.Document doc1 = new com.aspose.pdf.Document(inPath); // inPath是将要被转化的文档
for (int i = 1; i <= doc1.getPages().size(); i++) {
String aa = "D://test//" + outPath + "_" + i + ".png";
File file = new File(aa); // 新建一个文件
FileOutputStream os;
os = new FileOutputStream(file);
com.aspose.pdf.devices.Resolution reso = new com.aspose.pdf.devices.Resolution(
200);
com.aspose.pdf.devices.JpegDevice jpegDevice = new com.aspose.pdf.devices.JpegDevice(
reso, 100);
jpegDevice.process(doc1.getPages().get_Item(i), os);
}
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
附上验证代码(签名可以随便写,因为跳过验证了,但是不写又不行,真是麻烦)
public static boolean getpdfLicense() {
boolean result2 = false;
try {
String license2 = "<License>\n"
+ " <Data>\n"
+ " <Products>\n"
+ " <Product>Aspose.Total for Java</Product>\n"
+ " <Product>Aspose.Words for Java</Product>\n"
+ " </Products>\n"
+ " <EditionType>Enterprise</EditionType>\n"
+ " <SubscriptionExpiry>20991231</SubscriptionExpiry>\n"
+ " <LicenseExpiry>20991231</LicenseExpiry>\n"
+ " <SerialNumber>8bfe198c-7f0c-4ef8-8ff0-acc3237bf0d7</SerialNumber>\n"
+ " </Data>\n"
+ " <Signature>111</Signature>\n"
+ "</License>";
InputStream is2 = new ByteArrayInputStream(
license2.getBytes("UTF-8"));
com.aspose.pdf.License asposeLic2 = new com.aspose.pdf.License();
asposeLic2.setLicense(is2);
result2 = true;
} catch (Exception e) {
e.printStackTrace();
}
return result2;
}
附上结果:
pdf破解版:https://download.csdn.net/download/qq_42834405/11484648
word破解版:https://download.csdn.net/download/qq_42834405/11463812
此方法仅供学习,绝对绝对不能用于商业用途哦!!!发生任何纠纷与本人无关