goon83 发表于 2006-12-12 22:31:12

Help!!!!!!有人硬盘上直接 读过 数据吗?

在Linux下 为了读superblock的信息:用以下命令:

dd if=/dev/sda3 bs=4096 count=1 |od -tx1 -Ax>temp
(sda3 为我的Linux的安装分区)

这样就得到了superblock 的十六进制的信息 放入temp

然后通过 stat -f 也可以得到一部分filesytem的信息, 比如可用的空余inode 节点数。
假设空余的inode数为1000。

按理说 可以在temp中找到 31 30 30 30。
可是我却不能够找到。


不明白 是什么原因。

希望 各位 给与 帮助。。。谢谢

loveccy 发表于 2006-12-13 12:49:42

前天我就看见那个英文的帖子了,猛一看一个中国字都没有,以为又是卖野药的广告呢。 :twisted: 不过我也不懂这个……

今天我看了看内核里的文档,/usr/src/linux/Documentation/filesystems/ext2.txt,它说``The primary copy of the superblock is stored at an offset of 1024 bytes from the start of the device ...‘’,另外在 block groups 里边也有备份的。

一开始我就不明白你说的 `31 30 30 30‘ 是哪儿来的。后来终于灵机一动明白了,这是 ascii 码?!呵呵,磁盘上保存的肯定是二进制的整数啊,不可能是 ascii 码。 :mrgreen:

试验:

# dd if=/dev/hda7 bs=1024 count=4 skip=1 | hd > temp.txt

$ stat -f /boot
File: "/boot"
    ID: 0      Namelen: 255   Type: ext2/ext3
Blocks: Total: 97826      Free: 95763      Available: 90544      Size: 1024
Inodes: Total: 52208      Free: 52182

$ grep "f0 cb" temp.txt # 0xcbf0 == 52208
00000000f0 cb 00 00 c7 97 01 0063 14 00 00 13 76 01 00|........c....v..|

$ grep "d6 cb" temp.txt # 0xcbd6 ==52182
00000010d6 cb 00 00 01 00 00 0000 00 00 00 00 00 00 00|................|

goon83 发表于 2006-12-13 15:08:05

哪天的系统有点 问题 , 所以只能用英语,不好意识 。

谢谢你 的帮助。 :!::!::!::!:   :!:

gnap 发表于 2006-12-17 12:49:06

建议读一下The Sleuth Kit 的源代码。

goon83 发表于 2006-12-22 12:59:59

好的 谢谢了
页: [1]
查看完整版本: Help!!!!!!有人硬盘上直接 读过 数据吗?