-
-
Notifications
You must be signed in to change notification settings - Fork 0
Define Easy Variables
Mohamed Dief edited this page Feb 19, 2021
·
2 revisions
- In Easy. All Variables Are Getting Stored In a Dictionary. That Takes The Variables Name And It's Value. You Can Define Easy Variables Using Two Syntaxes. The Fist One is
DEFINE. DEFINE is Used To Define an Easy Variable That Could be Used as a Variable. Or It Could Be a Python Code. Make Sure To Check Your Easy Variables. Because If It's User Controllable. That Can Lead To Remote Code Execution By Adding Python Codes. Otherwise. Here's a DEFINE Example.
DEFINE key=<'hello = "test"'>
ADD key
CALL print,hello
-
The Code I Included Is Defining an Easy Variable Called Key. Key Does Contain a Python Code. Using
ADDSyntax. You're Appending This Variable Into The Code That Will Be Getting Executed. Then You're CallingprintFunction To PrinthelloVariable. That's Defined Totest. The Output Of This Code Will Be:test -
The Second Method To Define Variables That Could Be Used In Global For Every Single Easy File Inside Your Folder Is
__INIT__. INIT is Used To Load Global Static Variables From__INIT__or__INIT__.easyFiles. But It Should Be Inside The Folder You're Running The Shell From. Otherwise. It Won't Be Able To Find It. Here's a Simple Example For__INIT__. We Will Start Creating a File With This Content Inside It.
filename = "__INIT__"
name = "easyTester"
age = 20
- From Your Easy Code You Should Call
INITTo Load The Global Variables From The File. The Code Should Be Something Like This:
CALL print,"Loading INIT"
INIT
CALL print,"My name is:",name
STORE strAge
CALL str,age
CALL print,"My age is:",strAge