Mail Archives: djgpp/1998/06/28/15:49:43
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
- Raw text -