|
我重写了一个:
- !BAT by sratlf,hotdll@20120608,Mod By 2011czmxbb52
- checkrange 20111103:-1 read 0x8278 > nul || clear && echo -e \n Not supported grub4dos version!\n && exit 1
- map --mem=0x20000 %~f0 (rd) > nul
- cat --locate=\x1f\x8b --number=1 (rd)+1 > nul || exit 2
- calc *0x82d8=*0x82d8-%?% > nul
- calc *0x82d0=*0x82d0+%?% > nul
- map --mem (rd)+1 (hd-1,0) > nul
- map --rehook
- set /a cs=0
- insmod (hd-1,0)/chkpci
- echo -e -n ;@hotdll\r\n > (hd-1,0)/DRV.INI
- chkpci -srs | call :write_ID SRS
- chkpci -cc:0x02 | call :write_ID NET
- echo -e ;@sratlf >> (hd-1,0)/DRV.INI
- :write_ID
- set /a cs=%cs%+1
- if /i "%2"=="" exit 3
- set ID=%~2
- if /i "%ID:~0,8"=="PCI\VEN_" set /a VEN=%ID:~8,4 && echo -e -n %1%cs%:VEN:%VEN%\r\n >> (hd-1,0)/DRV.INI && echo -e -n %1%cs%:ID:%ID%\r\n%1%cs%:HID:%ID:~:13"\r\n && if /i "%ID:~0,8"=="PCI\VEN_" set /a VEN=%ID:~8,4 && echo -e -n %1%cs%:VEN:%VEN%\r\n >> (hd-1,0)/DRV.INI && echo -e -n %1%cs%:ID:%ID%\r\n%1%cs%:HID:%ID:~:13"\r\n >> (hd-1,0)/DRV.INI
- if /i "%ID:~0,8"=="PCI\VEN_" || shift 2 && goto :write_ID
复制代码
生成的文件格式:
;@hotdll
SRS1:VEN:xxxx
SRS1:ID:PCI\VEN_xxxx&DEV_xxxx
SRS1:HID:DEV_xxxx
NET1:VEN:xxxx
NET1:ID:PCI\VEN_xxxx&DEV_xxxx
NET1:HID:DEV_xxxx
;@sratlf
[ 本帖最后由 2011czmxbb52 于 2012-6-8 21:58 编辑 ] |
|