Closed yhs0602 closed 4 years ago
@TomSmartBishop
Thanks for your work @KYHSGeekCode !!! It would be great however, if we don't need to pull the ILAsmRenderer into the toString method. The toString method should be independent of that.
I think we could just use this line to the toString method: String.format("\nIL_%04x: %s", programCounter, i.toString());
(maybe also check if there is any CilInstuction that does something different than toString in it's render method)
It would be great however, if we don't need to pull the ILAsmRenderer into the toString method. The toString method should be independent of that.
Perfectly agree with that.
Just curious: Are you using the toString method instead of the ILAsmRender to get a string representation of the method body?
Could you keep an IlAsmRenderer instance and just do a String str = instance.render(methodBody, null);
instead?
Could you keep an IlAsmRenderer instance and just do a
String str = instance.render(methodBody, null);
instead?
Oh I didn't know that that method existed. However, isn't that method private?
It uses CilInstruction.toString now
Ok, great I saw ther migt be some minor differences - eg. when resolving token names, so maybe the best thing is to make the render method in ILAamRenderer for the methodBOdy public so that you can use it in your app
OK, PR looks good, now, but let's revert the white-space change. Again I'm happy to apply some white-space rules if we can agree on some standard (but in a separate commit)
Okay, I'll do when I'm back home.
Just curious, did you(r team) write such a large and long switch-cases manually to develop a decompiler? Or are there any strategies for writing disassemblers like this project?
Good question indeed…I just applied theory from building compilers.
I made a workaround for the issue #6.
MethodBody.toString()
now creates a temporaryLanguageRenderer
withnull
FacileReflector
.