www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/29/05:18:07

Message-ID: <35972539.E4EAEBD1@post.comstar.ru>
Date: Mon, 29 Jun 1998 09:25:13 +0400
From: Dim Zegebart <zager AT post DOT comstar DOT ru>
Reply-To: zager AT post DOT comstar DOT ru
Organization: Comstar Ltd.
MIME-Version: 1.0
To: Nicolas Blais <eletech AT netrover DOT com>
CC: djgpp AT delorie DOT com
Subject: Re: This is not a problem but...
References: <3593D789 DOT DCC99FC4 AT netrover DOT com>


Nicolas Blais wrote:

> When I compile my program, and edit my exe file, I can modify all my
> strings used with printf.  I don't want people to do so, is there a way
> to conteract this?

IMHO, the best way to protect your string from editing is separating them
to so-called resource area. This just a separate .h file where you declare
all of
you strings as follows :
char szHello="Hello world!";
char szError="Error:";
etc.
At normal condition (read developing time) you just use string variables to
do screen output
printf("%s\n",szHello);
Then you ready to publish your code you pass resource file through some
scrambler (the ROT-13 is the
most known or just XOR). SO, your strings now looks like a garbage and
can't be visibly located in you code.
At startup you run revers decoder to restore the original contents of
strings.

--
____ ____
|   \   /   Dim Zegebart
____/____

Moscow Russia
WWW - http://www.geocities.com/siliconvalley/pines/7817
DZcomm - comm library for Allegro
Palantir - multitasking kernel for Allegro (based on PDMLWP)


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019