Skip to content

nested expressions #283

Closed
Closed

Description

@x87
0@ = read_memory ((get_this_script_struct) + 0x10) size 4 virtual_protect 0

where (expr) essentially means: take the left-hand side variable and make a new command var = code

    0@ = get_this_script_struct
    0@ += 0x10
    0@ = read_memory 0@ size 4 virtual_protect 0

another example:

nlvar0 = WEAPONTYPE_SHOTGUN * SIZEOF_CWEAPONINFO
nlvar0 += aWeaponInfo
nlvar0 = Memory.Read(nlvar0, DWORD, false)

nlvar0 = Memory.Read(((WEAPONTYPE_SHOTGUN * SIZEOF_CWEAPONINFO) + aWeaponInfo), DWORD, false)

Originally posted by @x87 in #243 (comment)

Activity

  1. added
    type:feature
    priority:p2
    on Oct 31, 2023
  2. MiranDMC commented on Nov 2, 2023

    @MiranDMC

    Some nested expressions will require use of temporal local variable to perform. In showed example it uses return value of the host expression.
    What in case when parent operation does not return value, or there are multiple nested expressions exceeding number of return arguments, or return arguments are also used as input value?

  3. x87 commented on Nov 2, 2023

    @x87
    CollaboratorAuthor

    What in case when parent operation does not return value, or there are multiple nested expressions exceeding number of return arguments, or return arguments are also used as input value?

    then this syntax won't be allowed.

    adding temporary variables and supporting complex expressions would require more variables with #270

  4. added this to the v4.1.0 milestone on Aug 7, 2024
  5. x87 commented on Mar 16, 2025

    @x87
    CollaboratorAuthor

    Implemented in Somersault

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:p2scope:compilertype:feature

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions