public static int AddStandard(StandardInfo standard) { standard.ID = dal.AddStandard(standard); UploadBLL.UpdateUpload(TableID, 0, standard.ID, Cookies.Admin.GetRandomNumber(false)); CacheHelper.Remove(cacheKey); return(standard.ID); }
protected void SubmitButton_Click(object sender, EventArgs e) { StandardInfo standard = new StandardInfo(); standard.ID = RequestHelper.GetQueryString <int>("ID"); standard.Name = this.Name.Text; standard.DisplayTye = Convert.ToInt32(this.DisplayTye.Text); standard.ValueList = RequestHelper.GetForm <string>("ValueList"); standard.PhotoList = RequestHelper.GetForm <string>("PhotoList"); string alertMessage = ShopLanguage.ReadLanguage("AddOK"); if (standard.ID == -2147483648) { base.CheckAdminPower("AddStandard", PowerCheckType.Single); int id = StandardBLL.AddStandard(standard); AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("Standard"), id); } else { base.CheckAdminPower("UpdateStandard", PowerCheckType.Single); StandardBLL.UpdateStandard(standard); AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("UpdateRecord"), ShopLanguage.ReadLanguage("Standard"), standard.ID); alertMessage = ShopLanguage.ReadLanguage("UpdateOK"); } AdminBasePage.Alert(alertMessage, RequestHelper.RawUrl); }
private static void DisplayStandardInfo(StandardInfo[] result) { Console.WriteLine("uid\tfirst_name\tlast_name"); foreach (var si in result) { Console.WriteLine("{0}\t{1}\t{2}", si.UserId, si.FirstName, si.LastName); } }
public int AddStandard(StandardInfo standard) { SqlParameter[] pt = new SqlParameter[] { new SqlParameter("@name", SqlDbType.NVarChar), new SqlParameter("@displayTye", SqlDbType.Int), new SqlParameter("@valueList", SqlDbType.NVarChar), new SqlParameter("@photoList", SqlDbType.NVarChar) }; pt[0].Value = standard.Name; pt[1].Value = standard.DisplayTye; pt[2].Value = standard.ValueList; pt[3].Value = standard.PhotoList; return(Convert.ToInt32(ShopMssqlHelper.ExecuteScalar(ShopMssqlHelper.TablePrefix + "AddStandard", pt))); }
public PaginatedList <StandardInfo> Search(string searchQuery, bool?deepest = null, int start = 0, int count = int.MaxValue) { var standards = DoRead(u => new StandardDataAccess(u).Search(searchQuery, deepest, start, count)); var docs = DoRead(u => new DocumentDataAccess(u).GetByIds(standards.Select(x => x.DocumentRef).ToList())); var authorities = DoRead(u => new DataAccessBase <Data.AcademicBenchmark.Model.Authority, Guid>(u) .GetByIds(standards.Select(x => x.AuthorityRef).ToList())); return(StandardInfo.Create(standards, authorities, docs)); }
public IList <StandardInfo> Get(Guid?authorityId, Guid?documentId, Guid?subjectDocId, string gradeLevelCode, Guid?parentId, Guid?courseId, bool firstLevelOnly = false) { var standards = DoRead(u => new StandardDataAccess(u).Get(authorityId, documentId, subjectDocId, gradeLevelCode, parentId, courseId, firstLevelOnly)); var docs = DoRead(u => new DocumentDataAccess(u).GetByIds(standards.Select(x => x.DocumentRef).ToList())); var authorities = DoRead(u => new DataAccessBase <Data.AcademicBenchmark.Model.Authority, Guid>(u) .GetByIds(standards.Select(x => x.AuthorityRef).ToList())); return(StandardInfo.Create(standards, authorities, docs)); }
public void UpdateStandard(StandardInfo standard) { SqlParameter[] pt = new SqlParameter[] { new SqlParameter("@id", SqlDbType.Int), new SqlParameter("@name", SqlDbType.NVarChar), new SqlParameter("@displayTye", SqlDbType.Int), new SqlParameter("@valueList", SqlDbType.NVarChar), new SqlParameter("@photoList", SqlDbType.NVarChar) }; pt[0].Value = standard.ID; pt[1].Value = standard.Name; pt[2].Value = standard.DisplayTye; pt[3].Value = standard.ValueList; pt[4].Value = standard.PhotoList; ShopMssqlHelper.ExecuteNonQuery(ShopMssqlHelper.TablePrefix + "UpdateStandard", pt); }
public StandardInfo GetStandardInfo() { var ret = new StandardInfo { CurrentUser = Environment.UserName, PcName = Environment.MachineName, DomainName = Environment.UserDomainName }; return(ret); }
public void PrepareStandardModel(SqlDataReader dr, List <StandardInfo> standardList) { while (dr.Read()) { StandardInfo item = new StandardInfo(); item.ID = dr.GetInt32(0); item.Name = dr[1].ToString(); item.DisplayTye = dr.GetInt32(2); item.ValueList = dr[3].ToString(); item.PhotoList = dr[4].ToString(); standardList.Add(item); } }
public virtual async Task<ActionResult> Index(string mode, string token, string apiRoot, int? announcementApplicationId, int? studentId, int? announcementId, int? announcementType, int? attributeId, int? start, int? count, string contentId) { if (string.IsNullOrWhiteSpace(apiRoot)) return new EmptyResult(); ChalkableAuthorization = ChalkableAuthorization ?? new ChalkableAuthorization(apiRoot); if (ChalkableAuthorization.ApiRoot != apiRoot) ChalkableAuthorization = new ChalkableAuthorization(apiRoot); var standards = StandardInfo.FromQuery(Request.Params, HttpContext.Server.UrlDecode).ToList(); if (string.IsNullOrWhiteSpace(token)) return new EmptyResult(); if (IsChalkableCallBack(mode)) { try { await AuthorizeQueryRequest(token); switch (mode) { case Settings.CONTENT_QUERY: return ChlkJsonResult(GetApplicationContents(standards, start, count), true); case Settings.ANNOUNCEMENT_APPLICATION_SUBMIT: case Settings.ANNOUNCEMENT_APPLICATION_REMOVE: HandleChalkableNotification(mode, announcementApplicationId, announcementType); return ChlkJsonResult(true, true); default: throw new Exception($"Unknown mode \"{mode}\""); } } catch (Exception ex) { return ChlkExceptionJsonResult(ex); } } await ChalkableAuthorization.AuthorizeAsync(token); if (string.IsNullOrWhiteSpace(mode)) mode = Settings.MY_VIEW_MODE; CurrentUser = await GetCurrentUser(mode); return await ResolveAction(mode, announcementApplicationId, studentId, announcementId, announcementType, attributeId, StandardInfo.FromQuery(Request.Params, HttpContext.Server.UrlDecode), contentId); }
public static StandardInfo ReadStandardCache(int id) { StandardInfo info = new StandardInfo(); List <StandardInfo> list = ReadStandardCacheList(); foreach (StandardInfo info2 in list) { if (info2.ID == id) { return(info2); } } return(info); }
public static StandardViewData Create(StandardInfo model) { return(new StandardViewData { Id = model.Id, Description = model.Description, Code = model.Code, IsActive = model.IsActive, IsDeepest = model.IsDeepest, Level = model.Level, ParentId = model.ParentId, Authority = AuthorityViewData.Create(model.Authority), Document = DocumentViewData.Create(model.Document) }); }
public IList <StandardInfo> GetStandardInfosByIds(IList <Guid> ids) { using (var uow = Read()) { var standards = new StandardDataAccess(uow).GetByIds(ids); var authoritiesIds = standards.Select(x => x.AuthorityRef).ToList(); var authorities = new DataAccessBase <Data.AcademicBenchmark.Model.Authority, Guid>(uow).GetByIds(authoritiesIds); var documentsIds = standards.Select(x => x.DocumentRef).ToList(); var documents = new DataAccessBase <Data.AcademicBenchmark.Model.Document, Guid>(uow).GetByIds(documentsIds); return(StandardInfo.Create(standards, authorities, documents)); } }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { this.DisplayTye.DataSource = EnumHelper.ReadEnumList <DisplayTye>(); this.DisplayTye.DataTextField = "ChineseName"; this.DisplayTye.DataValueField = "Value"; this.DisplayTye.DataBind(); this.DisplayTye.SelectedIndex = 0; int queryString = RequestHelper.GetQueryString <int>("ID"); if (queryString != -2147483648) { base.CheckAdminPower("ReadStandard", PowerCheckType.Single); this.standard = StandardBLL.ReadStandardCache(queryString); this.Name.Text = this.standard.Name; this.DisplayTye.Text = this.standard.DisplayTye.ToString(); } } }
protected override void PageLoad() { base.PageLoad(); int queryString = RequestHelper.GetQueryString <int>("ID"); this.product = ProductBLL.ReadProduct(queryString); if (this.product.IsSale == 0) { ScriptHelper.Alert("该产品未上市,不能查看"); } ProductBLL.ChangeProductViewCount(queryString, 1); this.userGradeList = UserGradeBLL.ReadUserGradeCacheList(); this.memberPriceList = MemberPriceBLL.ReadMemberPriceByProduct(queryString); this.currentMemberPrice = (this.product.MarketPrice * UserGradeBLL.ReadUserGradeCache(base.GradeID).Discount) / 100M; foreach (MemberPriceInfo info in this.memberPriceList) { if (info.GradeID == base.GradeID) { this.currentMemberPrice = info.Price; break; } } this.currentMemberPrice = Math.Round(this.currentMemberPrice, 2); ProductPhotoInfo item = new ProductPhotoInfo(); item.Name = this.product.Name; item.Photo = this.product.Photo; this.productPhotoList.Add(item); this.productPhotoList.AddRange(ProductPhotoBLL.ReadProductPhotoByProduct(queryString)); this.strHistoryProduct = base.Server.UrlDecode(CookiesHelper.ReadCookieValue("HistoryProduct")); string strProductID = (this.product.RelationProduct + "," + this.product.Accessory + "," + this.strHistoryProduct).Replace(",,", ","); if (strProductID.StartsWith(",")) { strProductID = strProductID.Substring(1); } if (strProductID.EndsWith(",")) { strProductID = strProductID.Substring(0, strProductID.Length - 1); } ProductSearchInfo productSearch = new ProductSearchInfo(); productSearch.InProductID = strProductID; this.tempProductList = ProductBLL.SearchProductList(productSearch); if (strProductID != string.Empty) { this.tempMemberPriceList = MemberPriceBLL.ReadMemberPriceByProductGrade(strProductID, base.GradeID); } this.attributeRecordList = AttributeRecordBLL.ReadAttributeRecordByProduct(queryString); TagsSearchInfo tags = new TagsSearchInfo(); tags.ProductID = queryString; this.productTagsList = TagsBLL.SearchTagsList(tags); if (this.product.RelationArticle != string.Empty) { ArticleSearchInfo articleSearch = new ArticleSearchInfo(); articleSearch.InArticleID = this.product.RelationArticle; this.productArticleList = ArticleBLL.SearchArticleList(articleSearch); } this.standardRecordList = StandardRecordBLL.ReadStandardRecordByProduct(this.product.ID, this.product.StandardType); if ((this.standardRecordList.Count > 0) && (this.product.StandardType == 1)) { string[] strArray = this.standardRecordList[0].StandardIDList.Split(new char[] { ',' }); for (int i = 0; i < strArray.Length; i++) { StandardInfo info6 = StandardBLL.ReadStandardCache(Convert.ToInt32(strArray[i])); string[] strArray2 = info6.ValueList.Split(new char[] { ',' }); string[] strArray3 = info6.PhotoList.Split(new char[] { ',' }); string str2 = string.Empty; string str3 = string.Empty; for (int j = 0; j < strArray2.Length; j++) { foreach (StandardRecordInfo info7 in this.standardRecordList) { string[] strArray4 = info7.ValueList.Split(new char[] { ',' }); if (strArray2[j] == strArray4[i]) { str2 = str2 + strArray2[j] + ","; str3 = str3 + strArray3[j] + ","; goto Label_043B; } } Label_043B :; } if (str2 != string.Empty) { str2 = str2.Substring(0, str2.Length - 1); str3 = str3.Substring(0, str3.Length - 1); } info6.ValueList = str2; info6.PhotoList = str3; this.standardList.Add(info6); } foreach (StandardRecordInfo info7 in this.standardRecordList) { object standardRecordValueList = this.standardRecordValueList; this.standardRecordValueList = string.Concat(new object[] { standardRecordValueList, info7.ProductID, ",", info7.ValueList, "|" }); } } if (ShopConfig.ReadConfigInfo().ProductStorageType == 1) { this.leftStorageCount = this.product.TotalStorageCount - this.product.OrderCount; } else { this.leftStorageCount = this.product.ImportVirtualStorageCount; } base.Title = this.product.Name; base.Keywords = (this.product.Keywords == string.Empty) ? this.product.Name : this.product.Keywords; base.Description = (this.product.Summary == string.Empty) ? StringHelper.Substring(StringHelper.KillHTML(this.product.Introduction), 200) : this.product.Summary; }
public FileRecord(byte[] rawBytes, int offset) { Offset = offset; var sig = BitConverter.ToInt32(rawBytes, 0); if ((sig != _fileSig) && (sig != _baadSig) && (sig != 0x0)) { Logger.Fatal($"Invalid signature! 0x{sig:X}"); return; //throw new Exception("Invalid signature!"); } if (sig == _baadSig) { Logger.Warn($"Bad signature at offset 0x{offset:X}"); return; } Attributes = new List <Attribute>(); FixupOffset = BitConverter.ToInt16(rawBytes, 2); FixupEntryCount = BitConverter.ToInt16(rawBytes, 4); LogSequenceNumber = BitConverter.ToInt64(rawBytes, 0x8); SequenceNumber = BitConverter.ToInt16(rawBytes, 0x10); ReferenceCount = BitConverter.ToInt16(rawBytes, 0x12); FirstAttributeOffset = BitConverter.ToInt16(rawBytes, 0x14); EntryFlags = (EntryFlag)BitConverter.ToInt16(rawBytes, 0x16); Logger.Trace($"Entry flags: {EntryFlags}"); ActualRecordSize = BitConverter.ToInt32(rawBytes, 0x18); AllocatedRecordSize = BitConverter.ToInt32(rawBytes, 0x1c); var entryBytes = new byte[8]; Buffer.BlockCopy(rawBytes, 0x20, entryBytes, 0, 8); MFTRecordToBaseRecord = new MftEntryInfo(entryBytes); FirstAvailableAttribueId = BitConverter.ToInt16(rawBytes, 0x28); EntryNumber = BitConverter.ToInt32(rawBytes, 0x2c); var fixupExpectedBytes = new byte[2]; var fixupActual1 = new byte[2]; var fixupActual2 = new byte[2]; Buffer.BlockCopy(rawBytes, 0x30, fixupExpectedBytes, 0, 2); Buffer.BlockCopy(rawBytes, 0x32, fixupActual1, 0, 2); Buffer.BlockCopy(rawBytes, 0x34, fixupActual2, 0, 2); //verify this record looks ok based on fixup bytes //0x1FE and 0x3fe var expectedFixupVal = BitConverter.ToInt16(fixupExpectedBytes, 0); var x1FeValue = BitConverter.ToInt16(rawBytes, 0x1FE); var x3FeValue = BitConverter.ToInt16(rawBytes, 0x3FE); if ((x1FeValue != expectedFixupVal) && ((EntryFlags & EntryFlag.FileRecordSegmentInUse) == EntryFlag.FileRecordSegmentInUse)) { Logger.Warn( $"FILE record at offset 0x{offset:X}! Fixup values do not match at 0x1FE. Expected: {expectedFixupVal}, actual: {x1FeValue}, EntryFlags: {EntryFlags}"); } if ((x3FeValue != expectedFixupVal) && ((EntryFlags & EntryFlag.FileRecordSegmentInUse) == EntryFlag.FileRecordSegmentInUse)) { Logger.Warn( $"FILE record at offset 0x{offset:X}! Fixup values do not match at 0x3FE. Expected: {expectedFixupVal}, actual: {x3FeValue}, EntryFlags: {EntryFlags}"); } //header is done, replace fixup bytes with actual bytes //0x1fe and 0x3fe should contain fixup bytes Buffer.BlockCopy(fixupActual1, 0, rawBytes, 0x1fe, 2); Buffer.BlockCopy(fixupActual2, 0, rawBytes, 0x3fe, 2); //start attribute processing at FirstAttributeOffset var index = (int)FirstAttributeOffset; while (index < ActualRecordSize) { var attrType = BitConverter.ToInt32(rawBytes, index); var attrSize = BitConverter.ToInt32(rawBytes, index + 4); // Logger.Trace( // $"ActualRecordSize: {ActualRecordSize} attrType: 0x{attrType:X}, size: {attrSize}, index: {index}, offset: 0x{offset:x}, i+o: 0x{index + offset:X}"); if ((attrSize == 0) || (attrType == -1)) { index += 8; //skip -1 type and 0 size if (EntryFlags == 0) //this is a free record { break; } continue; } var rawAttr = new byte[attrSize]; Buffer.BlockCopy(rawBytes, index, rawAttr, 0, attrSize); switch ((AttributeType)attrType) { case AttributeType.StandardInformation: var si = new StandardInfo(rawAttr); Attributes.Add(si); SILastAccessedOn = si.LastAccessedOn; SICreatedOn = si.CreatedOn; SIRecordModifiedOn = si.RecordModifiedOn; SIContentModifiedOn = si.ContentModifiedOn; break; case AttributeType.FileName: var fi = new FileName(rawAttr); Attributes.Add(fi); if ((fi.FileInfo.NameType & NameTypes.Windows) == NameTypes.Windows) { FName = fi.FileInfo.FileName; } //if (fi.FileInfo.LastAccessedOn.UtcDateTime != SILastAccessedOn.UtcDateTime) //{ FNLastAccessedOn = fi.FileInfo.LastAccessedOn; //} //if (fi.FileInfo.CreatedOn.UtcDateTime != SICreatedOn.UtcDateTime) //{ FNCreatedOn = fi.FileInfo.CreatedOn; //} //if (fi.FileInfo.RecordModifiedOn.UtcDateTime != SIRecordModifiedOn.UtcDateTime) //{ FNRecordModifiedOn = fi.FileInfo.RecordModifiedOn; //} //if (fi.FileInfo.ContentModifiedOn.UtcDateTime != SIContentModifiedOn.UtcDateTime) //{ FNContentModifiedOn = fi.FileInfo.ContentModifiedOn; //} break; case AttributeType.Data: var data = new Data(rawAttr); Attributes.Add(data); break; case AttributeType.IndexAllocation: var ia = new IndexAllocation(rawAttr); Attributes.Add(ia); break; case AttributeType.IndexRoot: var ir = new IndexRoot(rawAttr); Attributes.Add(ir); break; case AttributeType.Bitmap: var bm = new Bitmap(rawAttr); Attributes.Add(bm); break; case AttributeType.VolumeVersionObjectId: var oi = new ObjectId(rawAttr); Attributes.Add(oi); break; case AttributeType.SecurityDescriptor: var sd = new SecurityDescriptor(rawAttr); Attributes.Add(sd); break; case AttributeType.VolumeName: var vn = new VolumeName(rawAttr); Attributes.Add(vn); break; case AttributeType.VolumeInformation: var vi = new VolumeInformation(rawAttr); Attributes.Add(vi); break; case AttributeType.LoggedUtilityStream: var lus = new LoggedUtilityStream(rawAttr); Attributes.Add(lus); break; case AttributeType.ReparsePoint: var rp = new ReparsePoint(rawAttr); Attributes.Add(rp); break; case AttributeType.AttributeList: var al = new AttributeList(rawAttr); Attributes.Add(al); break; case AttributeType.Ea: //TODO Finish this var ea = new ExtendedAttribute(rawAttr); Attributes.Add(ea); break; case AttributeType.EaInformation: var eai = new ExtendedAttributeInformation(rawAttr); Attributes.Add(eai); break; default: Logger.Warn($"Unhandled attribute type! Add me: {(AttributeType) attrType}"); throw new Exception($"Add me: {(AttributeType) attrType}"); break; } index += attrSize; } SlackStartOffset = index; //rest is slack. handle here? Logger.Trace($"Slack starts at {index} i+o: 0x{index + offset:X}"); }
public static void UpdateStandard(StandardInfo standard) { dal.UpdateStandard(standard); UploadBLL.UpdateUpload(TableID, 0, standard.ID, Cookies.Admin.GetRandomNumber(false)); CacheHelper.Remove(cacheKey); }
public FileRecord(byte[] rawBytes, int offset) { Offset = offset; var sig = BitConverter.ToInt32(rawBytes, 0); switch (sig) { case FileSig: break; case BaadSig: _logger.Debug($"Bad signature at offset 0x{offset:X}"); IsBad = true; return; default: //not initialized _logger.Debug($"Uninitialized entry (no signature) at offset 0x{offset:X}"); IsUninitialized = true; return; } _logger.Debug($"Processing FILE record at offset 0x{offset:X}"); Attributes = new List <Attribute>(); FixupOffset = BitConverter.ToInt16(rawBytes, 0x4); FixupEntryCount = BitConverter.ToInt16(rawBytes, 0x6); //to build fixup info, take FixupEntryCount x 2 bytes as each are 2 bytes long var fixupTotalLength = FixupEntryCount * 2; var fixupBuffer = new byte[fixupTotalLength]; Buffer.BlockCopy(rawBytes, FixupOffset, fixupBuffer, 0, fixupTotalLength); //pull this early so we can check if its free in our fix up value messages EntryFlags = (EntryFlag)BitConverter.ToInt16(rawBytes, 0x16); FixupData = new FixupData(fixupBuffer); FixupOk = true; //fixup verification var counter = 512; foreach (var bytese in FixupData.FixupActual) { //adjust the offset to where we need to check var fixupOffset = counter - 2; var expected = BitConverter.ToInt16(rawBytes, fixupOffset); if (expected != FixupData.FixupExpected && EntryFlags != 0x0) { FixupOk = false; _logger.Warn( $"Offset: 0x{Offset:X} Entry/seq: 0x{EntryNumber:X}/0x{SequenceNumber:X} Fixup values do not match at 0x{fixupOffset:X}. Expected: 0x{FixupData.FixupExpected:X2}, actual: 0x{expected:X2}"); } //replace fixup expected with actual bytes. bytese has actual replacement values in it. Buffer.BlockCopy(bytese, 0, rawBytes, fixupOffset, 2); counter += 512; } LogSequenceNumber = BitConverter.ToInt64(rawBytes, 0x8); SequenceNumber = BitConverter.ToUInt16(rawBytes, 0x10); ReferenceCount = BitConverter.ToInt16(rawBytes, 0x12); FirstAttributeOffset = BitConverter.ToInt16(rawBytes, 0x14); ActualRecordSize = BitConverter.ToInt32(rawBytes, 0x18); AllocatedRecordSize = BitConverter.ToInt32(rawBytes, 0x1c); var entryBytes = new byte[8]; Buffer.BlockCopy(rawBytes, 0x20, entryBytes, 0, 8); MftRecordToBaseRecord = new MftEntryInfo(entryBytes); FirstAvailablAttribueId = BitConverter.ToInt16(rawBytes, 0x28); EntryNumber = BitConverter.ToUInt32(rawBytes, 0x2c); //start attribute processing at FirstAttributeOffset var index = (int)FirstAttributeOffset; while (index < ActualRecordSize) { var attrType = (AttributeType)BitConverter.ToInt32(rawBytes, index); var attrSize = BitConverter.ToInt32(rawBytes, index + 4); if (attrSize == 0 || attrType == AttributeType.EndOfAttributes) { index += 8; //skip -1 type and 0 size if (index != ActualRecordSize) { _logger.Warn($"Slack space found in entry/seq: 0x{EntryNumber:X}/0x{SequenceNumber:X}"); } //TODO process slack here? break; } _logger.Debug( $"Found Attribute Type {attrType.ToString()} at absolute offset: 0x{index + offset:X}"); _logger.Trace( $"ActualRecordSize: 0x{ActualRecordSize:X}, size: 0x{attrSize:X}, index: 0x{index:X}"); var rawAttr = new byte[attrSize]; Buffer.BlockCopy(rawBytes, index, rawAttr, 0, attrSize); switch (attrType) { case AttributeType.StandardInformation: var si = new StandardInfo(rawAttr); Attributes.Add(si); break; case AttributeType.FileName: var fi = new FileName(rawAttr); Attributes.Add(fi); break; case AttributeType.Data: var d = new Data(rawAttr); Attributes.Add(d); break; case AttributeType.IndexAllocation: var ia = new IndexAllocation(rawAttr); Attributes.Add(ia); break; case AttributeType.IndexRoot: var ir = new IndexRoot(rawAttr); Attributes.Add(ir); break; case AttributeType.Bitmap: var bm = new Bitmap(rawAttr); Attributes.Add(bm); break; case AttributeType.VolumeVersionObjectId: var oi = new ObjectId_(rawAttr); Attributes.Add(oi); break; case AttributeType.SecurityDescriptor: var sd = new SecurityDescriptor(rawAttr); Attributes.Add(sd); break; case AttributeType.VolumeName: var vn = new VolumeName(rawAttr); Attributes.Add(vn); break; case AttributeType.VolumeInformation: var vi = new VolumeInformation(rawAttr); Attributes.Add(vi); break; case AttributeType.LoggedUtilityStream: var lus = new LoggedUtilityStream(rawAttr); Attributes.Add(lus); break; case AttributeType.ReparsePoint: try { var rp = new ReparsePoint(rawAttr); Attributes.Add(rp); } catch (Exception) { var l = LogManager.GetLogger("ReparsePoint"); l.Error( $"There was an error parsing a ReparsePoint in FILE record at offset 0x{Offset:X}. Please extract via --dd and --do and send to [email protected]"); } break; case AttributeType.AttributeList: var al = new AttributeList(rawAttr); Attributes.Add(al); break; case AttributeType.Ea: var ea = new ExtendedAttribute(rawAttr); Attributes.Add(ea); break; case AttributeType.EaInformation: var eai = new ExtendedAttributeInformation(rawAttr); Attributes.Add(eai); break; default: throw new Exception($"Add me: {attrType} (0x{attrType:X})"); } index += attrSize; } //rest is slack. handle here? _logger.Trace($"Slack starts at 0x{index:X} Absolute offset: 0x{index + offset:X}"); }