日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

无废话aspose-words-18.6 java版破解

發(fā)布時(shí)間:2023/12/9 编程问答 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 无废话aspose-words-18.6 java版破解 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

用到的工具:

JByteMod、javassist 可在文章最下方下載


下載原版aspose-words-18.6-jdk16.jar

使用執(zhí)行JByteMod-1.8.0.jar反編譯其源碼查看其注冊文件的加載類

??? package com.aspose.words;
??? ?
??? import asposewobfuscated.*;
??? import java.io.*;
??? ?
??? public class License
??? {
??????? @Deprecated
??????? public boolean getIsLicensed() {
??????????? return zzZLX.zzZJT() == 1;
??????? }
?????? ?
??????? public boolean isLicensed() {
??????????? return zzZLX.zzZJT() == 1;
??????? }
?????? ?
??????? public void setLicense(final String licenseName) throws Exception {
??????????? if (licenseName == null) {
??????????????? throw new NullPointerException("licenseName");
??????????? }
??????????? new zzZLX().zzY(licenseName, zz2W.zzA3());
??????? }
?????? ?
??????? public void setLicense(final InputStream stream) throws Exception {
??????????? if (stream == null) {
??????????????? throw new NullPointerException("stream");
??????????? }
??????????? new zzZLX().zzX(stream);
??????? }
??? }

可見主要的處理類為zzZLX,反編譯后找到關(guān)鍵代碼如下

??????? private static void zzZ(final Node node, final Node node2) throws Exception {
??????????? byte[] bytes;
??????????? if (node != null) {
??????????????? final StringBuilder sb;
??????????????? zzZ(sb = new StringBuilder(), node);
??????????????? bytes = sb.toString().getBytes("UTF-16LE");
??????????? }
??????????? else {
??????????????? bytes = new byte[0];
??????????? }
??????????? byte[] decode;
??????????? if (node2 != null) {
??????????????? decode = zz35.decode(node2.getFirstChild().getNodeValue());
??????????? }
??????????? else {
??????????????? decode = new byte[0];
??????????? }
??????????? final Signature instance = Signature.getInstance("SHA1withRSA");
??????????? instance.initVerify(KeyFactory.getInstance("RSA").generatePublic(new RSAPublicKeySpec(new BigInteger(1, zzZg(zz35.decode("0nRuwNEddXwLfXB7pw66G71MS93gW8mNzJ7vuh3Sf4VAEOBfpxtHLCotymv1PoeukxYe31K441Ivq0Pkvx1yZZG4O1KCv3Omdbs7uqzUB4xXHlOub4VsTODzDJ5MWHqlRCB1HHcGjlyT2sVGiovLt0Grvqw5+QXBuinoBY0suX0="))), new BigInteger(1, zzZg(zz35.decode("AQAB"))))));
??????????? instance.update(bytes);
??????????? if (!instance.verify(decode)) {
??????????????? throw new IllegalStateException("The signature is invalid.");
??????????? }
??????? }

可見這是使用rsa加密驗(yàn)證許可證的合法性,只需要屏蔽驗(yàn)證過程許可證即有效,使用javassist進(jìn)行代碼修改:

?? ??? ?public static void changeMethod() throws Exception {
?? ??? ??? ?ClassPool.getDefault().insertClassPath(
?? ??? ??? ??? ??? ?"D:/aspose-words-18.6-jdk16.jar");
?? ??? ??? ?CtClass c2 = ClassPool.getDefault()
?? ??? ??? ??? ??? ?.getCtClass("com.aspose.words.zzZLX");
?? ??? ??? ?CtMethod[] ms = c2.getDeclaredMethods();
?? ??? ??? ?for (CtMethod c : ms) {
?? ??? ??? ??? ?System.out.println(c.getName());
?? ??? ??? ??? ?CtClass[] ps = c.getParameterTypes();
?? ??? ??? ??? ?for (CtClass cx : ps) {
?? ??? ??? ??? ??? ?System.out.println("\t" + cx.getName());
?? ??? ??? ??? ?}
??? ?
?? ??? ??? ??? ?if (c.getName().equals("zzZ") && ps.length == 2
?? ??? ??? ??? ??? ??? ?&& ps[0].getName().equals("org.w3c.dom.Node")
?? ??? ??? ??? ??? ??? ?&& ps[1].getName().equals("org.w3c.dom.Node")) {
?? ??? ??? ??? ??? ?System.out.println("find it!");
?? ??? ??? ??? ??? ?c.insertBefore("{return;}");
?? ??? ??? ??? ?}
??? ?
?? ??? ??? ?}
?? ??? ??? ?c2.writeFile();
??? ?
?? ??? ?}

