能力值:
( LV7,RANK:110 )
|
-
-
2 楼
|
能力值:
( LV13,RANK:500 )
|
-
-
3 楼
linux 下对设备直接读写就可以
|
能力值:
( LV7,RANK:110 )
|
-
-
4 楼
那U盘的文件名应该是什么呢 /dev/sdb ?
|
能力值:
( LV2,RANK:10 )
|
-
-
5 楼
用 dmesg 看 USB 变成哪一个 sd[x]. (sda, sdb, sdc, sdd, sde)
# sudo dmesg
scsi2 : SCSI emulation for USB Mass Storage devices
Vendor: Sunplus Model: MultiMedia-Disk Rev: 1.00
Type: Direct-Access ANSI SCSI revision: 02
SCSI device sda: 1974272 512-byte hdwr sectors (1011 MB)
sda: Write Protect is off
sda: Mode Sense: 55 53 42 43
sda: assuming drive cache: write through
SCSI device sda: 1974272 512-byte hdwr sectors (1011 MB)
sda: Write Protect is off
sda: Mode Sense: 55 53 42 43
sda: assuming drive cache: write through
sda: sda1
备份 /dev/sda 的 MBR
# sudo dd if=/dev/sda of=/tmp/mbr.backup bs=512 count=1
直接开 /dev/sda 读写即可 (要用 root 权限或 sudo)
|
能力值:
( LV2,RANK:10 )
|
-
-
6 楼
(造 /root/backup 目录)
# sudo mkdir -p /root/backup
(作备份)
# sudo dd if=/dev/sda of=/root/backup/mbr.bin bs=512 count=1
(清空为0, 不能读取)
# sudo dd if=/dev/zero of=/dev/sda bs=512 count=1
(存回去)
# dd if=/root/backup/mbr.bin of=/dev/sda bs=512 count=1
|
能力值:
( LV2,RANK:10 )
|
-
-
7 楼
// mbr.c
// gcc -o mbr.exe mbr.c
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#define LEN 512
int main()
{
int fd;
unsigned char buf[1000];
int ret;
int i;
fd = open("/dev/sda", O_RDWR);
ret = read(fd, buf, LEN);
for(i = 0; i < LEN; i++) {
buf[i] = buf[i] ^ 0x9d; // xor 简易加密, 第二次回复.
}
lseek(fd, 0, SEEK_SET);
write(fd, buf, LEN);
close(fd);
return 0;
}
|
能力值:
( LV7,RANK:110 )
|
-
-
8 楼
感谢各位 结贴了
|
|
|