Jump to content

1.7.10 ASM Local Variables Post Runtime Deobfuscation


Blargerist

Recommended Posts

I'm stumped. I currently began a re-write of my mod to remove as much version dependency as possible. This involved switching from Notch names to Srg names and switching my @IFMLLoadingPlugin.SortingIndex() from 100 to 1001 to run all changes post runtime deobfuscation. This worked perfectly well, but once I went on to testing out an idea for finding a LocalVariableNode's index based on it's name/desc I ran into something I don't quite understand.

 

public void setIsSpawningFromSpawnerTrue(MethodNode method)
{
	BnBTweaks.Log.info("Printing " + method.localVariables.size() + " LocalVariableNodes in: " + method.name);
	for (LocalVariableNode lvNode : method.localVariables)
	{
		BnBTweaks.Log.info(lvNode.name + " " + lvNode.desc + " " + lvNode.index + " " + lvNode.signature);
	}

 

Above is a code snippet I wrote to get some information about local variables within the current method that I could use to write a method for finding the local variable indexs. Back when I was running pre runtime obfuscation, this would've printed out everything quite nicely for me. Now that I'm running post though, it seems that method.localVariables.size() is 0, and therefore I can get no information.

[11:27:52] [server thread/INFO] [bnBTweaks/]: Printing 0 LocalVariableNodes in: func_98278_g

 

Why might this be?

Link to comment
Share on other sites

Haha, of course! As usual, the thing I got stuck on was obvious from outside the cloud of frustration :P. Wish I had thought to check the thread again before deleting literally everything and re-downloading to be sure it wasn't a corruption issue :P.

 

Now to just think of some other way to verify variables are correctly targeted (without using a second transformer :P). Can't think of a different approach yet though....

 

I feel properly dumb now :D. Many thank yous diesieben07!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.