mirror of
https://github.com/BeichenDream/GodPotato
synced 2026-06-21 13:41:53 +00:00
update sharp token
This commit is contained in:
+3
-1
@@ -1,3 +1,5 @@
|
||||
/.vs/
|
||||
/bin/
|
||||
/obj/
|
||||
/obj/
|
||||
GodPotato.csproj.user
|
||||
app.config
|
||||
+4
-1
@@ -5,7 +5,7 @@
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{2AE886C3-3272-40BE-8D3C-EBAEDE9E61E1}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>GodPotato</RootNamespace>
|
||||
<AssemblyName>GodPotato</AssemblyName>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
@@ -32,6 +32,9 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject />
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
|
||||
@@ -158,6 +158,10 @@ namespace GodPotato.NativeAPI
|
||||
public IntPtr /* PMIDL_SYNTAX_INFO */ pSyntaxInfo;
|
||||
}
|
||||
|
||||
void aa() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
public static extern bool VirtualProtect([In] IntPtr pBlock,[In] uint size,[In] uint newProtect,[Out] out uint oldProtect);
|
||||
|
||||
+24
-8
@@ -693,6 +693,8 @@ namespace SharpToken
|
||||
|
||||
public bool IsClose { get; private set; }
|
||||
|
||||
private static readonly List<string> blackGroupSid = new List<string>();
|
||||
|
||||
private ProcessToken()
|
||||
{
|
||||
|
||||
@@ -813,15 +815,29 @@ namespace SharpToken
|
||||
|
||||
for (int i = 0; i < groupCount; i++)
|
||||
{
|
||||
try
|
||||
lock (blackGroupSid)
|
||||
{
|
||||
securityIdentifier = new SecurityIdentifier(Marshal.ReadIntPtr(new IntPtr(tokenUserPtr.ToInt64() + offset)));
|
||||
offset += Marshal.SizeOf(typeof(SID_AND_ATTRIBUTES));
|
||||
goups.Add(securityIdentifier.Translate(typeof(NTAccount)).Value);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
continue;
|
||||
try
|
||||
{
|
||||
securityIdentifier = new SecurityIdentifier(Marshal.ReadIntPtr(new IntPtr(tokenUserPtr.ToInt64() + offset)));
|
||||
offset += Marshal.SizeOf(typeof(SID_AND_ATTRIBUTES));
|
||||
|
||||
if (blackGroupSid.Contains(securityIdentifier.Value))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
goups.Add(securityIdentifier.Translate(typeof(NTAccount)).Value);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (securityIdentifier != null)
|
||||
{
|
||||
blackGroupSid.Add(securityIdentifier.Value);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
Marshal.FreeHGlobal(tokenUserPtr);
|
||||
|
||||
Reference in New Issue
Block a user