/// <summary> /// Gets all Asar current labels. They're safe to keep for as long as you want. /// </summary> /// <returns>All Asar's labels.</returns> public static Asarlabel[] getlabels() { RawAsarLabel *ptr = asar_getalllabels(out int length); Asarlabel[] output = new Asarlabel[length]; // Copy unmanaged to managed memory to avoid potential errors in case the area // gets cleared by Asar. for (int i = 0; i < length; i++) { output[i].Name = Marshal.PtrToStringAnsi(ptr[i].name); output[i].Location = ptr[i].location; } return(output); }
/// <summary> /// Gets all Asar current labels. They're safe to keep for as long as you want. /// </summary> /// <returns>All Asar's labels.</returns> public static Asarlabel[] getlabels() { int length = 0; Rawasarlabel *ptr = asar_getalllabels(out length); Asarlabel[] output = new Asarlabel[length]; // Better create a new array // to avoid pointer erros, corruption and may other problems. for (int i = 0; i < length; i++) { output[i].Name = Marshal.PtrToStringAnsi(ptr[i].name); output[i].Location = ptr[i].location; } return(output); }