1 00:00:00,210 --> 00:00:02,940 So in this would already be talking about the section headers. 2 00:00:02,940 --> 00:00:10,980 So each section contains the headers and these headers are joined in a single chunk. 3 00:00:11,960 --> 00:00:15,350 So this section headers contains the name. 4 00:00:15,350 --> 00:00:19,190 So this name takes eight bytes. 5 00:00:19,190 --> 00:00:21,560 So the name should not be more than eight bytes. 6 00:00:21,560 --> 00:00:23,840 And the second feature is virtual size. 7 00:00:24,670 --> 00:00:28,330 And what's your address size R for our data pointer to our data. 8 00:00:28,330 --> 00:00:31,480 So are we discussing all of this in this video? 9 00:00:32,570 --> 00:00:38,450 So how to identify is the ending of the option header is the starting of the first section header. 10 00:00:38,810 --> 00:00:40,820 This is very easy to. 11 00:00:43,180 --> 00:00:47,440 The section headers are easy to locate because they start with the name. 12 00:00:47,440 --> 00:00:54,910 So the name you can search for the DOT text here and you will be directed to this one dot text. 13 00:00:54,910 --> 00:00:58,720 And here you can see in the plain text format, dot text. 14 00:00:59,440 --> 00:01:05,260 So at the starting of this, this is our section header. 15 00:01:06,850 --> 00:01:13,380 So the size is 40 bytes and that means that PT two and eight. 16 00:01:13,390 --> 00:01:15,940 So this is the first section header. 17 00:01:16,090 --> 00:01:18,820 So let's see what are the contents of this header. 18 00:01:19,060 --> 00:01:20,620 So the first one is the name. 19 00:01:20,620 --> 00:01:22,360 So the name tag eight bytes. 20 00:01:22,360 --> 00:01:25,210 So let's consider these first eight bytes. 21 00:01:25,840 --> 00:01:33,040 And here you can see if you convert this X to, uh, ASCII representation and look up in the table, 22 00:01:33,040 --> 00:01:34,690 you will get this, uh, dot text. 23 00:01:35,020 --> 00:01:39,990 So that identifies the section name and second one is virtual size. 24 00:01:40,570 --> 00:01:45,550 So whenever I say virtual, so that means that is in the memory. 25 00:01:49,040 --> 00:01:50,230 What size? 26 00:01:50,360 --> 00:01:56,030 The size of this section in memory and virtual address. 27 00:01:56,030 --> 00:02:02,630 So what your address is the offset from the base address where this section should start. 28 00:02:03,040 --> 00:02:11,810 So if the base address is like 20,000, then virtual address. 29 00:02:14,340 --> 00:02:17,670 He's at 400. 30 00:02:18,420 --> 00:02:26,460 And then the text and the section starts at 20,400. 31 00:02:27,660 --> 00:02:35,190 So the base setter should be added to this virtual address because this is an offset to determine the 32 00:02:35,190 --> 00:02:38,520 starting location of the this section. 33 00:02:39,260 --> 00:02:40,680 That is called a virtual address. 34 00:02:40,700 --> 00:02:45,080 The offset from the base address and the next one is size for our data. 35 00:02:45,200 --> 00:02:52,160 So size of determines the size of this section in the disk. 36 00:02:53,740 --> 00:02:55,750 So signs are for our data on the disk. 37 00:02:57,300 --> 00:02:59,160 And the pointer to the data. 38 00:02:59,520 --> 00:03:07,320 So the pointer to raw data where that means on the disk, at which byte offset this section starts. 39 00:03:07,320 --> 00:03:15,840 So here where you have virtual size and size of raw data, different means sometimes you will have file 40 00:03:15,840 --> 00:03:16,470 arrangement. 41 00:03:16,470 --> 00:03:24,000 So the file element says, uh, the file sections, sections in the file should start it. 42 00:03:24,600 --> 00:03:25,810 It's a 200 hitch. 43 00:03:27,390 --> 00:03:39,750 But unfortunately our section only takes 50 hits and that means remaining 150, which are filled with 44 00:03:40,020 --> 00:03:40,860 zeros. 45 00:03:42,580 --> 00:03:46,390 And this space is not to utilize it because of this file arrangement. 46 00:03:46,390 --> 00:03:52,330 And these are filled with zeros and the virtual size is only 50. 47 00:03:53,080 --> 00:03:59,770 In this case, because we don't want these 150 zeros in the memory. 48 00:03:59,770 --> 00:04:02,450 So that's why the virtual size is defined away. 49 00:04:02,470 --> 00:04:05,800 Actual data without any zeros. 50 00:04:06,190 --> 00:04:10,420 So this is the size of raw data. 51 00:04:12,090 --> 00:04:16,230 Actual data that is 58 and the remaining. 52 00:04:19,220 --> 00:04:19,490 Sorry. 53 00:04:19,520 --> 00:04:19,850 Sorry. 54 00:04:19,880 --> 00:04:23,990 Size of raw data is 50 plus this one as well. 55 00:04:24,290 --> 00:04:26,630 But what you'll see is only 50. 56 00:04:26,870 --> 00:04:31,080 Because we don't want to consider these zeros in memory. 57 00:04:31,100 --> 00:04:34,390 So it will take more space in memory. 58 00:04:34,400 --> 00:04:39,920 So that's why there is another field of our choices to determine the actual data that are required in 59 00:04:39,920 --> 00:04:40,520 the memory. 60 00:04:41,480 --> 00:04:45,350 So I hope you got the difference between the size of the data and virtual size. 61 00:04:45,620 --> 00:04:47,810 Now the pointer to raw data. 62 00:04:47,810 --> 00:04:58,400 So at the buy at this byte area at which offset this section data starts. 63 00:05:00,730 --> 00:05:06,160 And the pointer to relocations, pointer to line numbers and number of relocations, number of write 64 00:05:06,190 --> 00:05:06,850 numbers. 65 00:05:07,060 --> 00:05:16,840 So these can be you can see here, the next four bytes are the actual size that is zero 140 and the 66 00:05:16,840 --> 00:05:19,690 next four weights are 1000. 67 00:05:20,200 --> 00:05:28,470 But your address and size are for our data next for bytes 1 to 0 zero and the next one is pointer to 68 00:05:28,470 --> 00:05:30,220 raw data 4000. 69 00:05:31,340 --> 00:05:36,620 And if you go to 400, it will be the text section. 70 00:05:38,150 --> 00:05:40,190 So here you can see 400. 71 00:05:41,000 --> 00:05:42,830 The text section starts. 72 00:05:47,010 --> 00:05:50,430 This is the raw data. 73 00:05:50,430 --> 00:05:51,150 Raw data. 74 00:05:51,160 --> 00:05:52,720 So for zero zero. 75 00:05:52,740 --> 00:06:02,280 If you go to the offset of zero hour text, the section data starts and we'll be reading from here. 76 00:06:04,340 --> 00:06:07,310 The amount of bytes required for this virtual cell. 77 00:06:07,310 --> 00:06:14,240 So 50 hich in this example will be read from this pointer and will be in memory. 78 00:06:14,240 --> 00:06:20,630 So we'll be doing that in the upcoming videos and the next location and line numbers are zero and are 79 00:06:20,630 --> 00:06:21,830 only last number. 80 00:06:21,860 --> 00:06:23,390 That is characteristics. 81 00:06:23,390 --> 00:06:30,770 So these characteristics define whether the section is readable, readable or executable characteristics. 82 00:06:41,780 --> 00:06:47,450 So this section flags here, you can see these are the flags you need to add them. 83 00:06:47,960 --> 00:06:53,430 And here we have the value 60000020. 84 00:06:53,450 --> 00:06:56,240 So that means the main is six. 85 00:06:56,240 --> 00:06:58,190 So you get four six. 86 00:06:59,060 --> 00:06:59,810 And. 87 00:07:02,730 --> 00:07:05,940 Section 1132 bits that two divides. 88 00:07:07,820 --> 00:07:08,630 And. 89 00:07:10,410 --> 00:07:17,940 And so to zero means section contains executable code and for zero contents we have four zero. 90 00:07:17,940 --> 00:07:19,170 No we don't have four zero. 91 00:07:19,170 --> 00:07:20,520 So only executable. 92 00:07:20,700 --> 00:07:24,690 So all of this data no need to manually pass. 93 00:07:24,690 --> 00:07:28,230 So P we're already parses this information. 94 00:07:28,230 --> 00:07:32,610 So starting from here to 1 to 4, you cannot go. 95 00:07:32,610 --> 00:07:36,990 There is no pointer to this starting of this text. 96 00:07:38,070 --> 00:07:46,860 You can just here you can see only a directory parses and shows you the information so you can see readable 97 00:07:46,860 --> 00:07:50,820 and executable characteristics or address and there are cells. 98 00:07:50,820 --> 00:07:59,040 So this will add 400120 to this ending size and virtual address. 99 00:07:59,040 --> 00:08:02,760 What you will see is if you going to add this, you will get this result. 100 00:08:05,040 --> 00:08:09,330 In the same way, if you click on this, the next section and the next section as well. 101 00:08:12,090 --> 00:08:18,810 So I hope you have understood this section headers this this is also important header and if you got 102 00:08:18,810 --> 00:08:25,530 confused about this base or whatever address size and size are for it and point it rather don't worry 103 00:08:25,530 --> 00:08:28,890 when we are loading this. 104 00:08:32,500 --> 00:08:38,170 File writes from from disk to memory, then we understand very clearly. 105 00:08:39,740 --> 00:08:41,480 And sometimes I forgot to say. 106 00:08:42,410 --> 00:08:44,330 What you're saying is. 107 00:08:45,340 --> 00:08:48,790 Will it be greater than our size? 108 00:08:49,180 --> 00:08:58,330 Because whenever you declare some global variables, then we don't grow our variables and an initial 109 00:08:58,540 --> 00:09:05,330 is data, then we don't know how much those arrays could take, so we can't. 110 00:09:05,830 --> 00:09:07,420 Those are very dynamic areas. 111 00:09:08,740 --> 00:09:10,840 Those will grow upon the user input. 112 00:09:10,840 --> 00:09:16,810 So those areas we can define how much size it will take. 113 00:09:16,810 --> 00:09:22,420 So there will be extra bytes for this virtual size. 114 00:09:22,690 --> 00:09:28,480 So on the disk, there is no point of storing these because we don't know those values. 115 00:09:28,480 --> 00:09:35,260 So that's why the virtual size will be greater than the size of the section in the disk. 116 00:09:35,980 --> 00:09:38,440 Because of this dynamic data. 117 00:09:39,100 --> 00:09:41,840 So this is also one point should be remember. 118 00:09:41,860 --> 00:09:46,120 So anyway, we'll be just loading the. 119 00:09:48,180 --> 00:09:51,330 What you're saying is amount of bytes from the disk.