VM complexity scripting function

It is possible to set virtualization complexity on per-function basis using GUI, but there is no method to control that in LUA class IntelFunction

Added in the 2377 build.

IntelFunction:setComplexity, I see, thanks!

Hey, I just discovered this function, so far it wasn’t documented.
I went ahead and tried it, it seems to set a numeric value to the lua bound function variable, but the value has absolutely no impact on the actual complexity. Regardless of what I set the value to, the function runs at the same speed, 1 or 100 doesn’t matter.
Doing so in the UI has a drastic affect on the speed so that seems to work (Using 3.9.6).
In case Im using it wrong, heres the 3 lines:

local Func = File:functions():addByAddress(MapFunc:address(), CompilationType.Virtualization)
assert(Func)
Func:setComplexity(1)

The Complexity only affects the size of virtualized code and doesn’t affect its speed.

Thanks for your answer!
After some debugging I figured out that you are right, the reason the VM is so much slower is that the Import Protection feature is enabled.
Apparently, that makes the vmenter/exit much much slower which leads to bad performance in my code as the function is called VERY frequently but doesn’t have much code to execute.
Do you think it would be possible to add an option to generate a different VM for certain functions that doesn’t bother with import protection?
The current workaround is to simply apply VMP twice in a row which doesn’t feel very robust…

а можно такую только для SDK c++
VMProtectBeginVirtualization(FUNCTION);
vmp_set_complexity