EK.IceFlake

  • Hero Member
  • "We are the champions my fellahs" - Sufyan/VK.SuFy
  • Posts: 1,757
Wtf are these traps
« on May 24th, 2017, 06:16 PM »
When trying to reverse engineer squirrel bytecode I get some traps

Are they to simply make life hard for reverse engineers or do they serve some actual purpose?

.

  • VC:MP Beta Tester
  • .
  • Posts: 1,808
Re: Wtf are these traps
« Reply #1, on May 24th, 2017, 06:48 PM »Last edited on May 24th, 2017, 07:00 PM
Just a random guess. A scope/context. That is: a pair of curly braces.

Code: [Select]
function A(x)
{
    local y;
    if (x == y)
    {
        local z = x+y;
        print(z);
    } // <- Trap variables (z) in this scope and release them here
    // `z` doesn't exist here
} // <- Trap variables (x/y) in this scope and release them here
 A(3);
 // x,y don't exist here
.

Stormeus

  • VC:MP Developer
  • oh god how did i get here im not good w computer
  • Posts: 1,128
Re: Wtf are these traps
« Reply #2, on May 31st, 2017, 06:33 AM »
Fun fact, these actually aren't TRAPs, they're PARTs in little-endian.


EK.IceFlake

  • Hero Member
  • "We are the champions my fellahs" - Sufyan/VK.SuFy
  • Posts: 1,757

Stormeus

  • VC:MP Developer
  • oh god how did i get here im not good w computer
  • Posts: 1,128