Skip to content

Commit ed01978

Browse files
committed
Added fixes for handling ranges in correlation descriptors.
1 parent 65fc1f4 commit ed01978

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

NtApiDotNet/Ndr/NdrNativeUtils.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,7 @@ internal enum MidlTypePicklingInfoFlags
646646
None = 0,
647647
NewCorrDesc = 0x1,
648648
Oicf = 0x2,
649+
HasRangeOnConformance = 0x4
649650
}
650651

651652
[StructLayout(LayoutKind.Sequential)]

NtApiDotNet/Ndr/NdrParser.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,11 @@ private void ReadTypes(IntPtr midl_type_pickling_info_ptr, IntPtr midl_stub_desc
399399
throw new ArgumentException($"Unsupported picking type version {pickle_info.Version:X}");
400400
}
401401

402-
var flags = pickle_info.Flags.HasFlag(MidlTypePicklingInfoFlags.NewCorrDesc) ? NdrInterpreterOptFlags2.HasNewCorrDesc : 0;
402+
NdrInterpreterOptFlags2 flags = 0;
403+
if (pickle_info.Flags.HasFlag(MidlTypePicklingInfoFlags.NewCorrDesc))
404+
flags |= NdrInterpreterOptFlags2.HasNewCorrDesc;
405+
if (pickle_info.Flags.HasFlag(MidlTypePicklingInfoFlags.HasRangeOnConformance))
406+
flags |= NdrInterpreterOptFlags2.HasRangeOnConformance;
403407
MIDL_STUB_DESC stub_desc = _reader.ReadStruct<MIDL_STUB_DESC>(midl_stub_desc_ptr);
404408
NdrParseContext context = new NdrParseContext(_type_cache, null, stub_desc, stub_desc.pFormatTypes, stub_desc.GetExprDesc(_reader),
405409
flags, _reader, NdrParserFlags.IgnoreUserMarshal);

NtObjectManager/RpcFunctions.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1382,7 +1382,7 @@ function Get-NdrComplexType {
13821382

13831383
switch($PSCmdlet.ParameterSetName) {
13841384
"FromDecode2" {
1385-
$type_offset = $TypeFormat | % { $_ + $base_address }
1385+
$type_offset = $TypeFormat | % { [intptr]($_ + $base_address) }
13861386
[NtApiDotNet.Ndr.NdrParser]::ReadPicklingComplexTypes($Process, $PicklingInfo+$base_address,`
13871387
$StubDesc+$base_address, $type_offset, $Flags) | Write-Output
13881388
}

0 commit comments

Comments
 (0)