以上可生成zzZLX.class文件,放入jar文件中替換,為防止文件指紋校驗(yàn),刪除jar文件中的META-INF文件夾

下面生成一個(gè)許可文件com.aspose.words.lic_2999.xml:

??? <License>
????? <Data>
??????? <Products>
????????? <Product>Aspose.Words for Java</Product>
??????? </Products>
??????? <EditionType>Enterprise</EditionType>
??????? <SubscriptionExpiry>29991231</SubscriptionExpiry>
??????? <LicenseExpiry>29991231</LicenseExpiry>
??????? <SerialNumber>---</SerialNumber>
????? </Data>
????? <Signature>---</Signature>
??? </License>

為方便使用,我將此文件放入了jar文件根目錄下

以下為使用代碼,Enjoy it:)

??? package test_fileconvert;
??? ?
??? import java.io.File;
??? import java.io.FileOutputStream;
??? import java.io.InputStream;
??? ?
??? import com.aspose.words.Document;
??? import com.aspose.words.License;
??? import com.aspose.words.SaveFormat;
??? ?
??? public class Doc2Pdf {
??? ?
?? ??? ?public static void main(String[] args) throws Exception {
?? ??? ??? ?doc2pdf("e:/pjtemp/f_new.docx", "e:/pjtemp/f_new.pdf");
?? ??? ?}
??? ?
?? ??? ?public static boolean getLicense() throws Exception {
?? ??? ??? ?boolean result = false;
?? ??? ??? ?try {
??? ?
?? ??? ??? ??? ?InputStream is = com.aspose.words.Document.class
?? ??? ??? ??? ??? ??? ?.getResourceAsStream("/com.aspose.words.lic_2999.xml");
?? ??? ??? ??? ?License aposeLic = new License();
?? ??? ??? ??? ?aposeLic.setLicense(is);
?? ??? ??? ??? ?result = true;
?? ??? ??? ??? ?is.close();
?? ??? ??? ?} catch (Exception e) {
?? ??? ??? ??? ?e.printStackTrace();
?? ??? ??? ??? ?throw e;
?? ??? ??? ?}
?? ??? ??? ?return result;
?? ??? ?}
??? ?
?? ??? ?public static void doc2pdf(String inPath, String outPath) throws Exception {
?? ??? ??? ?if (!getLicense()) { // 驗(yàn)證License 若不驗(yàn)證則轉(zhuǎn)化出的pdf文檔有水印
?? ??? ??? ??? ?throw new Exception("com.aspose.words lic ERROR!");
?? ??? ??? ?}
??? ?
?? ??? ??? ?System.out.println(inPath + " -> " + outPath);
??? ?
?? ??? ??? ?try {
?? ??? ??? ??? ?long old = System.currentTimeMillis();
?? ??? ??? ??? ?File file = new File(outPath);
?? ??? ??? ??? ?FileOutputStream os = new FileOutputStream(file);
?? ??? ??? ??? ?Document doc = new Document(inPath); // word文檔
?? ??? ??? ??? ?// 支持RTF HTML,OpenDocument, PDF,EPUB, XPS轉(zhuǎn)換
?? ??? ??? ??? ?doc.save(os, SaveFormat.PDF);
?? ??? ??? ??? ?long now = System.currentTimeMillis();
?? ??? ??? ??? ?System.out.println("convert OK! " + ((now - old) / 1000.0) + "秒");
?? ??? ??? ?} catch (Exception e) {
?? ??? ??? ??? ?e.printStackTrace();
?? ??? ??? ?}
?? ??? ?}
??? }

注意:此教程及下載文件只允許學(xué)習(xí)使用,不得用于商業(yè)用途,請購買授權(quán)正版 aspose官網(wǎng)。

--------------------------------------------------------------------------------------------------

下載:

aspose-words-18.6-jdk16-crack.jar

JByteMod-Beta-master編譯版

jboss-javassist-javassist-rel_3_23_0_ga ?
--------------------- ?
作者:shadowkiss ?
來源:CSDN ?
原文:https://blog.csdn.net/shadowkiss/article/details/80868472 ?
版權(quán)聲明:本文為博主原創(chuàng)文章,轉(zhuǎn)載請附上博文鏈接!

總結(jié)

以上是生活随笔為你收集整理的无废话aspose-words-18.6 java版破解的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。