Exemple #1
0
		public ImageDosHeaderVM(object owner, HexDocument doc, ulong startOffset)
			: base(owner) {
			this.magicVM = new UInt16HexField(doc, Name, "e_magic", startOffset + 0);
			this.cblpVM = new UInt16HexField(doc, Name, "e_cblp", startOffset + 2);
			this.cpVM = new UInt16HexField(doc, Name, "e_cp", startOffset + 4);
			this.crlcVM = new UInt16HexField(doc, Name, "e_crlc", startOffset + 6);
			this.cparhdrVM = new UInt16HexField(doc, Name, "e_cparhdr", startOffset + 8);
			this.minallocVM = new UInt16HexField(doc, Name, "e_minalloc", startOffset + 0x0A);
			this.maxallocVM = new UInt16HexField(doc, Name, "e_maxalloc", startOffset + 0x0C);
			this.ssVM = new UInt16HexField(doc, Name, "e_ss", startOffset + 0x0E);
			this.spVM = new UInt16HexField(doc, Name, "e_sp", startOffset + 0x10);
			this.csumVM = new UInt16HexField(doc, Name, "e_csum", startOffset + 0x12);
			this.ipVM = new UInt16HexField(doc, Name, "e_ip", startOffset + 0x14);
			this.csVM = new UInt16HexField(doc, Name, "e_cs", startOffset + 0x16);
			this.lfarlcVM = new UInt16HexField(doc, Name, "e_lfarlc", startOffset + 0x18);
			this.ovnoVM = new UInt16HexField(doc, Name, "e_ovno", startOffset + 0x1A);
			this.res_0VM = new UInt16HexField(doc, Name, "e_res[0]", startOffset + 0x1C);
			this.res_1VM = new UInt16HexField(doc, Name, "e_res[1]", startOffset + 0x1E);
			this.res_2VM = new UInt16HexField(doc, Name, "e_res[2]", startOffset + 0x20);
			this.res_3VM = new UInt16HexField(doc, Name, "e_res[3]", startOffset + 0x22);
			this.oemidVM = new UInt16HexField(doc, Name, "e_oemid", startOffset + 0x24);
			this.oeminfoVM = new UInt16HexField(doc, Name, "e_oeminfo", startOffset + 0x26);
			this.res2_0VM = new UInt16HexField(doc, Name, "e_res2[0]", startOffset + 0x28);
			this.res2_1VM = new UInt16HexField(doc, Name, "e_res2[1]", startOffset + 0x2A);
			this.res2_2VM = new UInt16HexField(doc, Name, "e_res2[2]", startOffset + 0x2C);
			this.res2_3VM = new UInt16HexField(doc, Name, "e_res2[3]", startOffset + 0x2E);
			this.res2_4VM = new UInt16HexField(doc, Name, "e_res2[4]", startOffset + 0x30);
			this.res2_5VM = new UInt16HexField(doc, Name, "e_res2[5]", startOffset + 0x32);
			this.res2_6VM = new UInt16HexField(doc, Name, "e_res2[6]", startOffset + 0x34);
			this.res2_7VM = new UInt16HexField(doc, Name, "e_res2[7]", startOffset + 0x36);
			this.res2_8VM = new UInt16HexField(doc, Name, "e_res2[8]", startOffset + 0x38);
			this.res2_9VM = new UInt16HexField(doc, Name, "e_res2[9]", startOffset + 0x3A);
			this.lfanewVM = new Int32HexField(doc, Name, "e_lfanew", startOffset + 0x3C);

			this.hexFields = new HexField[] {
				magicVM,
				cblpVM,
				cpVM,
				crlcVM,
				cparhdrVM,
				minallocVM,
				maxallocVM,
				ssVM,
				spVM,
				csumVM,
				ipVM,
				csVM,
				lfarlcVM,
				ovnoVM,
				res_0VM,
				res_1VM,
				res_2VM,
				res_3VM,
				oemidVM,
				oeminfoVM,
				res2_0VM,
				res2_1VM,
				res2_2VM,
				res2_3VM,
				res2_4VM,
				res2_5VM,
				res2_6VM,
				res2_7VM,
				res2_8VM,
				res2_9VM,
				lfanewVM,
			};
		}
