Skip to main content

create_marker_file

Function create_marker_file 

Source
pub fn create_marker_file(module_index: u32) -> Vec<u8> 
Expand description

Creates a 40-byte marker file. Layout:

[MAGIC 16 bytes][MODULE_INDEX u32 LE][JS_OFFSET u32 LE = 0][END_MAGIC 16 bytes]

MODULE_INDEX identifies which JS module this slot is for (0 = primary export module, 1+ = additional modules in order). JS_OFFSET=0 indicates no JS has been injected. After injection, JS_OFFSET points to a memory location containing [JS_LEN u32 LE][JS bytes].