mardi 15 août 2017

Referencing external library classes located in default package

I am currently working with bytecode injection/instrumentation at runtime for a Java-based game Minecraft.

My issue does not lie with the java agent/bytecode portion of this task, and I know that I am unable to directly access the default package without doing so from the same package. I have added the obfuscated Minecraft jar (1.8.jar) as an external library to my project. With that being said, the obfuscation of the jar is formatted in such a way that the Main class is located in an accessible package (net.minecraft.client.main.Main), but virtually all the other files are found within the default package with names such as (aaa, abc, bhz, etc).

Here's a small snippet of what the root of the jar looks like: http://ift.tt/2i3jCW7

I would like to reference certain classes (i.e. bsu) from my project (found in a package). I know that reflection can be used to reference the class, but I was wondering if there were any other alternatives.

Could I refactor the jar to have the default package classes moved to some temporary package (such as 'q.') and then at runtime, when the agent is calling a certain method such as q.foo.bar, it would "refactor" to foo.bar and call the proper function? Is adapters/wrappers a possibility for this?

Open to all possibilities.





Aucun commentaire:

Enregistrer un commentaire