| | 1 | | using System; |
| | 2 | |
|
| | 3 | | namespace SharpHoundRPC |
| | 4 | | { |
| | 5 | | public class RPCException : Exception |
| | 6 | | { |
| | 7 | | public const string Connect = "SamConnect"; |
| | 8 | | public const string EnumerateDomains = "SamEnumerateDomainsInSamServer"; |
| | 9 | | public const string ServerNotInitialized = "Server Not Initialized"; |
| | 10 | | public const string OpenAlias = "SamOpenAlias"; |
| | 11 | | public const string OpenDomain = "SamOpenDomain"; |
| | 12 | | public const string AliasNotFound = "Alias Not Found"; |
| | 13 | | public const string DomainNotFound = "Domain Not Found"; |
| | 14 | | public const string LookupIds = "SamLookupIdsInDomain"; |
| | 15 | | public const string EnumerateAliases = "SamEnumerateAliasesInDomain"; |
| | 16 | | public const string GetAliasMembers = "SamGetMembersinAlias"; |
| | 17 | | public const string LookupDomain = "SamLookupDomainInSamServer"; |
| | 18 | | public const string GetMachineSid = "GetMachineSid"; |
| | 19 | | private readonly string APICall; |
| | 20 | | private readonly string Status; |
| | 21 | |
|
| 0 | 22 | | public RPCException(string apiCall, NtStatus status) |
| 0 | 23 | | { |
| 0 | 24 | | APICall = apiCall; |
| 0 | 25 | | Status = status.ToString(); |
| 0 | 26 | | } |
| | 27 | |
|
| 0 | 28 | | public RPCException(string apiCall, string status) |
| 0 | 29 | | { |
| 0 | 30 | | APICall = apiCall; |
| 0 | 31 | | Status = status; |
| 0 | 32 | | } |
| | 33 | |
|
| | 34 | | public override string ToString() |
| 0 | 35 | | { |
| 0 | 36 | | return $"Call to {APICall} returned {Status}"; |
| 0 | 37 | | } |
| | 38 | | } |
| | 39 | | } |