Storyyeller / Krakatau

Java decompiler, assembler, and disassembler
GNU General Public License v3.0
1.95k stars 219 forks source link

Failed to open javax class #112

Open caledot opened 7 years ago

caledot commented 7 years ago

I got the following error: Loading javax/crypto/spec/SecretKeySpec failed to open C:\\Users\\robertofs\\Desktop\\lib\javax/crypto/spec/SecretKeySpec.class Traceback (most recent call last): File "C:\Users\robertofs\Desktop\Krakatau-master\Krakatau\java\javaclass.py", line 37, in _getMethod graph = cb(method) if method.code is not None else None File "decompile.py", line 46, in makeGraph v = verifyBytecode(m.code) File "C:\Users\robertofs\Desktop\Krakatau-master\Krakatau\verifier\inference_verifier.py", line 506, in verifyBytecode node.update(iNodeLookup, exceptions) File "C:\Users\robertofs\Desktop\Krakatau-master\Krakatau\verifier\inference_verifier.py", line 449, in update self._mergeSingleSuccessor(iNodes[k], newstate, iNodes, False) File "C:\Users\robertofs\Desktop\Krakatau-master\Krakatau\verifier\inference_verifier.py", line 421, in _mergeSingleSuccessor changed = other.state.merge(newstate, self.env) File "C:\Users\robertofs\Desktop\Krakatau-master\Krakatau\verifier\inference_verifier.py", line 72, in merge self.locals = [mergeTypes(env, new, old) for old, new in zip(self.locals, other.locals)] File "C:\Users\robertofs\Desktop\Krakatau-master\Krakatau\verifier\verifier_types.py", line 123, in mergeTypes if env.isInterface(t2.extra, forceCheck=True): File "C:\Users\robertofs\Desktop\Krakatau-master\Krakatau\environment.py", line 56, in isInterface raise e ClassLoaderError: ClassNotFoundException: javax/crypto/spec/SecretKeySpec

In my "-path folder" i put the javax.jar, why do i get this error?

Storyyeller commented 7 years ago

You need to specify the exact path to the jar in -path.

caledot commented 7 years ago

in the -path variabile i wrote the full path where all the jar's are, is this correct or not? Do i need to add another path to that jar expressily (like -path c:\user\username\desktop\lib\javax.jar)?

Storyyeller commented 7 years ago

Unfortunately, right now you need to specify every jar individually.

I've thought about changing it, but I'm not sure what the best UI is and haven't gotten around to it. If you have any comments I'll take them into consideration if I do redesign it.

caledot commented 7 years ago

Can i create an environment variable with all the jars inside? Can the sw take it as input?

Storyyeller commented 7 years ago

Not right now, but it's something I've thought about.

Another idea I had was to precompute an "index" file that not only contains the paths to each jar but also contains bloom filters of the contents so you know which jar to look in. Then again, I don't think the current lookup is particularly slow (though it gets slower the more jars you add).