private byte[] GetBytesFromArea(int index) { cPacketArea item = this.KnownPacket.Areas[index]; byte[] numArray = new byte[item.iEnd - item.iStart + 1]; int num = 0; for (int i = item.iStart; i <= item.iEnd; i++) { int num1 = num; num = num1 + 1; numArray[num1] = this.aBytes[i]; } return(numArray); }
private void ParseFromItem() { string str = ""; string lower = this.sArray[1].ToLower(); int length = lower.Length; cPacketArea _cPacketArea = new cPacketArea(); for (int i = 0; i < length; i++) { char chr = lower[i]; if (chr >= '0' && chr <= '9' || chr >= 'a' && chr <= 'f') { str = string.Concat(str, chr.ToString()); } if (chr == '{') { _cPacketArea.iType = 2; _cPacketArea.iStart = str.Length / 2; } if (chr == '}') { _cPacketArea.iEnd = str.Length / 2 - 1; this.Areas.Add(_cPacketArea); _cPacketArea = new cPacketArea(); } } this.aBytes = cPacket.ParseStringToBytesArray(str); for (int j = 2; j < (int)this.sArray.Length; j++) { string str1 = this.sArray[j]; char chr1 = '}'; if (str1[0] == '<') { chr1 = '>'; } if (str1[0] == '[') { chr1 = ']'; } int num = str1.IndexOf(chr1); int num1 = int.Parse(str1.Substring(1, num - 1)) - 1; this.Areas[num1].sText = str1.Substring(str1.IndexOf('-') + 1).Trim(); } }