Question about OTDRE [message #1768318] |
Mon, 17 July 2017 12:36 |
|
Hi,
I am just digging through the code to assemble all the details together how things work w.r.t. the implementation of the dynamic runtime weaving.
In the CreateCallAllBindingsCallInOrgMethod I've seen some interesting peace of code (line 111-116) which I do not understand why it is needed. They have been added with commit ea5e55ac71fa3c12fddeb561a423a8e76f9fdfc1 in order to fix Bug 494415.
if (method.name.equals("<init>")) { // set bit 0x8000000 to signal the ctor
newInstructions.add(createLoadIntConstant(0xffff_ffff));
newInstructions.add(createLoadIntConstant(0x7fff_ffff)); // 0x80000000 causes NPE in ASM :(
newInstructions.add(new InsnNode(Opcodes.IXOR)); // indirectly creates the desired 0x80000000
newInstructions.add(new InsnNode(Opcodes.IOR));
}
Now, the IXOR constructs the 0x800_000 which cannot be constructed using the ASM API. But what is the task of the IOR operator following just thereafter?
Furthermore, why is it needed to put 0x800_000 on the stack "to signal the ctor"? Directly before that code this and a load instruction for the boundMethodId as constant is put on the stack. Directly thereafter the arguments for callAllBindings are assembled together and is called by invokevirtual.
[Updated on: Mon, 17 July 2017 12:40] Report message to a moderator
|
|
|
|
Re: Question about OTDRE [message #1768343 is a reply to message #1768320] |
Mon, 17 July 2017 17:10 |
|
Seems like int flaggedMethodId = methodId | 0x800_0000; newInstructions.add(createLoadIntConstant(flaggedMethodId)); would be a good substitude without recalculating this everytime.
|
|
|
|
Re: Question about OTDRE [message #1774250 is a reply to message #1769623] |
Thu, 12 October 2017 08:33 |
|
I was looking if there was ever a bug in ASM when loading negative int constants, and also compiled a snipped with javac to look how the resulting bytecode looks like.
The problem is in the function as the first if statement checks if the integer is lower than 5. That is true, and as such it would try to generate an arbitrary low value that ASM does not understand (Opcodes.I_LOAD + i). Hence, the problem and NullPointerException. I already fixed in my local branch and also all the boundaries for the other ones.
|
|
|
Re: Question about OTDRE [message #1800883 is a reply to message #1768318] |
Wed, 09 January 2019 11:49 |
zino garphy Messages: 3 Registered: January 2019 |
Junior Member |
|
|
Lars Schütze wrote on Mon, 17 July 2017 12:36Hi,
I am just digging through the code to assemble all the details together how things work w.r.t. the implementation of the dynamic runtime weaving.
In the CreateCallAllBindingsCallInOrgMethod I've seen some interesting peace of code (line 111-116) which I do not understand why it is needed. They have been added with commit ea5e55ac71fa3c12fddeb561a423a8e76f9fdfc1 in order to fix Bug 494415.
if (method.name.equals("<init>")) { // set bit 0x8000000 to signal the ctor
newInstructions.add(createLoadIntConstant(0xffff_ffff));
newInstructions.add(createLoadIntConstant(0x7fff_ffff)); // 0x80000000 causes NPE in ASM :(
newInstructions.add(new InsnNode(Opcodes.IXOR)); // indirectly creates the desired 0x80000000
newInstructions.add(new InsnNode(Opcodes.IOR));
}
Now, the IXOR constructs the 0x800_000 which cannot be constructed using the ASM API. But what is the task of the IOR operator following just thereafter? Chaturbate Xnxx Tubegalore
Furthermore, why is it needed to put 0x800_000 on the stack "to signal the ctor"? Directly before that code this and a load instruction for the boundMethodId as constant is put on the stack. Directly thereafter the arguments for callAllBindings are assembled together and is called by invokevirtual.
The highest bit signals it to be a constructor which is again read from Team.java so that before and replace bindings can be forbidden.
[Updated on: Wed, 09 January 2019 20:08] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.06234 seconds