You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The compiler tries to find a common denominator between the obfuscator's generated class and std::string, which it simply fails (since there's no direct conversion and it doesn't automatically think around the corner to use the conversion operator to const char*).
To solve this, simply cast the macro result to const char* and it should compile/work:
std::string a = "hello";
std::cout << (a == static_cast<constchar*>(AY_OBFUSCATE("hello")) ? 'T' : 'F') << std::endl;
It will still stay obfuscated until runtime (assuming you wouldn't hardcode a).
The compiler tries to find a common denominator between the obfuscator's generated class and std::string, which it simply fails (since there's no direct conversion and it doesn't automatically think around the corner to use the conversion operator to const char*).
To solve this, simply cast the macro result to const char* and it should compile/work:
std::string a = "hello";
std::cout << (a == static_cast<constchar*>(AY_OBFUSCATE("hello")) ? 'T' : 'F') << std::endl;
It will still stay obfuscated until runtime (assuming you wouldn't hardcode a).
now I use below code
a == std::string(AY_OBFUSCATE("hello"));
This would also work, but I think it would be more convenient to support equal sign comparisons directly.
not support below code
The text was updated successfully, but these errors were encountered: