Ejemplo n.º 1
0
        private registry_item GetFakeRegistryItem(string key, string name, eValueTypes dataType, string dataValue)
        {
            string hive = Enum.GetName(typeof(eHiveNames), eHiveNames.HKEY_LOCAL_MACHINE);
            string keyCollectedSuccessfully = "The Key, which fullPath is '{0}\\{1}\\{2}', was collected sucessfully.";

            registry_item registryItem = new registry_item();

            registryItem.hive = new EntityItemRegistryHiveType()
            {
                Value = hive
            };
            registryItem.key = new EntityItemStringType()
            {
                Value = key
            };
            registryItem.name = new EntityItemStringType()
            {
                Value = name
            };
            registryItem.type = new EntityItemRegistryTypeType()
            {
                Value = RegistryHelper.GetValueTypeAsString(dataType)
            };
            registryItem.value = new EntityItemAnySimpleType[] { new EntityItemAnySimpleType()
                                                                 {
                                                                     Value = dataValue
                                                                 } };

            registryItem.status  = StatusEnumeration.exists;
            registryItem.message = MessageType.FromString(string.Format(keyCollectedSuccessfully, hive, key, name));

            return(registryItem);
        }
Ejemplo n.º 2
0
    public int getStat(eValueTypes vt)
    {
        switch (vt)
        {
        case eValueTypes.ENERGY:     return(energy);

        case eValueTypes.COST:       return(cost);

        case eValueTypes.ATTACK:     return(attack);

        case eValueTypes.DEFENSE:    return(defense);

        case eValueTypes.LEVEL:      return(level);

        case eValueTypes.STAR:       return((int)star);

        default:                     return(0);
        }
    }
Ejemplo n.º 3
0
 public static String ConvertToGetValueMethodNameFromValueType(eValueTypes valueType)
 {
     switch (valueType)
     {
         case eValueTypes.BINARY:
             return "GetBinaryValue";
         case eValueTypes.DWORD:
         case eValueTypes.DWORD_LITTLE_ENDIAN:
             return "GetDWORDValue";
         case eValueTypes.EXPANDED_STRING:
             return "GetExpandedStringValue";
         case eValueTypes.MULTI_STRING:
             return "GetMultiStringValue";
         case eValueTypes.STRING:
             return "GetStringValue";
         default:
             throw new Exception("Invalid type while trying to convert valueToMatch type into get valueToMatch method name.");
     }
 }
Ejemplo n.º 4
0
        public static String ConvertToGetValueMethodNameFromValueType(eValueTypes valueType)
        {
            switch (valueType)
            {
            case eValueTypes.BINARY:
                return("GetBinaryValue");

            case eValueTypes.DWORD:
            case eValueTypes.DWORD_LITTLE_ENDIAN:
                return("GetDWORDValue");

            case eValueTypes.EXPANDED_STRING:
                return("GetExpandedStringValue");

            case eValueTypes.MULTI_STRING:
                return("GetMultiStringValue");

            case eValueTypes.STRING:
                return("GetStringValue");

            default:
                throw new Exception("Invalid type while trying to convert valueToMatch type into get valueToMatch method name.");
            }
        }
Ejemplo n.º 5
0
 public int getStat(eValueTypes vt)
 {
     switch (vt) {
         case eValueTypes.ENERGY:     return energy;
         case eValueTypes.COST:       return cost;
         case eValueTypes.ATTACK:     return attack;
         case eValueTypes.DEFENSE:    return defense;
         case eValueTypes.LEVEL:      return level;
         case eValueTypes.STAR:       return (int)star;
         default:                     return 0;
     }
 }
Ejemplo n.º 6
0
 public static String GetValueTypeAsString(eValueTypes valueTypeID)
 {
     return(Enum.GetName(typeof(RegistryItemTypeType), valueTypeID));
 }
Ejemplo n.º 7
0
 public RegistryItemSystemData(eValueTypes dataTypeID, Object dataValue)
 {
     this._valueTypeID = dataTypeID;
     this._dataValue = dataValue;
 }
Ejemplo n.º 8
0
        private registry_item GetFakeRegistryItem(string key, string name, eValueTypes dataType, string dataValue)
        {
            string hive = Enum.GetName(typeof(eHiveNames), eHiveNames.HKEY_LOCAL_MACHINE);
            string keyCollectedSuccessfully = "The Key, which fullPath is '{0}\\{1}\\{2}', was collected sucessfully.";

            registry_item registryItem = new registry_item();
            registryItem.hive = new EntityItemRegistryHiveType() { Value = hive };
            registryItem.key = new EntityItemStringType() { Value = key };
            registryItem.name = new EntityItemStringType() { Value = name };
            registryItem.type = new EntityItemRegistryTypeType() { Value = RegistryHelper.GetValueTypeAsString(dataType) };
            registryItem.value = new EntityItemAnySimpleType[] { new EntityItemAnySimpleType() { Value = dataValue } };

            registryItem.status = StatusEnumeration.exists;
            registryItem.message = MessageType.FromString(string.Format(keyCollectedSuccessfully, hive, key, name));

            return registryItem;
        }
Ejemplo n.º 9
0
 public static String GetValueTypeAsString(eValueTypes valueTypeID)
 {
     return Enum.GetName(typeof(RegistryItemTypeType), valueTypeID);
 }
Ejemplo n.º 10
0
 public RegistryItemSystemData(eValueTypes dataTypeID, Object dataValue)
 {
     this._valueTypeID = dataTypeID;
     this._dataValue   = dataValue;
 }