NetrServerGetInfoRequest.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* Copyright (C) 2014 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
  2. *
  3. * You can redistribute this program and/or modify it under the terms of
  4. * the GNU Lesser Public License as published by the Free Software Foundation,
  5. * either version 3 of the License, or (at your option) any later version.
  6. */
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Text;
  10. using SMBLibrary.RPC;
  11. using Utilities;
  12. namespace SMBLibrary.Services
  13. {
  14. /// <summary>
  15. /// NetrServerGetInfo Request (opnum 21)
  16. /// </summary>
  17. public class NetrServerGetInfoRequest
  18. {
  19. public string ServerName;
  20. public uint Level;
  21. public NetrServerGetInfoRequest(byte[] buffer)
  22. {
  23. NDRParser parser = new NDRParser(buffer);
  24. ServerName = parser.ReadTopLevelUnicodeStringPointer();
  25. Level = parser.ReadUInt32();
  26. }
  27. public byte[] GetBytes()
  28. {
  29. NDRWriter writer = new NDRWriter();
  30. writer.WriteTopLevelUnicodeStringPointer(ServerName);
  31. writer.WriteUInt32(Level);
  32. return writer.GetBytes();
  33. }
  34. }
  35. }