Exemple #2
0
        public ImageDosHeaderVM(HexDocument doc, ulong startOffset)
        {
            this.magicVM    = new UInt16HexField(doc, Name, "e_magic", startOffset + 0);
            this.cblpVM     = new UInt16HexField(doc, Name, "e_cblp", startOffset + 2);
            this.cpVM       = new UInt16HexField(doc, Name, "e_cp", startOffset + 4);
            this.crlcVM     = new UInt16HexField(doc, Name, "e_crlc", startOffset + 6);
            this.cparhdrVM  = new UInt16HexField(doc, Name, "e_cparhdr", startOffset + 8);
            this.minallocVM = new UInt16HexField(doc, Name, "e_minalloc", startOffset + 0x0A);
            this.maxallocVM = new UInt16HexField(doc, Name, "e_maxalloc", startOffset + 0x0C);
            this.ssVM       = new UInt16HexField(doc, Name, "e_ss", startOffset + 0x0E);
            this.spVM       = new UInt16HexField(doc, Name, "e_sp", startOffset + 0x10);
            this.csumVM     = new UInt16HexField(doc, Name, "e_csum", startOffset + 0x12);
            this.ipVM       = new UInt16HexField(doc, Name, "e_ip", startOffset + 0x14);
            this.csVM       = new UInt16HexField(doc, Name, "e_cs", startOffset + 0x16);
            this.lfarlcVM   = new UInt16HexField(doc, Name, "e_lfarlc", startOffset + 0x18);
            this.ovnoVM     = new UInt16HexField(doc, Name, "e_ovno", startOffset + 0x1A);
            this.res_0VM    = new UInt16HexField(doc, Name, "e_res[0]", startOffset + 0x1C);
            this.res_1VM    = new UInt16HexField(doc, Name, "e_res[1]", startOffset + 0x1E);
            this.res_2VM    = new UInt16HexField(doc, Name, "e_res[2]", startOffset + 0x20);
            this.res_3VM    = new UInt16HexField(doc, Name, "e_res[3]", startOffset + 0x22);
            this.oemidVM    = new UInt16HexField(doc, Name, "e_oemid", startOffset + 0x24);
            this.oeminfoVM  = new UInt16HexField(doc, Name, "e_oeminfo", startOffset + 0x26);
            this.res2_0VM   = new UInt16HexField(doc, Name, "e_res2[0]", startOffset + 0x28);
            this.res2_1VM   = new UInt16HexField(doc, Name, "e_res2[1]", startOffset + 0x2A);
            this.res2_2VM   = new UInt16HexField(doc, Name, "e_res2[2]", startOffset + 0x2C);
            this.res2_3VM   = new UInt16HexField(doc, Name, "e_res2[3]", startOffset + 0x2E);
            this.res2_4VM   = new UInt16HexField(doc, Name, "e_res2[4]", startOffset + 0x30);
            this.res2_5VM   = new UInt16HexField(doc, Name, "e_res2[5]", startOffset + 0x32);
            this.res2_6VM   = new UInt16HexField(doc, Name, "e_res2[6]", startOffset + 0x34);
            this.res2_7VM   = new UInt16HexField(doc, Name, "e_res2[7]", startOffset + 0x36);
            this.res2_8VM   = new UInt16HexField(doc, Name, "e_res2[8]", startOffset + 0x38);
            this.res2_9VM   = new UInt16HexField(doc, Name, "e_res2[9]", startOffset + 0x3A);
            this.lfanewVM   = new Int32HexField(doc, Name, "e_lfanew", startOffset + 0x3C);

            this.hexFields = new HexField[] {
                magicVM,
                cblpVM,
                cpVM,
                crlcVM,
                cparhdrVM,
                minallocVM,
                maxallocVM,
                ssVM,
                spVM,
                csumVM,
                ipVM,
                csVM,
                lfarlcVM,
                ovnoVM,
                res_0VM,
                res_1VM,
                res_2VM,
                res_3VM,
                oemidVM,
                oeminfoVM,
                res2_0VM,
                res2_1VM,
                res2_2VM,
                res2_3VM,
                res2_4VM,
                res2_5VM,
                res2_6VM,
                res2_7VM,
                res2_8VM,
                res2_9VM,
                lfanewVM,
            };
        }