More tweaks after pen-testing.

This commit is contained in:
CloneTrooper1019
2020-08-20 02:03:05 -05:00
parent f4899b4ce6
commit 2ff5d82218
7 changed files with 31 additions and 21 deletions

View File

@ -56,11 +56,9 @@ namespace RobloxFiles
public byte[] RawBuffer { get; internal set; }
internal object RawValue;
internal BinaryRobloxFileWriter CurrentWriter;
internal static BindingFlags BindingFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy | BindingFlags.IgnoreCase;
internal static MemberTypes FieldOrProperty = MemberTypes.Field | MemberTypes.Property;
// !! FIXME: Map typeof(ProtectedString) to PropertyType.ProtectedString when binary files are allowed to read it.
public static readonly IReadOnlyDictionary<Type, PropertyType> Types = new Dictionary<Type, PropertyType>()
{
@ -329,16 +327,5 @@ namespace RobloxFiles
return (T)result;
}
internal void WriteValue<T>() where T : struct
{
if (CurrentWriter == null)
throw new Exception("Property.CurrentWriter must be set to use WriteValue<T>");
T value = CastValue<T>();
byte[] bytes = BinaryRobloxFileWriter.GetBytes(value);
CurrentWriter.Write(bytes);
}
}
}