Skip to content

add array and pointer in script engine#554

Merged
SinaKarvandi merged 2 commits intoHyperDbg:devfrom
xmaple555:dev
Oct 21, 2025
Merged

add array and pointer in script engine#554
SinaKarvandi merged 2 commits intoHyperDbg:devfrom
xmaple555:dev

Conversation

@xmaple555
Copy link
Copy Markdown
Contributor

Description

? {
	
   int t1 [6] = {1,2,3,4,5,6,};
      

   for( i = 0;i<6;i++){
      printf("%d\n", *(i+t1));
   }
   
   for( i = 0;i<6;i++){
      printf("%d\n", t1[i]);
   }
}
? {
   int t1 [3]= {0};
   printf("%d\n", t1[0]);
   t1 [0] = 7;
   printf("%d\n", t1[0]);
}
? {
   int t1 [3][3] = {{1,2,3},{4,5,6},{7,8,9}};
   printf("%d",t1[2][2]);
}

This is still in developement, and there were few changes in script engine few months ago , like compound assignment

? {
	t1 = 1;
	t1 +=5;
        t1 <<=5;
}

and multiple assignment .

? {
	t1 = t2 = 1;
}

Also, for the struct SCRIPT_ENGINE_TOKEN in common.c

typedef struct _SCRIPT_ENGINE_TOKEN
{
    SCRIPT_ENGINE_TOKEN_TYPE Type;
    char *                   Value;
    unsigned int             Len;
    unsigned int             MaxLen;
    unsigned long long       VariableType;
    unsigned long long       VariableMemoryIdx;
} SCRIPT_ENGINE_TOKEN, *PSCRIPT_ENGINE_TOKEN;

the type of VariableType actually is VARIABLE_TYPE* defined in type.h, but I was not able to include type.h in common.h. It would be better if @SinaKarvandi can help to solve this problem

@SinaKarvandi SinaKarvandi merged commit ed27594 into HyperDbg:dev Oct 21, 2025
3 checks passed
@SinaKarvandi
Copy link
Copy Markdown
Member

Hi,
Wow, that's a great contribution. Thank you @xmaple555

@SinaKarvandi
Copy link
Copy Markdown
Member

I'll document it and add test case examples for us to automate the testing of it.
Meanwhile, I fixed the problem you mentioned about VariableType (If I understand it correctly). Is this fix correct? #555

@xmaple555
Copy link
Copy Markdown
Contributor Author

I'll document it and add test case examples for us to automate the testing of it. Meanwhile, I fixed the problem you mentioned about VariableType (If I understand it correctly). Is this fix correct? #555

yes, this exactly solve the problem

@SinaKarvandi
Copy link
Copy Markdown
Member

Great. I merged it to the 'dev'.

@SinaKarvandi SinaKarvandi mentioned this pull request Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants