Answer the question
In order to leave comments, you need to log in
EXT2 where on disk is the dir_entry structure?
Directories in ext2 are described by the dir_entry structure, which stores the inode number, name, and so on.
Attention, question! Where on disk is this dir_entry structure located? I thought that the link to the block with this structure would be stored in the corresponding inode directory (i_mode&0x4000 != 0), but I was wrong - when I go to i_block[0], I get some strange garbage. Link to the disk image I'm working with
Answer the question
In order to leave comments, you need to log in
More specifically, what is the problem? Where is the garbage?
I studied the image for interest: at offset 0x5000 (4KiB blocks, 5th block) there is the first inode table, the second entry in it corresponds to the root directory, i_block[0] points to block A5, at offset A5000 we find the dir_entry table:
00000A5000: 02 00 00 00 0C 00 01 02 │ 2E 00 00 00 02 00 00 00 ☻ ♀ ☺☻. ☻
00000A5010: 0C 00 02 02 2E 2E 00 00 │ 0B 00 00 00 14 00 0A 02 ♀ ☻☻.. ♂ ¶ ◙☻
00000A5020: 6C 6F 73 74 2B 66 6F 75 │ 6E 64 00 00 0C 00 00 00 lost+found ♀
00000A5030: 10 00 05 01 31 30 32 34 │ 6B 00 00 00 0D 00 00 00 ► ♣☺1024k ♪
00000A5040: 10 00 05 01 34 30 39 36 │ 6B 00 00 00 0E 00 00 00 ► ♣☺4096k ♫
00000A5050: 10 00 05 01 38 31 39 32 │ 6B 00 00 00 0F 00 00 00 ► ♣☺8192k ☼
00000A5060: 10 00 06 01 31 36 33 38 │ 34 6B 00 00 10 00 00 00 ► ♠☺16384k ►
00000A5070: 10 00 06 01 36 35 35 32 │ 33 6B 00 00 11 00 00 00 ► ♠☺65523k ◄
00000A5080: 0C 00 04 02 64 69 72 30 │ 12 00 00 00 0C 00 04 02 ♀ ♦☻dir0↕ ♀ ♦☻
00000A5090: 64 69 72 31 17 00 00 00 │ 24 00 19 02 53 79 73 74 dir1↨ $ ↓☻Syst
00000A50A0: 65 6D 20 56 6F 6C 75 6D │ 65 20 49 6E 66 6F 72 6D em Volume Inform
00000A50B0: 61 74 69 6F 6E 00 00 00 │ 19 00 00 00 48 0F 0A 02 ation ↓ H☼◙☻
00000A50C0: 79 6F 75 74 75 62 65 2D │ 64 6C 00 00 00 00 00 00 youtube-dl
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question