ZipRawMemory()

Auto Hotkey

ZipRawMemory

This function is used to zip and decrypt raw memory, for example to use for resources.

OutputVar := ZipRawMemory(Address, Size, , VariableOrAddress, Password)
Function Example: Size := ZipRawMemory(&var;, sizeOfvar, Data)

Parameters

OutputVar

The name of the variable in which to store the size of zipped memory in bytes.

Address

Address to memory to be zipped.

Size

Size in bytes of data in memory.

VariableOrAddress (optional)

The name of a variable or address to copy zipped memory to. If omitted only the size will be returned.

Password (optional)

The password to use to encrypt the data.

Remarks

Ahk2Exe uses ZipRawMemory to compress and encrypt resources in raw mode (only 1 file supported).
Internally AutoHotkey is able to decompress raw resources automatically (compiled script, AutoHotkey.dll, WinApi + lib resources). UnZipRawMemory can be used in script to decrypt and decompress data compressed with ZipRawMemory.

Related

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

Examples

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