NSIS 写入 QWORD 十六进制值
NSIS Writing QWORD HEX VALUE
我一直在尝试使用 Registry Plug-in
在 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 [=11=]
Push
Push
Push
StrCpy ""
StrCpy 0
loop:
StrCpy [=11=] 1
StrCmp "" done
IntOp + 1
StrCpy
Goto loop
done:
StrCpy [=11=]
Pop
Pop
Pop
Exch [=11=]
FunctionEnd
Section
Push "112233445566aabb"
Call StrRev
Pop [=11=]
${registry::Write} "HKCU\Software\NSIS\Test" "Test DW64" "[=11=]" "REG_QWORD" $R0
SectionEnd
我一直在尝试使用 Registry Plug-in
在 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 [=11=]
Push
Push
Push
StrCpy ""
StrCpy 0
loop:
StrCpy [=11=] 1
StrCmp "" done
IntOp + 1
StrCpy
Goto loop
done:
StrCpy [=11=]
Pop
Pop
Pop
Exch [=11=]
FunctionEnd
Section
Push "112233445566aabb"
Call StrRev
Pop [=11=]
${registry::Write} "HKCU\Software\NSIS\Test" "Test DW64" "[=11=]" "REG_QWORD" $R0
SectionEnd