Assemble

Signatures

(u64, u64) assemble(string assembly)
(u64, u64) assemble(string assembly, table localSymbols)
(u64, u64) assemble(string assembly, table localSymbols, table globalSymbols)
(u64, u64) assemble(string assembly, u64 address)
(u64, u64) assemble(string assembly, u64 address, table localSymbols)
(u64, u64) assemble(string assembly, u64 address, table localSymbols, table globalSymbols)

Description

Assembles a given string into x64 assembly code at a specified address and registers the provided symbols.

Returns a tuple, where the first value is the memory address and the second value is the size of the assembled code. If the operation fails, both values will be 0.

Arguments

Assembly

A string of assembly code that will be processed.

Registered symbols can be accessed by wrapping them with % (e.g. mov eax,[%symbol%]).

Address

The memory address of where the assembled code will be written to.

Is optional and if omitted, new memory will be allocated.

Local Symbols

A table containing multiple names of symbols that will be locally registered.

Is optional and set to {} by default.

Global Symbols

A table containing multiple names of symbols that will be globally registered.

Is optional and set to {} by default.

Last updated