protected virtual unsafe FieldBuilder DefineField(TypeBuilder typeBuilder, BCSYM_Variable* pField) { string fieldName = new string(*((char**) (pField + 12))); BCSYM* pSymbol = BCSYM.DigThroughNamedType(*((BCSYM* modopt(IsConst) modopt(IsConst)*) (pField + 80))); Type type = this.GetType(typeBuilder, pSymbol); FieldAttributes fieldAttributes = GetFieldAttributes(pField); return typeBuilder.DefineField(fieldName, type, fieldAttributes); }
protected static unsafe FieldAttributes GetFieldAttributes(BCSYM_Variable* pField) { FieldAttributes privateScope = FieldAttributes.PrivateScope; if ((*(((int*) (pField + 0x5c))) & 7) == 0) { if ((((byte) (BCSYM.GetVtype(BCSYM.DigThroughNamedType(*((BCSYM* modopt(IsConst) modopt(IsConst)*) (pField + 80)))) == 12)) == 0) && (((byte) (BCSYM.GetVtype(BCSYM.DigThroughNamedType(*((BCSYM* modopt(IsConst) modopt(IsConst)*) (pField + 80)))) == 15)) == 0)) { privateScope = FieldAttributes.Literal; } else { privateScope = FieldAttributes.InitOnly; } privateScope |= FieldAttributes.Static; }