Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6770219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:17:10+00:00 2026-05-26T15:17:10+00:00

Let’s say I have a string that I would like to obfuscate in my

  • 0

Let’s say I have a string that I would like to obfuscate in my code. (This example is just for learning.)

My plan is to wrap the string literal with a macro, e.g.

#define MY_STRING "lol"
const char *get_string() { return _MY_ENCRYPTION_MACRO(MY_STRING); }

and, as a pre-build step, to run my source file through my own preprocessor to look for all usages of _MY_ENCRYPTION_MACRO and obfuscate the strings accordingly.

How would I go about doing this preprocessing with Visual C++?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:17:11+00:00Added an answer on May 26, 2026 at 3:17 pm

    If you used a recent GCC (i.e. GCC 4.6) on Linux, you could also have a plugin which provides a builtin function to “encrypt” compile time strings, or you could even make it a GCC MELT extension (MELT is a high-level domain specific language to extend GCC).

    If you use some other C++, you might have your own pre-processing scripts finding your macros.
    You might for instance have some program which scan every occurrence of ENCRYPTSTRING("anyconstantstring") in all your C++ sources, and generate a mycrypt.h file which you #include "mycrypt.h" in your C++ code. Then you might do tricks like

    #define ENCRYPTSTRING(S) ENCRPYTSTRING_AT(S,__LINE__)
    #define ENCRYPTSTRING_AT(S,L) cryptstring_#L
    

    and have your generated "mycrypt.h" contain things like

    const char crypstring_123[]="thecryptedstringatline123";
    

    etc. The "mycrypt.h" generator could be an awk or python or ocaml (etc…) script.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say that I have a set of relations that looks like this: relations
Let's say that I have classes like this: public class Parent { public int
Let's say I have some text as follows: do this, do that, then this,
Let's say I have table with column 'URL' whrere I store urls like this
Let's suppose I have this piece of code. foreach(string value in myList) { string
Let's say i have this block of code, <div id=id1> This is some text
Let's say you have a JavaScript class like this var DepartmentFactory = function(data) {
Let's say that we have an ARGB color: Color argb = Color.FromARGB(127, 69, 12,
Let's say I have a simple Login servlet that checks the passed name and
Let's say I have this: SolutionSet(const SolutionSet &solutionSet) { this->capacity_ = solutionSet.capacity_; this->solutionsList_ =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.