public VMSlot GetValue(EmuContext ctx, PointerType type) { object obj = this.instance; bool flag = this.field.DeclaringType.IsValueType && this.instance is IReference; if (flag) { obj = ((IReference)this.instance).GetValue(ctx, PointerType.OBJECT).ToObject(this.field.DeclaringType); } return(VMSlot.FromObject(this.field.GetValue(obj), this.field.FieldType)); }
public unsafe VMSlot GetValue(EmuContext ctx, PointerType type) { bool flag = this._ptr != null; TypedReference typedReference; if (flag) { *(&typedReference) = *(TypedReference *)this._ptr.Value; } else { *(TypedRef.PseudoTypedRef *)(&typedReference) = this._typedRef; } return(VMSlot.FromObject(TypedReference.ToObject(typedReference), __reftype(typedReference))); }
public unsafe void SetValue(EmuContext ctx, VMSlot slot, PointerType type) { bool flag = this.field.DeclaringType.IsValueType && this.instance is IReference; if (flag) { TypedReference obj; ((IReference)this.instance).ToTypedReference(ctx, (void *)(&obj), this.field.DeclaringType); this.field.SetValueDirect(obj, slot.ToObject(this.field.FieldType)); } else { this.field.SetValue(this.instance, slot.ToObject(this.field.FieldType)); } }
public unsafe void SetValue(EmuContext ctx, VMSlot slot, PointerType type) { bool flag = this._ptr != null; TypedReference typedReference; if (flag) { *(&typedReference) = *(TypedReference *)this._ptr.Value; } else { *(TypedRef.PseudoTypedRef *)(&typedReference) = this._typedRef; } Type typeFromHandle = __reftype(typedReference); object value = slot.ToObject(typeFromHandle); Helpers.TypedReferenceHelpers.SetTypedRef(value, (void *)(&typedReference)); }
internal EmuContext(RhydonContext ctx, MethodExport exp) { Export = exp; MethodBody = new List <KoiInstruction>(); Stack = new Stack <VMSlot>(); Registers = new VMSlot[16]; Handlers = new Dictionary <byte, KoiHandler>(); VCallHandlers = new Dictionary <byte, VCallHandler>(); Module = ctx.Module; Reader = ctx.Reader; Header = ctx.Header; StartOffset = ctx.StartOffset; Constants = ctx.Constants; Decompiled = ctx.Decompiled; Logger = ctx.Logger; Parameters = ctx.Parameters; }
public void SetValue(EmuContext ctx, VMSlot slot, PointerType type) { throw new NotImplementedException(); }