module documentation
Disassemble NCS (compiled script) files.
While the language bytecode is principally game-agnostic, the supported opcodes describe the default NWN:EE instruction set.
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Undocumented |
Function | disasm |
Disassembles bytecode from a file-ish. |
Function | read |
Parses additional data based on the opcode and auxiliary code. |
Function | read |
Reads an instruction from the given input stream. |
Constant | _AUXCODE |
Undocumented |
Constant | _NCS |
Undocumented |
Constant | _OPCODE |
Undocumented |
Disassembles bytecode from a file-ish.
Skips any encountered NCS header as a convenience.
Parameters | |
file:BinaryIO | A file-ish containing the bytecode to disassemble. |
Yields | |
Instr | The next instruction read from the bytecode stream. |
Parses additional data based on the opcode and auxiliary code.
Note: This will re-parse embedded extra data every time it's called: For example, JSON payloads will be evaluated.
Parameters | |
file:BinaryIO | A binary stream from which to read the data. |
op:Opcode | The opcode of the instruction. |
aux:Auxcode | The auxiliary code providing additional context for the operation. |
Returns | |
tuple | A variable length tuple containing the parsed data, or empty. |
Raises | |
struct.error | If the data cannot be read from the stream. |
ValueError | Various error conditions. |
Reads an instruction from the given input stream.
Parameters | |
file:BinaryIO | A binary stream from which the instruction is read. |
Returns | |
Instr | The instruction read from the input stream. |
Raises | |
struct.error | If the data cannot be read from the stream. |
ValueError | If the opcode or auxiliary code is invalid. |
Undocumented
Value |
|
Undocumented
Value |
|