Storyyeller / Krakatau

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

Error when trying to run my modified class #10

Closed kieran- closed 11 years ago

kieran- commented 11 years ago

I literally changed one value from "www." to "wwwh7.", re-assembled it with no errors, tried to run it in my program and I get this error.

http://oi43.tinypic.com/sbmw5g.jpg

Storyyeller commented 11 years ago

Can you post the complete disassembly of the class? That error shouldn't be possible if all you did was change the constant in an ldc_w instruction.

Also post the original class files if you can.

kieran- commented 11 years ago

Sure but it's about 75k lines let me pastebin it.

kieran- commented 11 years ago

Here's the uppit link, pastebin freezes when I try to post it

http://up.ht/17rXVQj

Storyyeller commented 11 years ago

Can you post the original classfile too please?

kieran- commented 11 years ago

http://up.ht/17rYBox

just need to change the extension

Storyyeller commented 11 years ago

That is weird. I'll see if I can figure out what the problem is.

kieran- commented 11 years ago

Thanks, please do get back to me, I've been looking for a working assembler/disassembler for a long time

Storyyeller commented 11 years ago

Ok, I figured out what the problem is. The disassembler doesn't bother trying to disassemble LocalVariableTable attributes (or LineNumberTable or LocalVariableTypeTable), instead leaving them as binary blobs. I assumed that this would be ok as long as the method isn't altered, but I forgot that the local variable tables have constant pool references and the order of constant pool entries isn't preserved by reassembly. I'm not sure what the best option here is.

Do you think I should just have it remove the attributes entirely for now?

kieran- commented 11 years ago

I don't know, from here anything is a step in the right direction? But if things are removed then it might not function correctly, that's the only problem

Storyyeller commented 11 years ago

It should be working now.

Anyway, the removed information is only used for debugging. So it won't affect execution at all, unless the code does something weird like inspect it's own stack traces.