From: defaultuser AT domain DOT com Newsgroups: comp.os.msdos.djgpp Subject: Re: This is not a problem but... Date: Sun, 28 Jun 1998 06:59:06 -0600 Organization: Symbios Logic Lines: 33 Message-ID: <35963E1A.9EFA00DF@domain.com> References: <3593D789 DOT DCC99FC4 AT netrover DOT com> NNTP-Posting-Host: ahadleypc.co.symbios.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk 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? > > Nicolas Blais. If you take a look at the assembler output it puts the input string from printf into data blocks of string. Eg.main() {printf("Hello world!"); } asm ... mov ax, offset DGROUP:s@ push ax call near ptr _printf ... s@ label byte db 'Hello world!' This is why your string is seen by the world inside the .EXE. So the trick is code the string initially from the world-- this involves physically placing coded string in place of "Hello world!" then decode using a function. eg. main() { printf("%s",decode("IrFTfpq#KB"));} -Andrew