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 5985535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:32:36+00:00 2026-05-22T22:32:36+00:00

I am writing a C app on Windows with MinGW/gcc. I need to use

  • 0

I am writing a C app on Windows with MinGW/gcc. I need to use the #include directive to include a file that contains an encrypted string. The string will be decrypted at runtime. I want to do this so the string will not be visible if looking at the executable with a hex editor.

I tried this, but it doesn’t work. You get the idea, though:

char *hidden_str =
#include "encrypted_text.dat"

There may be unescaped stuff in there that’s confusing the compiler. I don’t know. I don’t know what happens to it after it’s encrypted.

If there’s a better approach to this, I’m open to it.

  • 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-22T22:32:37+00:00Added an answer on May 22, 2026 at 10:32 pm

    If you installed and configured MSYS when you installed MinGW, you should have access to a command called xxd, which takes a hex dump of a file. By using the -i command line flag, you can get it to output a C-friendly file which you can easily import.

    An example call would be:

    xxd -i in_file output.h
    

    The contents of output.h would then look like:

    unsigned char in_file[] = {
      0x68, 0x65, 0x6c, 0x6c, 0x6f
    };
    unsigned int in_file_len = 5;
    

    You can then include that file into your C source code and have access to it:

    #include "output.h"
    
    unsigned int i;
    for(i = 0; i < in_file_len; i++)
    {
        printf("%c", in_file[i]);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im writing c# app in VS2008 that will use some reports. My question: how
I am writing a simple Windows app in c++, that will be able to
We are in the process of writing a native windows app (MFC) that will
I'm writing a app for both linux & windows, and noticed that the GCC
I am writing my first windows ce app. I am using an xml file
I am writing an app that downloads a wav file from a server and
I am writing a Python app that runs on my windows machine and I
I'm writing an app that has a wizard type input section. Think MS Windows
I am writing an app that allows creation of pppoe in windows phone 7.goal
I am writing a client windows app which will allow files and respective metadata

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.