ZipRawMemory

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

OutputVar := ZipRawMemory(AddressOrBufferObject, Size , Password)
Function Example: MyBuffer := ZipRawMemory(StrPtr(var), StrPut(var))

Parameters

OutputVar

The name of the variable in which to store the created BufferObject containing zipped memory.

AddressOrBufferObject

Address to memory or Buffer object to be zipped.

Size (optional)

Size in bytes of data in memory. Not required if AddressOrBuffer is Buffer Object.

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/string/buffer is 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."
var := ZipRawMemory(StrPtr(string), StrPut(string), "password")
textbuf:=UnZipRawMemory(var,,"password")
MsgBox StrGet(text)