Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remapping overloaded field names (matching on field descriptor) #5

Open
agaricusb opened this issue Apr 1, 2013 · 8 comments
Open

Comments

@agaricusb
Copy link
Collaborator

The JVM allows multiple fields to have the same name and owner but different descriptor:

http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.5

Each field is described by a field_info structure. No two fields in one class file may have the same name and descriptor (§4.3.2).

Currently SpecialSource only supports remapping fields by (owner, name) -> name, not (owner, name, desc) -> name. This normally suffices since Java source code cannot overload fields, but, obfuscation can introduce this unusual but valid bytecode. To deobfuscate properly, the field type descriptors are needed in the mappings (should be optional).

See also: MinecraftForge/FML#210

@tonybruess
Copy link

👍 This happened when I did my CraftBukkit update

@agaricusb
Copy link
Collaborator Author

@mrapple hm are you sure, what specific symbols were problematic? I've only seen this when deobfuscating obfuscated CB, AFAIK it only occurs when a subclass references a field from its superclass which was private in vanilla but was edited for greater visibility and the obfuscated name happens to collide with another field in a subclass (specific example in FML issue 210, but could also occur with coremods using access transformers).

@tonybruess
Copy link

Can't remember exactly, but it's the case you describe. A field that was edited in a superclass.

@agaricusb
Copy link
Collaborator Author

FWIW, FML now includes this feature, for its runtime deobfuscation (the field type info is looked up dynamically).

@agaricusb
Copy link
Collaborator Author

Overloaded field in 1.5.2 (noted while debugging MCPC+):

FD: net/minecraft/entity/EntityLiving/potionsNeedUpdate net/minecraft/entity/EntityLiving/field_70752_e
FD: net/minecraft/entity/player/EntityPlayerMP/playerInventoryBeingManipulated net/minecraft/entity/player/EntityPlayerMP/field_71137_h

FD: net/minecraft/entity/player/EntityPlayerMP/playerInventoryBeingManipulated jc/h
FD: net/minecraft/entity/EntityLiving/potionsNeedUpdate ng/h

@agaricusb
Copy link
Collaborator Author

@tonybruess
Copy link

Also, this occurred again during the 1.6 update. How do we fix this?

@tonybruess
Copy link

Does this relate to #3? When it's fixed will this be fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants