How to remove the class name from the executable without losing dynamic_cast?

Asked

Viewed 30 times

0

My goal is to just remove the class name from the executable, but still continue with the ability to use dynamic_cast. The problem is that if the RTTI is removed, and thus the class names, there is no substitute for the dynamic_cast.

I have tried to build an alternative system to RTTI by storing class information in a static variable, but I don’t know how to convert the pointers correctly, especially when facing the "diamond problem". And on top of that, it could give some problem in libs that use (SDL, GLFW, etc) .

The compiler I use is Min-GW, and not even the -s or strip removes this type of data.

I am desperate looking for some way to do this, even if it is directly replacing the class name in . exe generated by empty strings.

1 answer

0

There is no established way to do it in Min-GW, as you want to use a language function by removing the premises on which it is based.

dynamic_cast requires RTTI, which embeds class name into executable.

Subsequent obfuscation processes or alternative compilers with this concern maybe exist, but in this case it is already outside the scope of the language C++.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.