scripts
This commit is contained in:
@@ -0,0 +1,191 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
|
||||
namespace System.Security
|
||||
{
|
||||
// Token: 0x020005D2 RID: 1490
|
||||
internal struct SecurityFrame
|
||||
{
|
||||
// Token: 0x0600366B RID: 13931 RVA: 0x000BA590 File Offset: 0x000B8790
|
||||
internal SecurityFrame(RuntimeSecurityFrame frame)
|
||||
{
|
||||
this._domain = null;
|
||||
this._method = null;
|
||||
this._assert = null;
|
||||
this._deny = null;
|
||||
this._permitonly = null;
|
||||
this.InitFromRuntimeFrame(frame);
|
||||
}
|
||||
|
||||
// Token: 0x0600366C RID: 13932 RVA: 0x000BA5C8 File Offset: 0x000B87C8
|
||||
internal SecurityFrame(int skip)
|
||||
{
|
||||
this._domain = null;
|
||||
this._method = null;
|
||||
this._assert = null;
|
||||
this._deny = null;
|
||||
this._permitonly = null;
|
||||
this.InitFromRuntimeFrame(SecurityFrame._GetSecurityFrame(skip + 2));
|
||||
}
|
||||
|
||||
// Token: 0x0600366D RID: 13933
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern RuntimeSecurityFrame _GetSecurityFrame(int skip);
|
||||
|
||||
// Token: 0x0600366E RID: 13934
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
private static extern Array _GetSecurityStack(int skip);
|
||||
|
||||
// Token: 0x0600366F RID: 13935 RVA: 0x000BA5FC File Offset: 0x000B87FC
|
||||
internal void InitFromRuntimeFrame(RuntimeSecurityFrame frame)
|
||||
{
|
||||
this._domain = frame.domain;
|
||||
this._method = frame.method;
|
||||
if (frame.assert.size > 0)
|
||||
{
|
||||
this._assert = SecurityManager.Decode(frame.assert.blob, frame.assert.size);
|
||||
}
|
||||
if (frame.deny.size > 0)
|
||||
{
|
||||
this._deny = SecurityManager.Decode(frame.deny.blob, frame.deny.size);
|
||||
}
|
||||
if (frame.permitonly.size > 0)
|
||||
{
|
||||
this._permitonly = SecurityManager.Decode(frame.permitonly.blob, frame.permitonly.size);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000AA8 RID: 2728
|
||||
// (get) Token: 0x06003670 RID: 13936 RVA: 0x000BA6B8 File Offset: 0x000B88B8
|
||||
public Assembly Assembly
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._method.ReflectedType.Assembly;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000AA9 RID: 2729
|
||||
// (get) Token: 0x06003671 RID: 13937 RVA: 0x000BA6CC File Offset: 0x000B88CC
|
||||
public AppDomain Domain
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._domain;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000AAA RID: 2730
|
||||
// (get) Token: 0x06003672 RID: 13938 RVA: 0x000BA6D4 File Offset: 0x000B88D4
|
||||
public MethodInfo Method
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._method;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000AAB RID: 2731
|
||||
// (get) Token: 0x06003673 RID: 13939 RVA: 0x000BA6DC File Offset: 0x000B88DC
|
||||
public PermissionSet Assert
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._assert;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000AAC RID: 2732
|
||||
// (get) Token: 0x06003674 RID: 13940 RVA: 0x000BA6E4 File Offset: 0x000B88E4
|
||||
public PermissionSet Deny
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._deny;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000AAD RID: 2733
|
||||
// (get) Token: 0x06003675 RID: 13941 RVA: 0x000BA6EC File Offset: 0x000B88EC
|
||||
public PermissionSet PermitOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._permitonly;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000AAE RID: 2734
|
||||
// (get) Token: 0x06003676 RID: 13942 RVA: 0x000BA6F4 File Offset: 0x000B88F4
|
||||
public bool HasStackModifiers
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._assert != null || this._deny != null || this._permitonly != null;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06003677 RID: 13943 RVA: 0x000BA71C File Offset: 0x000B891C
|
||||
public bool Equals(SecurityFrame sf)
|
||||
{
|
||||
return object.ReferenceEquals(this._domain, sf.Domain) && !(this.Assembly.ToString() != sf.Assembly.ToString()) && !(this.Method.ToString() != sf.Method.ToString()) && (this._assert == null || this._assert.Equals(sf.Assert)) && (this._deny == null || this._deny.Equals(sf.Deny)) && (this._permitonly == null || this._permitonly.Equals(sf.PermitOnly));
|
||||
}
|
||||
|
||||
// Token: 0x06003678 RID: 13944 RVA: 0x000BA7F8 File Offset: 0x000B89F8
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.AppendFormat("Frame: {0}{1}", this._method, Environment.NewLine);
|
||||
stringBuilder.AppendFormat("\tAppDomain: {0}{1}", this.Domain, Environment.NewLine);
|
||||
stringBuilder.AppendFormat("\tAssembly: {0}{1}", this.Assembly, Environment.NewLine);
|
||||
if (this._assert != null)
|
||||
{
|
||||
stringBuilder.AppendFormat("\tAssert: {0}{1}", this._assert, Environment.NewLine);
|
||||
}
|
||||
if (this._deny != null)
|
||||
{
|
||||
stringBuilder.AppendFormat("\tDeny: {0}{1}", this._deny, Environment.NewLine);
|
||||
}
|
||||
if (this._permitonly != null)
|
||||
{
|
||||
stringBuilder.AppendFormat("\tPermitOnly: {0}{1}", this._permitonly, Environment.NewLine);
|
||||
}
|
||||
return stringBuilder.ToString();
|
||||
}
|
||||
|
||||
// Token: 0x06003679 RID: 13945 RVA: 0x000BA8BC File Offset: 0x000B8ABC
|
||||
public static ArrayList GetStack(int skipFrames)
|
||||
{
|
||||
Array array = SecurityFrame._GetSecurityStack(skipFrames + 2);
|
||||
ArrayList arrayList = new ArrayList();
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
object value = array.GetValue(i);
|
||||
if (value == null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
arrayList.Add(new SecurityFrame((RuntimeSecurityFrame)value));
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
// Token: 0x0400164D RID: 5709
|
||||
private AppDomain _domain;
|
||||
|
||||
// Token: 0x0400164E RID: 5710
|
||||
private MethodInfo _method;
|
||||
|
||||
// Token: 0x0400164F RID: 5711
|
||||
private PermissionSet _assert;
|
||||
|
||||
// Token: 0x04001650 RID: 5712
|
||||
private PermissionSet _deny;
|
||||
|
||||
// Token: 0x04001651 RID: 5713
|
||||
private PermissionSet _permitonly;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user