Comments (7)
it is a bit strange that class aa
is a child class of a final
class ab
. as in JAVA, extends a final class is not allowed.
Could you please provide the following information:
- what version of dex2jar are you using ?
- please attach the error log if possible.
- please attach the 3 class files (ab.class, aa.class and Decrypt.class) (attach here or send to [email protected])
from dex2jar.
I have tried the following code
package res.decrypttest;
public class Decrypt extends aa {
public static String a = Decrypt.dec("1233asdxcdjdn");
}
class aa extends ab {
}
class ab {
public static String dec(String str) {
return new StringBuffer(str).reverse().toString();
}
}
by running d2j-decrypt-string.sh -mo res.decrypttest.Decrypt -mn dec x.jar -f
, the output is
x.jar -> x-decrypted.jar
java.lang.NoSuchMethodException: res.decrypttest.Decrypt.dec(java.lang.String)
at java.lang.Class.getDeclaredMethod(Class.java:2017)
at com.googlecode.dex2jar.tools.DecryptStringCmd.findAnyMethodMatch(DecryptStringCmd.java:852)
at com.googlecode.dex2jar.tools.DecryptStringCmd.loadMethods(DecryptStringCmd.java:765)
at com.googlecode.dex2jar.tools.DecryptStringCmd.doCommandLine(DecryptStringCmd.java:186)
at com.googlecode.dex2jar.tools.BaseCmd.doMain(BaseCmd.java:290)
at com.googlecode.dex2jar.tools.DecryptStringCmd.main(DecryptStringCmd.java:49)
java.lang.NoSuchMethodException: res.decrypttest.aa.dec(java.lang.String)
at java.lang.Class.getDeclaredMethod(Class.java:2017)
at com.googlecode.dex2jar.tools.DecryptStringCmd.findAnyMethodMatch(DecryptStringCmd.java:852)
at com.googlecode.dex2jar.tools.DecryptStringCmd.findAnyMethodMatch(DecryptStringCmd.java:861)
at com.googlecode.dex2jar.tools.DecryptStringCmd.loadMethods(DecryptStringCmd.java:765)
at com.googlecode.dex2jar.tools.DecryptStringCmd.doCommandLine(DecryptStringCmd.java:186)
at com.googlecode.dex2jar.tools.BaseCmd.doMain(BaseCmd.java:290)
at com.googlecode.dex2jar.tools.DecryptStringCmd.main(DecryptStringCmd.java:49)
two exception stack are printed, but there can be ignored. the finally method ab.dec(String str)
is found on the last. the output is genearted, the following java source is decompiled from the Decrypt.class
package res.decrypttest;
public class Decrypt extends aa
{
public static String a;
static {
Decrypt.a = "ndjdcxdsa3321";
}
}
I will try to mute the exception stack if the method is finally found on next release
from dex2jar.
Yes, the log is NoSuchMethodException but when I test decrypted output there is no string decoded.
I try press build your lastest fix mute exception stack but the build failed. Here is the build log:
https://s3.amazonaws.com/archive.travis-ci.org/jobs/103067410/log.txt
I don't know what is wrong with online build in github?!
from dex2jar.
I have temp disabled the 3 failling test cases f548b03,
now the CI build is successfull.
If you want the output file, you have to build locally by ./gradlew distZip
,
you can find the output here dex-tools/build/distributions/dex-tools-2.1-SNAPSHOT.zip
from dex2jar.
Hi, I built lastest source dex2jar with gradle-2.10 -> the process is successful but I can't build with apache-maven-3.3.9 (error occurs). I don't know why?
Let's back to main issue:
- Question No 1:
Here is orginal jar: http://skypeaful.xtgem.com/reversing/dragon_and_dracula_orginal.jar
The lib: http://skypeaful.xtgem.com/reversing/javax.lib.jar
I run this command in lastest fix of you:d2j-decrypt-string -mo com.herocraft.sdk.j -mn r dragon_and_dracula_orginal.jar -cp javax.lib.jar
The dragon_and_dracula-decrypted.jar is still encrypted strings. You can use jd-gui then open 4 classes (i, j, k, n) in com\herocraft\sdk to check.
I have to open each class, find and change bytecode:
invokestatic java.lang.String com.herocraft.sdk.i.r(java.lang.String)
com.herocraft.sdk.k.r(java.lang.String)
com.herocraft.sdk.n.r(java.lang.String)
to
invokestatic java.lang.String com.herocraft.sdk.j.r(java.lang.String)
to force d2j-decrypt-string correct.
Here is mod file: http://skypeaful.xtgem.com/reversing/dragon_and_dracula_modbytecode.jar
Please fix d2j-decrypt-string for this case because doing manual bytecode take alot time and not work for some biggest class because out of memory.
- Question No 2:
Example I have 2 class: Decrypt and aa
Decrypt.java
public class Decrypt extends aa
{
public static String a;
static {
Decrypt.a = Decrypt.b("123","485",1);
}
}
aa.java
public class aa
{
static String b(String string1, String string2, boolean Bool)
{
// some code here
String str1 = null;
return str1;
}
}
Can you guide me how to emulate (string, string, boolean) for d2j-decrypt-string?
Thank :)
Please help me! I am looking for your answer day by day.
from dex2jar.
For Q1,
it is not necessary to modify the bytecode, you can mark all the three methods as decrypt method, because d2j-decrypt-string.sh
support decrypt multiple methods at once
-m,--methods <cfg> a file contain a list of methods, each lin
e like: La/b;->decrypt(III)Ljava/lang/Stri
ng;
here is the command line I have used to decrypt strings on your case
d2j-decrypt-string.sh -m config.txt dragon_and_dracula_orginal.jar -cp javax.lib.jar -f
while the content of config.txt is
Lcom/herocraft/sdk/j;->r(Ljava/lang/String;)Ljava/lang/String;
Lcom/herocraft/sdk/i;->r(Ljava/lang/String;)Ljava/lang/String;
Lcom/herocraft/sdk/k;->r(Ljava/lang/String;)Ljava/lang/String;
Lcom/herocraft/sdk/n;->r(Ljava/lang/String;)Ljava/lang/String;
Lcom/herocraft/sdk/j;->b(Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/String;
For Q2,
It is ok to emulate a method with complex arguments, as mentioned by the wiki https://github.com/pxb1988/dex2jar/wiki/DecryptStrings, the following to arguments on d2j-decrypt-string.sh
can be used
-pd,--parameters-descriptor <type> the descriptor for the method which can de
crypt the stings, example1: Ljava/lang/Str
ing; example2: III, default is Ljava/lang/
String;
-t,--arg-types <type> comma-separated list of types:boolean,byte
,short,char,int,long,float,double,string.
Default is string
if you want decrypt the aa.b(String,String,boolean)
method, you can either use
d2j-decrypt-string -mo aa -mn b --arg-types string,string,boolean in.jar
or
d2j-decrypt-string -mo aa -mn b --parameters-descriptor 'Ljava/lang/String;Ljava/lang/String;Z' in.jar
or
echo 'Laa;->b(Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/String;' > config.txt
d2j-decrypt-string --methods config.txt in.jar
And I have update the code to add -v,--verbose
argument to print more information.
two invocation are fail to decrypt due to
error 1
java.lang.NullPointerException
at com.herocraft.sdk.j.d(Unknown Source)
at com.herocraft.sdk.j.b(Unknown Source)
error 2
java.lang.NoClassDefFoundError: com/sun/midp/rms/RecordStoreFile
at javax.microedition.rms.RecordStore.openRecordStore(Unknown Source)
at com.herocraft.sdk.j.u(Unknown Source)
at com.herocraft.sdk.j.r(Unknown Source)
you have to fix these two error by yourself
from dex2jar.
Thank for your guide. Everything is working fine now :)
from dex2jar.
Related Issues (20)
- GLITCH: 0003 LBuilder;.testDeadEndTry(I)I | not enough space for reading instruction HOT 2
- READ THIS **BEFORE** CREATING ISSUES!
- java.lang.NullPointerException HOT 1
- Build failing: trying to load from wrong JRE... HOT 1
- com.googlecode.d2j.DexException: fail convert code for
- java.lang.ClassCastException: class com.googlecode.dex2jar.ir.expr.InvokePolymorphicExpr cannot be cast to class com.googlecode.dex2jar.ir.expr.InvokeExpr (com.googlecode.dex2jar.ir.expr.InvokePolymorphicExpr and com.googlecode.dex2jar.ir.expr.InvokeExpr are in unnamed module of loader 'app') HOT 1
- READ THIS **BEFORE** CREATING ISSUES!
- Detail Error Information in File .\jioJoin-error.zip Please report this file HOT 3
- Dex2Jar issue A13 HOT 2
- READ THIS **BEFORE** CREATING ISSUES! HOT 1
- Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded HOT 1
- jar2dex min sdk version issue HOT 4
- decompile wechat8.0.32 error HOT 1
- E:\resources\classes2.dex
- IndexOutOfBoundsException had happened in using dex-tools-v2.4 tool to decode jar package HOT 1
- java.lang.RuntimeException: fail exe a8 = a3 HOT 1
- error on decompiling HOT 1
- Detail Error Information in File .\00O000ll111l_0-error.zip HOT 1
- 变异过程中遇到的错误 HOT 1
- Method too large during exception HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dex2jar.