For the complete documentation index, see llms.txt. This page is also available as Markdown.

Data types & Operators

Description of data types and operators

Data Types

HyperDbg's script engine supports several data types. By default, all variables declared without an explicit type are treated as unsigned 64-bit integers (unsigned long long). Starting from v0.23, the script engine also supports floating-point (float) and double-precision (double) types.

int

The int type represents a signed 32-bit integer. It can hold values in the range of approximately −2 billion to +2 billion.

Example 1: Basic integer declaration and printing

? {
    int x = 0n42;
    int y = 0n100;
    printf("x = %d, y = %d\n", x, y);
}

Output:

x = 42, y = 100

Example 2: Integer in a loop

? {
    int sum = 0;
    for (int i = 1; i <= 5; i++) {
        sum += i;
    }
    printf("sum of 1..5 = %d\n", sum);
}

Output:

float

The float type represents a single-precision (32-bit) IEEE 754 floating-point number. Floating-point literals can be written with a leading digit (11.5), a leading dot (.5), or a trailing dot (11.). Starting from v0.23.

Example 1: Declaration and printing

Output:

Example 2: Arithmetic operations

Output:

double

The double type represents a double-precision (64-bit) IEEE 754 floating-point number, providing more significant digits than float. Starting from v0.23.

Example 1: Declaration and printing

Output:

Example 2: Arithmetic operations

Output:

Example 3: Mixed float and double, operator precedence

Output:

Example 4: Comparisons with floating-point values

Output:

Operators

sizeof

The sizeof operator returns the size (in bytes) of a type, a variable, or a struct. It works with all built-in types (char, short, int, long, long long), user-defined structs, and implicitly-typed variables. Support for sizeof was added starting from v0.23.

Syntax

Example 1: sizeof with built-in types and a struct

Output:

Example 2: sizeof with an implicit variable

By default, variables declared without an explicit type are treated as unsigned long long (8 bytes).

Output:

sizeof evaluates at compile time for types and at parse time for variables. It does not execute any runtime expressions - it only measures the storage size of the given type or variable.

Last updated