|
16位实模式下U盘读操作应该如何进行(U盘引导)
关于USB模拟成软驱启动 如果运气好的话,U盘引导的操作系统其实很容易就完成了。例如,将系统的软盘映像haribote.img (osask项目里)用winhex直接复制到U盘的第一扇区开始的地方,U盘引导盘就完成了。cpu会用软驱模拟器启动USB,因此此模式下USB的读写和软盘相同。 通过实验,在我的Dell一体机里,可以成功引导并进入系统,和在虚拟机里看到的效果一样,可以响应键盘输入,但遗憾的是鼠标不能移动了(why?) ; 而在我的Thinkpad T410 笔记本里却引导失败(能进入引导程序,但加载系统失败,估计读写出了问题,难道启动USB的时候用的是硬盘模拟器而不是软盘模拟器?)。 /*****************************************/ 相关资料: http://board.flatassembler.net/topic.php?t=12389 摘录 USB Booting Secret #2: What happens in the boot sector, stays in the boot sector! When it comes to USB booting there are basically 4 types of computers: PC without USB, or with USB and can't boot USB because of old BIOS firmware. ;不支持USB启动 PC that always boots USB with floppy disk emulation. ;总是以软驱模拟器引导 PC that always boots USB with hard drive emulation. ;总是以硬盘驱动器模拟器引导 PC that examines the boot sector to determine the type of emulation and/or with BIOS selection setup.;根据BIOS的设置来决定模拟器类型 |
|
16位实模式下U盘读操作应该如何进行(U盘引导)
已重新发图 |
|
[求助]16位实模式下U盘读操作应该如何进行(U盘引导)
如果能够搞清楚大白菜U盘引导程序的那段反汇编代码的话,我相信我的问题也就解决了。如果能够有U盘读写的相关材料的话,我相信对此问题也会有很大帮助。 |
|
[求助]16位实模式下U盘读操作应该如何进行(U盘引导)
参考信息:INT 0x13 功能:磁盘读、写,扇区校验(verify),以及寻道(seek) AH=0x02;(读盘) AH=0x03;(写盘) AH=0x04;(校验) AH=0x0c;(寻道) AL=处理对象的扇区数;(只能同时处理连续的扇区) CH=柱面号&0xff; CL=扇区号(0-5位)|(柱面号&0x300)>>2; DH=磁头号; DL=驱动器号; ES:BX=缓冲地址;(校验及寻道时不使用) 返回值: FLAGS.CF==0:没有错误,AH==0 FLAGS.CF==1:有错误,错误号码存入AH内(与重置(reset)功能一样 ) |
|
[求助]16位实模式下U盘读操作应该如何进行(U盘引导)
参考信息:U盘,大白菜U盘引导程序反汇编代码 root@bt:~/Desktop# ndisasm -o 0x7c60 bcaiboot2 00007C60 31DB xor bx,bx 00007C62 8EDB mov ds,bx 00007C64 89DD mov bp,bx 00007C66 8ED3 mov ss,bx 00007C68 BC007C mov sp,0x7c00 00007C6B 06 push es 00007C6C 57 push di 00007C6D B80002 mov ax,0x200 00007C70 8EC0 mov es,ax 00007C72 40 inc ax 00007C73 B90100 mov cx,0x1 00007C76 89CE mov si,cx 00007C78 30F6 xor dh,dh 00007C7A E81A01 call word 0x7d97 00007C7D E86E00 call word 0x7cee 00007C80 8B3EAE21 mov di,[0x21ae] 00007C84 60 pushaw 00007C85 682002 push word 0x220 00007C88 803EAD2180 cmp byte [0x21ad],0x80 00007C8D 731F jnc 0x7cae 00007C8F B441 mov ah,0x41 00007C91 BBAA55 mov bx,0x55aa 00007C94 CD13 int 0x13 00007C96 7216 jc 0x7cae 00007C98 81EB55AA sub bx,0xaa55 00007C9C 7510 jnz 0x7cae 00007C9E F6C101 test cl,0x1 00007CA1 740B jz 0x7cae 00007CA3 58 pop ax 00007CA4 8EC0 mov es,ax 00007CA6 E87A00 call word 0x7d23 00007CA9 61 popaw 00007CAA FECE dec dh 00007CAC EB1E jmp short 0x7ccc 00007CAE 07 pop es 00007CAF 61 popaw 00007CB0 FEC6 inc dh 00007CB2 E8E200 call word 0x7d97 00007CB5 50 push ax 00007CB6 E82400 call word 0x7cdd 00007CB9 A2B021 mov [0x21b0],al 00007CBC 58 pop ax 00007CBD 86EE xchg ch,dh 00007CBF E8D500 call word 0x7d97 00007CC2 E81800 call word 0x7cdd 00007CC5 F636B021 div byte [0x21b0] 00007CC9 A2B121 mov [0x21b1],al 00007CCC C60609213C mov byte [0x2109],0x3c 00007CD1 A1B221 mov ax,[0x21b2] 00007CD4 40 inc ax 00007CD5 E84100 call word 0x7d19 00007CD8 EA9E230000 jmp word 0x0:0x239e 00007CDD A1FE23 mov ax,[0x23fe] ;0x7cdd 00007CE0 3D55AA cmp ax,0xaa55 00007CE3 7506 jnz 0x7ceb 00007CE5 E80600 call word 0x7cee 00007CE8 A1AE23 mov ax,[0x23ae] 00007CEB 29F8 sub ax,di 00007CED C3 ret ; 00007CEE 26813EB4014642 cmp word [es:0x1b4],0x4246 ;0x7cee 00007CF5 754F jnz 0x7d46 00007CF7 C3 ret ; 00007CF8 60 pushaw ; 00007CF9 31C0 xor ax,ax 00007CFB CD13 int 0x13 00007CFD 61 popaw 00007CFE 3C07 cmp al,0x7 00007D00 7604 jna 0x7d06 00007D02 B007 mov al,0x7 00007D04 EB06 jmp short 0x7d0c 00007D06 3C01 cmp al,0x1 00007D08 76A5 jna 0x7caf 00007D0A B001 mov al,0x1 00007D0C 80FEFF cmp dh,0xff 00007D0F 7503 jnz 0x7d14 00007D11 884402 mov [si+0x2],al 00007D14 A2AD21 mov [0x21ad],al 00007D17 EB6D jmp short 0x7d86 00007D19 29F8 sub ax,di 00007D1B 83DD00 sbb bp,byte +0x0 00007D1E 80FEFF cmp dh,0xff 00007D21 7526 jnz 0x7d49 00007D23 89C1 mov cx,ax ;0x7d23 start 00007D25 56 push si 00007D26 31C0 xor ax,ax 00007D28 50 push ax 00007D29 50 push ax 00007D2A 55 push bp 00007D2B 51 push cx 00007D2C 06 push es 00007D2D 53 push bx 00007D2E A0AD21 mov al,[0x21ad] 00007D31 39F0 cmp ax,si 00007D33 7602 jna 0x7d37 00007D35 89F0 mov ax,si 00007D37 50 push ax 00007D38 6A10 push byte +0x10 00007D3A 89E6 mov si,sp 00007D3C B442 mov ah,0x42 00007D3E E84500 call word 0x7d86 00007D41 83C410 add sp,byte +0x10 00007D44 5E pop si 00007D45 C3 ret ;0x7d23 end 00007D46 F4 hlt ;待机 00007D47 EBFD jmp short 0x7d46 00007D49 52 push dx 00007D4A 89EA mov dx,bp 00007D4C 89C1 mov cx,ax 00007D4E A0B021 mov al,[0x21b0] 00007D51 F626B121 mul byte [0x21b1] 00007D55 91 xchg ax,cx 00007D56 F7F1 div cx 00007D58 89C1 mov cx,ax 00007D5A 89D0 mov ax,dx 00007D5C F636B021 div byte [0x21b0] 00007D60 5A pop dx 00007D61 88C6 mov dh,al 00007D63 C0E506 shl ch,0x6 00007D66 08E5 or ch,ah 00007D68 86CD xchg cl,ch 00007D6A 0FB606B021 movzx ax,[0x21b0] 00007D6F 28C8 sub al,cl 00007D71 243F and al,0x3f 00007D73 3A06AD21 cmp al,[0x21ad] 00007D77 7603 jna 0x7d7c 00007D79 A0AD21 mov al,[0x21ad] 00007D7C 39F0 cmp ax,si 00007D7E 7602 jna 0x7d82 00007D80 89F0 mov ax,si 00007D82 B402 mov ah,0x2 ;**** 00007D84 FEC1 inc cl 00007D86 E80700 call word 0x7d90 00007D89 0F826BFF jc word 0x7cf8 00007D8D 30E4 xor ah,ah 00007D8F C3 ret ; .. 00007D90 60 pushaw ;0x7d90 00007D91 F9 stc 00007D92 CD13 int 0x13 00007D94 FB sti 00007D95 61 popaw 00007D96 C3 ret ; 00007D97 E8F6FF call word 0x7d90 ;0x7D97 00007D9A 72AA jc 0x7d46 00007D9C C3 ret ; 00007D9D 0000 add [bx+si],al 00007D9F 0000 add [bx+si],al 00007DA1 0000 add [bx+si],al 00007DA3 0000 add [bx+si],al 00007DA5 0000 add [bx+si],al 00007DA7 0000 add [bx+si],al 00007DA9 0000 add [bx+si],al 00007DAB 0000 add [bx+si],al 00007DAD 3F aas 00007DAE 0000 add [bx+si],al 00007DB0 3F aas 00007DB1 FF db 0xff 00007DB2 3F aas 00007DB3 004642 add [bp+0x42],al 00007DB6 42 inc dx 00007DB7 46 inc si 00007DB8 0000 add [bx+si],al 00007DBA 0000 add [bx+si],al 00007DBC 0000 add [bx+si],al 00007DBE 80FE0C cmp dh,0xc 00007DC1 330C xor cx,[si] 00007DC3 50 push ax 00007DC4 65EB00 gs jmp short 0x7dc7 00007DC7 BF0C00 mov di,0xc 00007DCA 00B16B00 add [bx+di+0x6b],dh 00007DCE 0000 add [bx+si],al 00007DD0 0000 add [bx+si],al 00007DD2 0000 add [bx+si],al 00007DD4 0000 add [bx+si],al 00007DD6 0000 add [bx+si],al 00007DD8 0000 add [bx+si],al 00007DDA 0000 add [bx+si],al 00007DDC 0000 add [bx+si],al 00007DDE 0000 add [bx+si],al 00007DE0 0000 add [bx+si],al 00007DE2 0000 add [bx+si],al 00007DE4 0000 add [bx+si],al 00007DE6 0000 add [bx+si],al 00007DE8 0000 add [bx+si],al 00007DEA 0000 add [bx+si],al 00007DEC 0000 add [bx+si],al 00007DEE 0000 add [bx+si],al 00007DF0 0000 add [bx+si],al 00007DF2 0000 add [bx+si],al 00007DF4 0000 add [bx+si],al 00007DF6 0000 add [bx+si],al 00007DF8 0000 add [bx+si],al 00007DFA 0000 add [bx+si],al 00007DFC 0000 add [bx+si],al 00007DFE 55 push bp 00007DFF AA stosb |
|
[求助]16位实模式下U盘读操作应该如何进行(U盘引导)
参考信息:软盘,读入10个柱面 osask_ipl10.nas ; haribote-ipl ; TAB=4 CYLS EQU 10 ; ORG 0x7c00 ;指明程序的装载地址 ; 以下这段是标准FAT12格式软盘专用代码 书P24 JMP entry DB 0x90 DB "HARIBOTE" ; 驱动区的名称可以是任意的字符串(8字节) DW 512 ; 每个扇区(sector)的大小(必须是512字节) DB 1 ; 簇(cluster)的大小(必须为1个扇区) DW 1 ; FAT的起始位置(一般从第一个扇区开始) DB 2 ; FAT的个数(必须为2) DW 224 ; 根目录的大小(一般设成224项) DW 2880 ; 该磁盘的大小(必须是2880扇区) DB 0xf0 ; 磁盘的种类(必须是0xf0) DW 9 ; FAT的长度(必须是9扇区) DW 18 ; 一个磁道(track)有几个扇区(必须是18) DW 2 ; 磁头数(必须是2) DD 0 ; 不使用分区,必须是0 DD 2880 ; 重写一次磁盘大小 DB 0,0,0x29 ; 意义不明,固定 DD 0xffffffff ; (可能是)卷标号码 DB "HARIBOTEOS " ; 磁盘的名称(11字节) DB "FAT12 " ; 磁盘格式名称(8字节) RESB 18 ; 先空出18字节 ; 程序主体 entry: MOV AX,0 ; 初始化寄存器 MOV SS,AX MOV SP,0x7c00 MOV DS,AX ; 读磁盘 P50 MOV AX,0x0820 MOV ES,AX MOV CH,0 ; 柱面0 MOV DH,0 ; 磁头0 MOV CL,2 ; 扇区2 readloop: MOV SI,0 ; 记录失败次数的寄存器 retry: MOV AH,0x02 ; AH=0x02 : 读入磁盘 MOV AL,1 ; 1个扇区 MOV BX,0 MOV DL,0x00 ; A驱动器 INT 0x13 ; 调用磁盘BIOS JNC next ; 没出错时跳转到next ADD SI,1 ; 往SI加1 CMP SI,5 ; 比较SI与5 JAE error ; SI>=5时,跳转到error MOV AH,0x00 MOV DL,0x00 ; A驱动器 INT 0x13 ; 重置驱动器 JMP retry next: MOV AX,ES ; 把内存地址后移0x200(200H=512D) ADD AX,0x0020 MOV ES,AX ; 因为没有ADD ES,0x020指令,所以这里稍微绕个弯 ADD CL,1 ; 往CL里加1 CMP CL,18 ; 比较CL与18 JBE readloop ; 如果CL<=18跳转至readloop MOV CL,1 ADD DH,1 CMP DH,2 JB readloop ; 如果DH<2,跳转到readloop P53 MOV DH,0 ADD CH,1 CMP CH,CYLS JB readloop ; 如果CH<CYLS,则跳转到readloop ; 読み終わったのでharibote.sysを実行だ! MOV [0x0ff0],CH ; 将CYLS的值写到内存地址0x0ff0中。IPLがどこまで読んだのかをメモ JMP 0xc200 error: MOV SI,msg putloop: MOV AL,[SI] ADD SI,1 ; 往SI加1 CMP AL,0 JE fin MOV AH,0x0e ; 显示一个文字 MOV BX,15 ; 指定字符颜色 INT 0x10 ; 调用显卡BIOS JMP putloop fin: HLT ; 让CPU停止,等待指令 JMP fin ; 无限循环 msg: DB 0x0a, 0x0a ; 换行2次 DB "load error" DB 0x0a ; 换行 DB 0 RESB 0x7dfe-$ ; 0x7dfeまでを0x00で埋める命令 DB 0x55, 0xaa |
|
关于保护模式下读U盘和硬盘
你好,请问你知道16位实模式下U盘读操作该怎么进行吗? 我现在想把一个软盘引导的系统改成u盘引导的系统,我的理解是系统本身是不需要修改的(读到内存里都一样,不必关心怎么读进来的),但引导区程序需要修改,因为软盘和U盘存储结构不同,虽然都用int 0x13进行读操作,但是读的过程和方法显然是不同的。软盘属于磁盘,有磁头、柱面等概念,但U盘不属于磁盘,U盘用的是闪存。 |
|
简单CrackMe求破解
哈哈,大神请看下题,超级难的 |
|
简单CrackMe求破解
大哥,这不是破解正版软件啦,这是crackme |
|
[注意]我每天都上几小时,怎么不给cb啊
需要不断的刷新网页。你可以用程序来搞定 |
|
求助] 超不好理解的简短C代码
3,4楼 up #include <stdio.h> typedef struct _NUM { unsigned char a :1; unsigned char b :1; unsigned char c :1; unsigned char d :1; unsigned char e :1; unsigned char f :1; unsigned char g :1; unsigned char h :1; }NUM; int main() { char TTT = 0xff; NUM num ={0}; num=*((NUM*)&TTT); printf( "%x\n", num.a ); return 0; } |
|
想学破解没条件了, 悲哀.。。。。
时间就像吸了水的海绵,挤挤总是会有的。关键还是看是否有兴趣吧,那种热情是很可贵的 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值