|
饭大看看这段代码可用吗?
::检测启动介质类型
root (ud) && goto :ud
checkrange 0x0 read 0x8280 && map (fd0) (fd1) && map --hook && goto :checkos
checkrange 0x80 read 0x8280 && goto :hdcheck
goto :cd
::所有其他启动盘、光盘启动、pxe启动作为光盘启动处理
::echo -P:1218 $[0105]未知的启动盘类型! && echo -P:1418 $[0105]按任意键重启。 && pause && reboot
exit
:ud
calc *0x82b8>>8&0xff-0x80 || goto :hdcheck
calc *0x82b8>>8&0xff-0x80 && map (fd0)+1 (hd) && map --hook && goto :checkos
exit
:cd
set cdd=off
goto :checkos
exit
:hdcheck
root (hd0,1) && goto :checkos
root (hd0,4) && goto :checkos
uuid (hd0,0)
if %?_UUID%==0000-0000 goto :usbhdd
goto :checkos
exit
::硬盘次序轮换,将U盘置于最后
:usbhdd
clear
set /a hd=*0x475&0xff+0x7e
if %hd%==127 echo -P:1218 $[0105]除U盘启动盘外无其他硬盘, 按任意键重启! && pause && reboot
:move
set /a hd1=%hd%+1
map (%hd1%) (%hd%)
set /a hd=%hd%-1
if not %hd%==127 goto :move
set /a hd=%hd%+1
map (%hd%) (hd-1)
map --hook
goto :checkos
exit
:checkos
rootnoverify (hd0,0)
find --set-root makeactive --status
if exist ()/windows/system32/version.dll goto :ms
if exist ()/winnt/system32/version.dll goto :ms
goto :noms
exit
::检测硬盘激活分区系统类型
:ms
map --mem ()/windows/system32/version.dll (rd) || map --mem ()/winnt/system32/version.dll (rd)
calc *0x82d0=*0x82d0+*0x82d8-0x800
calc *0x82d8=0x800
cat --locate=\0\0\x44\0\0\0 --number=1 (rd)+1 | set skip=
set /a skip=0x%skip%-0x30
cat --locate=\0\0\0 --skip=%skip% --number=1 (rd)+1 | set skip=
calc *0x82d0=*0x82d0+0x%skip%+3
call Fn.67 *0x82d0 0x60000 3
cat (md)0x300+1,1 | set nt_ver=NT
cat (md)0x300+1,3 | goto :_
:noms
set sys_ver=未知系统
goto :disp
exit
:_5.0
set sys_ver=Windows 2000
goto :disp
exit
:_5.1
set sys_ver=Windows XP
goto :disp
exit
:_5.2
set sys_ver=Windows 2003
goto :disp
exit
:_6.1
set sys_ver=Windows 7/2008
goto :disp
exit
:_6.2
set sys_ver=Windows 8
goto :disp
exit
:disp
set sys_hd=%@root%
clear
[ 本帖最后由 mygamexxx 于 2011-12-5 13:44 编辑 ] |
|