ilusm.dev

san

Address sanitizer, memory sanitizer, UAF detection.

Load with: use san

Quick example

use san

result = sanne(10)
prn(result)

Functions

Sanitizer runtime

sanne(options)

Creates a new instance. Takes options.

sanin(san)

Initialises. Takes san.

Memory access checking

sanac(san, ptr, size, is_write)

Performs the operation. Takes san, ptr, size, is_write.

sanre(san, ptr, size)

Performs the operation. Takes san, ptr, size.

sanwr(san, ptr, data)

Writes data. Takes san, ptr, data.

Allocation tracking

sanma(san, size, stack_trace)

Performs the operation. Takes san, size, stack_trace.

sanfr(san, ptr, stack_trace)

Creates from another format. Takes san, ptr, stack_trace.

sanpr(san)

Processes or prints. Takes san.

Stack protection

sanst(san, var_name, ptr, size)

Sets a value or starts a process. Takes san, var_name, ptr, size.

sanst(san)

Sets a value or starts a process. Takes san.

Use-after-return detection

sanst(san, ptr)

Sets a value or starts a process. Takes san, ptr.

Container overflow detection

sanve(san, vec, idx, size)

Performs the operation. Takes san, vec, idx, size.

Global variable protection

sangl(san, name, ptr, size)

Performs the operation. Takes san, name, ptr, size.

Thread safety

sanra(san, ptr, size, is_write, thread_id)

Performs the operation. Takes san, ptr, size, is_write, thread_id.

Leak detection

sanle(san)

Performs the operation. Takes san.

Error reporting

__sanrperr(err_type, addr, size, stack_trace)

Performs the operation. Takes err_type, addr, size, stack_trace.

__sanrplk(leaks)

Performs the operation. Takes leaks.

MemorySanitizer (uninitialized read detection)

msnew()

Performs the operation.

mspoi(ms, ptr, size)

Performs the operation. Takes ms, ptr, size.

msunp(ms, ptr, size)

Performs the operation. Takes ms, ptr, size.

msche(ms, ptr, size)

Performs the operation. Takes ms, ptr, size.

UndefinedBehaviorSanitizer

ubsan()

Performs the operation.

ubsan(ubsan, op, a, b, result)

Performs the operation. Takes ubsan, op, a, b, result.

ubsan(ubsan, value, shift)

Performs the operation. Takes ubsan, value, shift.

ubsan(ubsan, ptr, operation)

Performs the operation. Takes ubsan, ptr, operation.

ubsan(ubsan, ptr, alignment, operation)

Performs the operation. Takes ubsan, ptr, alignment, operation.

__ubsanrpt(check_type, details)

Performs the operation. Takes check_type, details.

Notes

  • Sanitisation - strip HTML, escape SQL, validate inputs.