opcodes

How Do I Execute Dalvik Op-Codes

I would like to execute opcodes directly against the running Dalvik VM instance from within my application on Android. I'm looking for something similar to the C asm function. I have a list of opcodes for dalvik, but I am unfamiliar with how to either execute them directly, or write them out to .class files and execute them against som...

IL Opcode Modification

Language: VB.NET 3.5 IL opcodes: 718 ldarg.0 719 callvirt System.Windows.Forms.Button RClient.RClient::get_cmd1() 724 ldarg.0 725 ldfld System.String[] RClient.RClient::ButtonStrings 730 ldc.i4.5 731 ldelem.ref 732 callvirt System.Void System.Windows.Forms.ButtonBase::set_Text(System.Stri...

Call a dynamically generated method on a ILGenerator on the same type

Normally, when I want to call a dynamic method in another ILGenerator object that is writing a method on the same type I do the following : generator.Emit(OpCodes.Ldarg_0); // reference to the current object generator.Emit(OpCodes.Ldstr, "someArgument"); generator.Emit(OpCodes.Call, methodBuilder); //this methodbuilder is also defined...

What do the IL Prefix OpCodes do?

I've been playing around with IL and I noticed OpCodes like Prefix1, with documentation basically telling me not to worry about it. Naturally, this makes me quite curious as to what these various Prefix OpCodes actually do. A quick Google search didn't turn up anything, so I thought I'd ask the experts here. Does anybody know what the...

System.AccessViolationException storing a variable with reflectio.emit

Hi, I'm building a compiler with reflection.emit in my spare time, and i've come to a problem that i'm not understanding. A little context, I've a runtime with a couple of types and one of them is Float2, a simpler vector struct with two float values (X and Y). I've made a couple of properties that allow me to swizzle the values (a la h...

DynamicMethod code unverifiable in .Net 4.0 (found ref 'this' pointer... expected ref '<>f__AnonymousType1`)

Hi All, Was using this solution to convert anonymous types to dictionaries using reflection.emit. Was working fine until I changed to .Net 4.0 from 3.5. Now, I'm getting the "System.Security.VerificationException: Operation could destabilize the runtime." error. Converted the anonymously loaded dynamic method to one hosted in a dyn...