I'm working on a coremod for Minecraft, and transform a lot of the classes as they are loaded. The problem however is that there are multiple coremods which also transform the same classes that I am, and I am getting some strange behavior that I want to look into.
Then comes the problem, how do I inspect the bytecode after it has been transformed multiple times? When I transform it I just get an byte[] input that I run trough ASM and then return my modified bytecode.
My idea was to just to dump the class bytecode to a .class file after the class was loaded, and inspect it from there. But I can't seem to find any way to actually get the bytecode after the class is loaded. The closest I can find is getResource, but that returns the bytecode as it was BEFORE it was transformed, not what I want.
TLDR: How do I get the bytecode of a class AFTER it has been modified and loaded? -Can't use ClassLoader.getResource as it returns unmodified version. -Can't get it during load time as I want to catch transforms happening after my own.
Is there some external program that can dump the in-memory bytecode or something?
Hoping someone can help me with this =)