From owner-freebsd-hackers Tue Jul 30 08:43:39 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id IAA05308 for hackers-outgoing; Tue, 30 Jul 1996 08:43:39 -0700 (PDT) Received: from jabber.paco.odessa.ua (jabber.paco.odessa.ua [193.124.52.20]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id IAA03707 for ; Tue, 30 Jul 1996 08:37:17 -0700 (PDT) Received: (from igor@localhost) by jabber.paco.odessa.ua (8.7.1/8.6.10/01) id SAA11447 for freebsd-hackers@freebsd.org; Tue, 30 Jul 1996 18:34:14 +0300 (UKD) From: Igor Khasilev Message-Id: <199607301534.SAA11447@jabber.paco.odessa.ua> Subject: incorect (?) execution of gziped executable To: freebsd-hackers@freebsd.org Date: Tue, 30 Jul 1996 18:34:14 +0300 (UKD) X-Mailer: ELM [version 2.4 PL24] Content-Type: text Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Hi everybody! Is it right that code become writeable in gziped executable? I tried such program: -------8<-------------------- sub() { printf("sub\n"); } main() { printf("before: %x\n",*(int*)&sub); *(int*)&sub = 0; printf("after: %x\n", *(int*)&sub); sub(); } -------8<-------------------- when compiled and executed normally (before gziping executable file) it produce normal output: bash$ ./x before: 68e58955 Bus error (core dumped) bash$ gdb display that program was terminated with signal 10 at line *(int*)&sub = 0; Nothing unusual... But... bash$ gzip x gzip: x.gz already exists; do you wish to overwrite (y or n)? y bash$ ./x.gz before: 68e58955 after: 0 Segmentation fault (core dumped) bash$ I become able to write to code? Or i misunderstand something? Regads! Igor.