我一直在尝试使用注册表插件在NSIS中编写QWORD
!define REG "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\some.exe"
!define REG_VALUE "MitigationOptions"
!define REG_DATA 0x2000000000000
${registry::Write} "HKLM\${REG}" "${REG_VALUE}" ${REG_DATA} "REG_QWORD" $R0
当我在安装后检查注册表时,它总是显示为(无效的QWORD(64位)值)
我已经尝试过“ 0002000000000000”,“ 2000000000000”和2000000000000,但是没有用。任何想法?
数据长度必须恰好为16个十六进制字符,没有0x
前缀。
!include "Registry.nsh"
Section
${registry::Write} "HKCU\Software\NSIS\Test" "Test DW64" "112233445566aabb" "REG_QWORD" $R0
DetailPrint $R0
SectionEnd
数据似乎被解释为字节而不是64位数字,这有点不方便,因此您需要反转字符串:
Function StrRev
Exch $0
Push $1
Push $2
Push $3
StrCpy $3 ""
StrCpy $1 0
loop:
StrCpy $2 $0 1 $1
StrCmp $2 "" done
IntOp $1 $1 + 1
StrCpy $3 $2$3
Goto loop
done:
StrCpy $0 $3
Pop $3
Pop $2
Pop $1
Exch $0
FunctionEnd
Section
Push "112233445566aabb"
Call StrRev
Pop $0
${registry::Write} "HKCU\Software\NSIS\Test" "Test DW64" "$0" "REG_QWORD" $R0
SectionEnd
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句