public string[] AllStrings() { string[] AllStringsRet = default; char ch = '\0'; MemPtr p2 = ptr; string[] s; int c = _Sb.Count - 1; s = new string[c + 1]; var a = default(ulong); if (_Sb.LpWStr) { for (int j = 0, loopTo = c; j <= loopTo; j++) { s[j] = p2.GrabString((IntPtr)0); p2 += s[j].Length * 2 + 2; } } else { for (int j = 0, loopTo1 = c; j <= loopTo1; j++) { switch (sd) { case 2: { a = p2.get_UShortAt(0L); break; } case 4: { a = p2.get_UIntegerAt(0L); break; } case 8: { a = p2.get_ULongAt(0L); break; } } s[j] = p2.GrabString((IntPtr)sd, (int)a); p2 += (long)(a * 2m + sd); } } AllStringsRet = s; return(AllStringsRet); }