Rename WriteObject.FromString to WriteObject.FromSerialized

This commit is contained in:
Gabe Stocco 2024-04-02 16:20:15 -07:00
Родитель f27bb19862
Коммит 8a251dd4e5
3 изменённых файлов: 12 добавлений и 12 удалений

Просмотреть файл

@ -225,7 +225,7 @@ namespace Microsoft.CST.AttackSurfaceAnalyzer.Utils
var resultTypeString = reader["result_type"].ToString();
if (runId != null && resultTypeString != null)
{
var wo = WriteObject.FromString((byte[])reader["serialized"], (RESULT_TYPE)Enum.Parse(typeof(RESULT_TYPE), resultTypeString), runId);
var wo = WriteObject.FromSerialized((byte[])reader["serialized"], (RESULT_TYPE)Enum.Parse(typeof(RESULT_TYPE), resultTypeString), runId);
if (wo is WriteObject WO)
{
output.Add(WO);
@ -256,8 +256,8 @@ namespace Microsoft.CST.AttackSurfaceAnalyzer.Utils
if (aRunId != null && bRunId != null && aResultType != null && bResultType != null)
{
var val1 = WriteObject.FromString((byte[])reader["a_serialized"], (RESULT_TYPE)Enum.Parse(typeof(RESULT_TYPE), aResultType), aRunId);
var val2 = WriteObject.FromString((byte[])reader["b_serialized"], (RESULT_TYPE)Enum.Parse(typeof(RESULT_TYPE), bResultType), bRunId);
var val1 = WriteObject.FromSerialized((byte[])reader["a_serialized"], (RESULT_TYPE)Enum.Parse(typeof(RESULT_TYPE), aResultType), aRunId);
var val2 = WriteObject.FromSerialized((byte[])reader["b_serialized"], (RESULT_TYPE)Enum.Parse(typeof(RESULT_TYPE), bResultType), bRunId);
if (val1 is WriteObject V1 && val2 is WriteObject V2)
{
@ -389,7 +389,7 @@ namespace Microsoft.CST.AttackSurfaceAnalyzer.Utils
var resultTypeString = reader["result_type"].ToString();
if (runId != null && resultTypeString != null)
{
var val = WriteObject.FromString((byte[])reader["serialized"], (RESULT_TYPE)Enum.Parse(typeof(RESULT_TYPE), resultTypeString), runId);
var val = WriteObject.FromSerialized((byte[])reader["serialized"], (RESULT_TYPE)Enum.Parse(typeof(RESULT_TYPE), resultTypeString), runId);
if (val is WriteObject valid)
yield return valid;
}

Просмотреть файл

@ -30,7 +30,7 @@ namespace Microsoft.CST.AttackSurfaceAnalyzer.Objects
public string RunId { get; }
public byte[] Serialized { get; }
public static WriteObject? FromString(byte[] SerializedIn, RESULT_TYPE ResultTypeIn, string RunIdIn)
public static WriteObject? FromSerialized(byte[] SerializedIn, RESULT_TYPE ResultTypeIn, string RunIdIn)
{
var deserialized = ProtoBufUtils.Hydrate(SerializedIn, ResultTypeIn);

Просмотреть файл

@ -179,7 +179,7 @@ namespace Microsoft.CST.AttackSurfaceAnalyzer.Utils
var resultTypeString = reader["result_type"].ToString();
if (runId != null && resultTypeString != null)
{
var wo = WriteObject.FromString((byte[])reader["serialized"], (RESULT_TYPE)Enum.Parse(typeof(RESULT_TYPE), resultTypeString), runId);
var wo = WriteObject.FromSerialized((byte[])reader["serialized"], (RESULT_TYPE)Enum.Parse(typeof(RESULT_TYPE), resultTypeString), runId);
if (wo is WriteObject WO)
output.Enqueue(WO);
}
@ -207,7 +207,7 @@ namespace Microsoft.CST.AttackSurfaceAnalyzer.Utils
var resultTypeString = reader["result_type"].ToString();
if (runId != null && resultTypeString != null)
{
var wo = WriteObject.FromString((byte[])reader["serialized"], (RESULT_TYPE)Enum.Parse(typeof(RESULT_TYPE), resultTypeString), runId);
var wo = WriteObject.FromSerialized((byte[])reader["serialized"], (RESULT_TYPE)Enum.Parse(typeof(RESULT_TYPE), resultTypeString), runId);
if (wo is WriteObject WO)
output.Enqueue(WO);
}
@ -233,7 +233,7 @@ namespace Microsoft.CST.AttackSurfaceAnalyzer.Utils
var resultTypeString = reader["result_type"].ToString();
if (runId != null && resultTypeString != null)
{
var wo = WriteObject.FromString((byte[])reader["serialized"], (RESULT_TYPE)Enum.Parse(typeof(RESULT_TYPE), resultTypeString), runId);
var wo = WriteObject.FromSerialized((byte[])reader["serialized"], (RESULT_TYPE)Enum.Parse(typeof(RESULT_TYPE), resultTypeString), runId);
if (wo is WriteObject WO)
output.Enqueue(WO);
}
@ -415,7 +415,7 @@ namespace Microsoft.CST.AttackSurfaceAnalyzer.Utils
var resultTypeString = reader["result_type"].ToString();
if (runId != null && resultTypeString != null)
{
var wo = WriteObject.FromString((byte[])reader["serialized"], (RESULT_TYPE)Enum.Parse(typeof(RESULT_TYPE), resultTypeString), runId);
var wo = WriteObject.FromSerialized((byte[])reader["serialized"], (RESULT_TYPE)Enum.Parse(typeof(RESULT_TYPE), resultTypeString), runId);
if (wo is WriteObject WO)
output.Enqueue(WO);
}
@ -446,8 +446,8 @@ namespace Microsoft.CST.AttackSurfaceAnalyzer.Utils
{
if (reader["a_serialized"] is byte[] a_serialized && reader["b_serialized"] is byte[] b_serialized)
{
var val1 = WriteObject.FromString(a_serialized, (RESULT_TYPE)Enum.Parse(typeof(RESULT_TYPE), aResultType), aRunId);
var val2 = WriteObject.FromString(b_serialized, (RESULT_TYPE)Enum.Parse(typeof(RESULT_TYPE), bResultType), bRunId);
var val1 = WriteObject.FromSerialized(a_serialized, (RESULT_TYPE)Enum.Parse(typeof(RESULT_TYPE), aResultType), aRunId);
var val2 = WriteObject.FromSerialized(b_serialized, (RESULT_TYPE)Enum.Parse(typeof(RESULT_TYPE), bResultType), bRunId);
if (val1 is WriteObject V1 && val2 is WriteObject V2)
{
@ -585,7 +585,7 @@ namespace Microsoft.CST.AttackSurfaceAnalyzer.Utils
var resultTypeString = reader["result_type"].ToString();
if (runId != null && resultTypeString != null)
{
var wo = WriteObject.FromString((byte[])reader["serialized"], (RESULT_TYPE)Enum.Parse(typeof(RESULT_TYPE), resultTypeString), runId);
var wo = WriteObject.FromSerialized((byte[])reader["serialized"], (RESULT_TYPE)Enum.Parse(typeof(RESULT_TYPE), resultTypeString), runId);
if (wo is WriteObject WO)
{
yield return WO;