Confuser.Core/Utils.cs
/// <summary>
/// Creates a list of types with the same size as a specific size
/// </summary>
/// <param name="size">target size to reach</param>
/// <returns>List of types which have the size of the target size</returns>
Creates a list of types with the same size as a specific size
Creates a list of types with the same size as a specific size
public static List<Type> CreateTypeList(int size)
        {
            List<Type> retList = new List<Type>();
            while (size != 0)
            {
                if (16 <= size)
                {
                    size -= 16;
                    retList.Add(GetType(16));
                }
                else if (12 <= size)
                {
                    size -= 12;
                    retList.Add(GetType(12));
                }
                else if (8 <= size)
                {
                    size -= 8;
                    retList.Add(GetType(8));
                }
                else if (4 <= size)
                {
                    size -= 4;
                    retList.Add(GetType(4));
                }
                else if (2 <= size)
                {
                    size -= 2;
                    retList.Add(GetType(2));
                }
                else if (1 <= size)
                {
                    size -= 1;
                    retList.Add(GetType(1));
                }
            }
            return retList;
        }
public static List < Type > CreateTypeList ( int size ) { List < Type > retList = new List < Type > ( ) ; while ( size != 0 ) { if ( 16 <= size ) { size -= 16 ; retList . Add ( GetType ( 16 ) ) ; } else if ( 12 <= size ) { size -= 12 ; retList . Add ( GetType ( 12 ) ) ; } else if ( 8 <= size ) { size -= 8 ; retList . Add ( GetType ( 8 ) ) ; } else if ( 4 <= size ) { size -= 4 ; retList . Add ( GetType ( 4 ) ) ; } else if ( 2 <= size ) { size -= 2 ; retList . Add ( GetType ( 2 ) ) ; } else if ( 1 <= size ) { size -= 1 ; retList . Add ( GetType ( 1 ) ) ; } } return retList ; }
Creates a list of types with the same size as a specific size
Creates a list of types with the same size as a specific size
List of types which have the size of the target size
List of types which have the size of the target size
size
int
target size to reach
target size to reach