Hello,
Does the VM know how to read static member functions from the map file? We have a few critical areas in our program that are utilizing these and it would be nice if we could protect these parts with the VM.
Thank you.
Static member functions
Re: Static member functions
Hi avok,
Why not, static members (natively) are just a functions. Any function of compiled executable are written in map file. Try to open map file in Enigma, if you find this function in the list - so, no problem, VM will work correctly with this fn.
By the way, I'm often getting emails with the question "Why Enigma shows not all the functions from map", please note that Enigma shows only supported functions. If you do not find your function in the list - it is unsupported.
So, if for example your class is looking so (there are 2 kind of static members, 1st - like a function, 2nd - like a variable, Enigma VM can't protect variable, but any var static method could be rewritten to function equivalent and protected without a problem):
You can compile this and find in the map file ResetCount() function. But one note also. Enigma could support the function if it's length will be more than 5 bytes. The member ResetCount() above I do not think has 5 bytes, but we can enlarge it. For example with the null nop assembler instruction that has 1 byte length:
Why not, static members (natively) are just a functions. Any function of compiled executable are written in map file. Try to open map file in Enigma, if you find this function in the list - so, no problem, VM will work correctly with this fn.
By the way, I'm often getting emails with the question "Why Enigma shows not all the functions from map", please note that Enigma shows only supported functions. If you do not find your function in the list - it is unsupported.
So, if for example your class is looking so (there are 2 kind of static members, 1st - like a function, 2nd - like a variable, Enigma VM can't protect variable, but any var static method could be rewritten to function equivalent and protected without a problem):
Code: Select all
class BufferedOutput
{
public:
// Return number of bytes written by any object of this class.
short BytesWritten()
{
return bytecount;
}
// Reset the counter.
static void ResetCount()
{
bytecount = 0;
}
// Static member declaration.
static long bytecount;
};
Code: Select all
static void ResetCount()
{
__asm
{
nop
nop
nop
nop
nop
}
bytecount = 0;
}
Re: Static member functions
We are sure that the functions are more than 5 bytes(pretty long). What does it mean that a function is unsupported?
Re: Static member functions
Unsupported functions means:
1. Size of function less than 5 bytes
2. There are unsupported SEH handlers (Enigma VM support well Delphi, C++ and VB seh, but I assume there are a lot of other compilers)
3. There are unsupported assembler instructions in the function, for example, any fpu instruction like
If you need, you can send me your non protected exe and map file and I will tell you what is wrong there.
1. Size of function less than 5 bytes
2. There are unsupported SEH handlers (Enigma VM support well Delphi, C++ and VB seh, but I assume there are a lot of other compilers)
3. There are unsupported assembler instructions in the function, for example, any fpu instruction like
4. There are switch/case conditions (does not support yet)FLD TBYTE PTR SS:[EBP+14]
FLDLN2
FXCH ST(1)
FYL2X
FLD TBYTE PTR SS:[EBP+8]
FMULP ST(1),ST
If you need, you can send me your non protected exe and map file and I will tell you what is wrong there.