ZipRawMemory

此函数用于压缩和加密原始内存,例如用于资源。

OutputVar := ZipRawMemory(Address, Size , VariableOrAddress, Password)
函数示例: Size := ZipRawMemory(&var, sizeOfvar, Data)

参数

OutputVar(输出变量)

用于存储压缩内存大小(以字节为单位)的变量名称。

Address(地址)

要压缩的内存地址。

Size(大小)

内存中数据的大小(以字节为单位)。

VariableOrAddress(变量或地址,可选)

要将压缩内存复制到的变量或地址的名称。如果省略,则仅返回大小。

Password(密码,可选)

用于加密数据的密码。

备注

Ahk2Exe 使用 ZipRawMemory 以原始模式压缩和加密资源(仅支持 1 个文件)。
AutoHotkey 内部能够自动解压原始资源(编译脚本、AutoHotkey.dll、WinApi + lib 资源)。 UnZipRawMemory 可在脚本中用于解密和解压缩使用 ZipRawMemory 压缩的数据。

相关

ZipRawMemory, ZipCreateFile, ZipAddFile, ZipCloseFile, ZipOptions, UnZip, ZipCreateBuffer, ZipAddBuffer, ZipCloseBuffer, UnZipBuffer, ZipInfo, ZipAddFolder

示例

string:="This is a message from AutoHotkey."
sz := ZipRawMemory(string, StrLen(string) * 2, var, "password")
UnZipRawMemory(&var, sz, text, "password")
MsgBox % text