Recaf icon indicating copy to clipboard operation
Recaf copied to clipboard

Unable to parse the class

Open MizzMaster opened this issue 3 years ago • 7 comments

Describe the bug

I was working on a deobfuscated jar file, It was originally obfuscated by Radon and then deobfuscated by java-deobfuscator. I found a class that ASM probably couldn't parse it so it was showing as a file rather than a class. After I passed the jar through the Threadtear, the class became visible as a normal class in Recaf

To Reproduce

  1. Open the class that has NOT passed through Threadtear in Recaf (and see it shows as a file)
  2. Open the class that has passed through Threadtear in Recaf (and see it shows as a class)

(Even if the other ones in the jar are deobfuscated successfully, this class remains obfuscated , probably java-deobfuscator couldn't parse it, too)

I don't know what the cause is, but i guess it is because ASM-crashing junk data. I know that kinda stuff should be handled by the deobfuscators not Recaf, but like a bug I found earlier (junk data causing renaming to fail), it is better to make it handle, in my opinion.

MizzMaster avatar Nov 28 '21 21:11 MizzMaster

Seems to be a JPhantom problem.

java.lang.RuntimeException: org.objectweb.asm.tree.analysis.AnalyzerException: Execution can fall off the end of the code
	at org.clyze.jphantom.JPhantom.run(JPhantom.java:86)
	at me.coley.recaf.util.JPhantomUtil.generate(JPhantomUtil.java:76)
	at me.coley.recaf.util.CompileDependencyUpdater.createPhantoms(CompileDependencyUpdater.java:108)
	at me.coley.recaf.util.CompileDependencyUpdater.lambda$null$0(CompileDependencyUpdater.java:74)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
	at java.base/java.lang.Thread.run(Thread.java:831)
Caused by: org.objectweb.asm.tree.analysis.AnalyzerException: Execution can fall off the end of the code
	at org.objectweb.asm.tree.analysis.Analyzer.findSubroutine(Analyzer.java:391)
	at org.objectweb.asm.tree.analysis.Analyzer.analyze(Analyzer.java:139)
	at org.clyze.jphantom.constraints.extractors.TypeConstraintExtractor.visit(TypeConstraintExtractor.java:58)
	at org.clyze.jphantom.constraints.extractors.TypeConstraintExtractor.visit(TypeConstraintExtractor.java:46)
	at org.clyze.jphantom.JPhantom.run(JPhantom.java:84)
	... 8 more

win32kbase avatar Nov 28 '21 22:11 win32kbase

Seems to be a JPhantom problem.

This is only for the "patched" file though. The main concern is that it doesn't show up as a class unpatched, which should be handled by CAFED00D. ~~I'll take a look at it some time tomorrow.~~ ~~Ok, tomorrow for real this time.~~ Well, I'm just gonna get to it when I get to it. Things keep coming up :/

Col-E avatar Nov 29 '21 01:11 Col-E

Seems to be a JPhantom problem.

This is only for the "patched" file though. The main concern is that it doesn't show up as a class unpatched, which should be handled by CAFED00D. I'll take a look at it some time tomorrow.

Oops, you are right

win32kbase avatar Nov 29 '21 05:11 win32kbase

Can no longer reproduce the original issue on at least 427b048c07b7a5791514295e54484f6a17b0ffbc of dev3: 17:31:56.237 [ClassPatchingListener:INFO] Recovered 1/1 (100.00%) malformed classes There are still some issues with the fields & methods outline Screenshot_20220419_173349 (screenshot from the fallback decompiler as cfr completely fails on this class)

xcfrg avatar Apr 19 '22 21:04 xcfrg

Whats the issue with field/method outline? I can't see it?

xxDark avatar Apr 19 '22 21:04 xxDark

@xxDark It doesn't show synthetics by default. I think we should probably make it invert that so synthetics are the default.

One of the menu buttons toggles it.

Col-E avatar Apr 19 '22 21:04 Col-E

@MizzMaster Is this class even accepted by JVM's verifier? The IFEQ instruction jumps outside of code. code

xxDark avatar Apr 19 '22 23:04 xxDark