Skip to content

Commit 08e81ec

Browse files
committed
Added current PEB address property.
1 parent 716e8ff commit 08e81ec

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

NtApiDotNet/NtProcess.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2707,6 +2707,11 @@ public bool PriorityBoostDisabled
27072707
/// <remarks>This only uses the pseudo handle, for the process. If you need a proper handle use OpenCurrent.</remarks>
27082708
public static NtProcess Current => new NtProcess(new SafeKernelObjectHandle(-1));
27092709

2710+
/// <summary>
2711+
/// Get the current PEB address.
2712+
/// </summary>
2713+
public static IntPtr CurrentPebAddress => NtRtl.RtlGetCurrentPeb();
2714+
27102715
#endregion
27112716
}
27122717
}

NtApiDotNet/NtProcessNative.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -870,6 +870,9 @@ public static extern NtStatus RtlCreateProcessParametersEx(
870870
[DllImport("ntdll.dll")]
871871
[return: MarshalAs(UnmanagedType.U1)]
872872
public static extern bool RtlTestProtectedAccess(byte request_level, byte target_level);
873+
874+
[DllImport("ntdll.dll")]
875+
public static extern IntPtr RtlGetCurrentPeb();
873876
}
874877

875878
[Flags]

0 commit comments

Comments
 (0)