sannybuilder/dev

nested expressions

x87 opened this issue · 2 comments

x87 commented
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)

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?

x87 commented

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