2

So I've been reading around and found out that apparently JAD crashes when it tries to decompile a class with an invalid constant pool entry. I've been playing about with this purely out of curiosity, but I can't seem to make it happen - it either decompiles fine or can't be read correctly by the JVM. Is this outdated information that I have, or am I simply not doing it the correct way?

If I can't get this to work, it's no big deal as I've learned a lot about the Java class format, and as I said, it's just for fun.

Jivings
  • 22,834
  • 6
  • 60
  • 101
Leagsaidh Gordon
  • 1,641
  • 5
  • 19
  • 28
  • What are the Java classes compiled with? How are you making an invalid constant pool entry? – Jivings Feb 15 '12 at 17:07
  • I'm taking a compiled class and altering it. The way I've tried that still lets the JVM run it is adding an entry that isn't used with invalid data, but JAD handled that fine. – Leagsaidh Gordon Feb 15 '12 at 17:13
  • Can you provide the line? Maybe it's not as invalid as you think. – Jivings Feb 15 '12 at 17:40
  • I don't actually have any saved - if they didn't work, I made a mental note and tried something else. I didn't think I'd need them at the time. – Leagsaidh Gordon Feb 15 '12 at 17:53
  • 1
    Difficult to say then. Also the JVM implementation has some bearing, since some of the behaviour of parsing the constant pool is undefined. Such as what to do if you encounter a non-critical bug. – Jivings Feb 15 '12 at 18:07

1 Answers1

0

Most likely, the source you read says that JAD crashes on invalid pool entries in some cases. It doesn't always crash, and without the source code, there's no easy way to tell under what circumstances it may or may not crash.

Antimony
  • 37,781
  • 10
  • 100
  • 107