i'm having problem working with EP_ProtectedStringByID
int len = EP_ProtectedStringByID( 1, NULL, 0 );
char *str_001 = new char[ len ];
EP_ProtectedStringByID( 1, str_001, len );
For most of strings it's working good (i've 17 protected strings) , but in one it's returning trash characters at the end of the string, and i don't have a clue why, any ideas?
EP_ProtectedStringByID
Re: EP_ProtectedStringByID
Hi Mr. Data, strange, there should not be any problem.
We did not face any problem with this feature, so can't advice anything without test files.. Could you at least send me your project file (.enigma) at support@enigmaprotector.com and I will try to check this out?
I'm also worrying about the code, maybe it should look like:
or
We did not face any problem with this feature, so can't advice anything without test files.. Could you at least send me your project file (.enigma) at support@enigmaprotector.com and I will try to check this out?
I'm also worrying about the code, maybe it should look like:
Code: Select all
int len = EP_ProtectedStringByID( 1, NULL, 0 );
char str_001 = new char[ len ];
EP_ProtectedStringByID( 1, &str_001, len );
Code: Select all
int len = EP_ProtectedStringByID( 1, NULL, 0 );
char str_001[len];
EP_ProtectedStringByID( 1, &str_001, len );
Re: EP_ProtectedStringByID
I've just figured out what is wrong there. There is a problem with your code.
Since you are using Protected Strings as ansi-strings, each ansi string should be terminated with zero symbol. In your case, you are allocating the array for string, but forgot the termination zero.
So the code should look like:
I think this should work correctly!
Since you are using Protected Strings as ansi-strings, each ansi string should be terminated with zero symbol. In your case, you are allocating the array for string, but forgot the termination zero.
So the code should look like:
Code: Select all
int len = EP_ProtectedStringByID( 1, NULL, 0 );
char* str_001 = new char[ len + 1 ];
memset(str_001 , 0, len + 1);
EP_ProtectedStringByID( 1, str_001, len );
Re: EP_ProtectedStringByID
Problem solved! Thanks 
