|
貌似被我改复杂了
- :root_path
- if "%~1"=="" && exit
- set tmp=%~1
- cat --locatei="%tmp:~-16%" %inipath% | call :hwid_check %~1 %@retval%
- if "%tmp%"=="" && exit
- if %tmp%<=1024 && calc %tmp% > nul ! calc 1024 > nul
- call :get_char %tmp% %@retval% "xA[" || exit
- ::tmp值为最近[位置
- set /a tmp=%?% + 2 > nul
- cat --skip=%tmp% --locate="]" --number=1 %inipath% > nul || exit
- calc %?% - %tmp% > nul
- cat --skip=%tmp% --length=%@retval% %inipath% > (md)0x200+1
- cat --locate=\x2D --replace=\x2F (md)0x200+1 > nul
- cat (md)0x200+1 | set /u root=D/M/
- set tmp=
- exit
- ::tmp值为匹配ID位置
- :hwid_check
- set tmp=
- if "%~3"=="" && exit
- ::行首为ms_
- set tmp=0x%~3
- if %tmp%<=512 && calc %tmp% > nul ! calc 512 > nul
- call :get_char %tmp% %@retval% "xA" || set ?=-1
- calc %?% + 1 > nul
- cat --skip=%@retval% --length=3 %inipath% | set tmp=
- call Fn.15 "%tmp%" "ms_" && shift 3 && goto :hwid_check
- ::不以,或"结尾
- calc 0x%~3 + 16 > nul
- cat --skip=%@retval% --length=1 %inipath% | set tmp=
- if "%tmp%"=="," || if "%tmp%">="0x22" if "%tmp%"<="0x22" || shift 3 && goto :hwid_check
- calc 0x%~3 - %~2 + 16 > nul
- cat --skip=%@retval% --length=%~2 %inipath% | set tmp=
- call Fn.15 "%~1" "%tmp%" && shift 3 && goto :hwid_check
- set /a tmp=0x%~3 - %~2 + 16 > nul
- exit
- :get_char
- ::%tmp%起始位置 %~2每段范围 %~3要查找的字符
- if %tmp%<=%~2 && set tmp=0 && calc %~1 > nul ! set /a tmp=%tmp% - %~2 > nul && calc %~2 > nul
- cat --skip=%tmp% --length=%@retval% --locate="\%~3" %inipath% > nul && exit
- if %tmp%<=0 && set tmp= && exit 1
- goto :get_char
复制代码 |
|