NTFS分区的引导记录源代码

NTFS分区的引导记录源代码
NTFS文件系统具有很好的特性,其安全性和可靠性远远优于普通FAT文件系统,但微软公司仅在Windows NT NT操作系统中使用了优秀的文件系统,未经规范地将其发布为商业用途。
U3000 U3000
但是祖先们唱得很好:没有枪,没有枪,敌人制造了我们!不管微软如何保持它的保密性,它总是使用NTFS文件系统本身,然后我们通过分析它的代码来研究NTFS文件系统的规范。这里是年轻人在仔细分析Windows 2000构建的2195版本NTFS分区引导记录源代码时,与各位朋友分享
U3000 U3000
这个代码编译和汇编6.11.the数据是分区结构相关的通过只适用于细分的细分,当引用,请自行更换正确的价值。
U3000 U3000
U3000 U3000
486。
标题Windows 2000的Windows 2195启动
U3000 U3000
公共use16'code字节的代码段
假设cs:代码,DS,代码
NTFS远过程
开始:JMP SHORT Loader
DB 90h
U3000 U3000
partitionid db'ntfs
BytePerSector DW 512
sectorpercluster分贝1
sectornumwanted DW 0
sectorwanted DD 0
supportextendint13flag分贝0
0f8h蓄分贝
DB 0,0
sectorpertrack DW 3fh
数据仓库0ffh头
hiddensector DD 3fh
chsmaxsectornum DD 0
currentdisk DB 81h
DB 0,8,0
sectorsinpartition DD 3e81ffh
DD 0
mftposition DD 0c5a70h
DD 0
mftmirrposition DD 1fcd0ah
DD 0
clusterperfrs DD 2
DB 08h,0,0,0,0f6h,79h
DB 58h,5ch,0bbh,58h,5ch,0f4h
DB 0,0,0,0
U3000 U3000
加载程序:CLI;禁用中断
异或斧
MOV SS、斧
MOV SP,7c00h;初始化堆栈
启用中断
MOV AX,7c0h
MOV DS,斧
电话getchsmaxsectornum
MOV AX,0d00h
MOV AX ES,
异或BX,BX
MOV BYTE PTR DS:{ sectornumwanted },10h
电话readsector
推0d00h
推26ah
RETF
NTFS ENDP
-----------------------------------------------------------------------------;
getchsmaxsectornum proc附近
MOV DL,DS:{ currentdisk }
MOV啊,8
INT 13H
JNC丢失
MOV CX,0ffffh
MOV DH,CL
U3000 U3000
失:movzx eax,DH
公司的斧头
movzx EDX,CL
AND DL, 3FH
穆尔DX
xchg Cl,CH
CH 6
公司CX
movzx ECX,CX
穆尔ECX
MOV DS:chsmaxsectornum,eax
RET
getchsmaxsectornum ENDP
-----------------------------------------------------------------------------;
issupportextendint13 proc附近
MOV AH,41h
MOV BX,55aah
MOV DL,DS:currentdisk
INT 13H;是支持扩展INT 13H
JC短支持;如果进位跳跃
CMP BX,0aa55h
JNE短支持;不等于跳转
测试CL,1
JZ短支持;零转移
公司BYTE PTR DS:supportextendint13flag
U3000 U3000
NotSupport:RET
issupportextendint13 ENDP
-----------------------------------------------------------------------------;
功能:读取数表示的wantedsecotrnum } {在} {部门wantedsector ES:BX
readsector proc附近
pushad;保存所有寄存器
将DS
push
U3000 U3000
GetReadParam:mov eax,DS:{ sectorwanted }
添加eax,DS:{ hiddensector }
CMP EAX, DS:{CHSMaxSectorNum}
JB在PTR readbyoldint13
扇区数小于chsmaxsectornum起源,使用INT 13H
将DS
推DWORD PTR 0
DB 66h,6ah,0
压入
push
P
布什BX
将DWORD PTR 10010h
CMP BYTE PTR DS:supportextendint13flag,0
JNE在PTR支持
电话issupportextendint13
CMP BYTE PTR DS:supportextendint13flag,0
我在PTR fatalfault
U3000 U3000
支持:MOV啊,42h
MOV DL,DS:{ currentdisk }
推SS
流行的DS
第四,SP
INT 13H读部门;
流行中
弹出时
流行的ES
流行中
流行中
流行的DS
JMP短onesectorread
U3000 U3000
readbyoldint13:XOR EDX能谱
movzx ECX,字sectorpertrack PTR DS:{ }
DIV ECX
公司DL
MOV CL,DL
mov eax edx
SHR EDX,10h
DIV字PTR DS:{头}
xchg DL,DH
MOV DL,DS:{ currentdisk }
MOV CH,AL
SHL啊,6
或CL,AH;建立读扇区参数
MOV AX,201h
INT 13H读部门;
U3000 U3000
onesectorread:JC在PTR fatalfault;读取错误关闭
MOV AX,ES
把斧头,20h
MOV AX ES,
公司sectorwanted DWORD PTR DS:{ }
月字PTR DS:{ sectornumwanted }
锦州getreadparam;Fixup参数
流行的ES
流行的DS
POPAD;恢复所有的法规
RET
U3000 U3000
FatalFault::MOV AL,readdiskerroroffset
readsector ENDP
-----------------------------------------------------------------------------;
DispFatalMsg:: CALL PrintString
MOV AL,shutdownmsgoffset
电话printstring;显示关闭消息
启用中断
U3000 U3000
关机:JMP短关机;崩溃
-----------------------------------------------------------------------------;
printstring proc附近
MOV啊,1
第四,斧
U3000 U3000
LoadChar:lodsb
CMP铝,0
短printstringend JZ
MOV AH,0eh
MOV BX,7
INT 10H
JMP短loadchar
U3000 U3000
PrintStringEnd:RET
printstring ENDP
-----------------------------------------------------------------------------;
readdiskerror DB 0Dh,0ah,磁盘读取错误,0
missntldrerror DB 0Dh,0ah,'ntldr失踪,0
ntldrcompressed DB 0Dh,0ah,'ntldr是压缩的,0
shutdownmsg DB 0Dh,0ah,'press CTRL+ALT+DEL重启',0Dh,0ah,0
DB 13杯(0)
readdiskerroroffset DB 83h;偏移readdiskerror
missntldrerrormsg DB 0A0H;偏移missntldrerror
ntldrcomperssedoffset DB 0b3h;偏移ntldrcompressed
shutdownmsgoffset DB 0c9h;偏移shutdownmsg
分贝0, 0
bootvalidflag DW 0aa55h
U3000 U3000
unicodentldr DW 5
db n
U3000 U3000
UnicodeDirectory:
DW 4
db
attributepoint DD 0e000h
mftpoint DD 3000h
mftnumber DD 0
temprootbuffer DD 0
tempdirbuffer DD 0
tempbitmapbuf DD 0
rootattribute DD 0
direntrylist DD 0
bitmapattribute DD 0
tempmft DD 0
DD 0
tempdatabuf DD 0
bitamppoint DD 0
paramtailpoint DD 0
bytepercluster DD 0
mftsize DD 0
MFTSizeBySector DD 909012ebh
mfttail DD 0
byteperrecord DD 0
data_46 DD 0
sectorperrecord DD

U3000 U3000
启动:MOV AX,CS
MOV DS,斧
SHL AX,4
CLI
MOV SP,AX;初始化堆栈
启用中断
电话getchsmaxsectornum
movzx EAX,PTR { BytePerSector }字
movzx ebx,BYTE PTR { SectorPerCluster }
穆尔EBX
bytepercluster MOV { },EAX
mov ecx,{ ClusterPerFRS }
CMP氯,0
JG在PTR ismftsize
U3000 U3000
NEG CL
mov eax,1
SHL eax,CL
JMP短loc_14
DB 90h
U3000 U3000
ismftsize:mov eax,BytePerCluster
穆尔ECX
U3000 U3000
loc_14:MOV { mftsize },EAX
movzx EBX,PTR { BytePerSector }字
异或能谱
DIV EBX
MOV EAX;} { mftsizebysector,扇区数的计数occurpied MFT
打电话给FindLastMFT
mov ecx,{ ParamTailPoint }
MOV { TempRootBuffer },ECX
添加ECX,{ mftsize }
MOV { TempDirBuffer },ECX
添加ECX,{ mftsize }
tempbitmapbuf MOV { },ECX
添加ECX,{ mftsize }
tempmft MOV { },ECX
添加ECX,{ mftsize }
tempdatabuf MOV { },ECX
mov eax,90h
mov ecx,{ TempRootBuffer }
电话getattributepos
或eax,eax
JZ fatalfault
rootattribute MOV { },EAX
mov eax,口
mov ecx,{ TempDirBuffer }
电话getattributepos
{ dirent MOV
免责声明:本网信息来自于互联网,目的在于传递更多信息,并不代表本网赞同其观点。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,并请自行核实相关内容。本站不承担此类作品侵权行为的直接责任及连带责任。如若本网有任何内容侵犯您的权益,请及时联系我们,本站将会在24小时内处理完毕。
相关文章
返回顶部