Path: utzoo!attcan!uunet!husc6!bloom-beacon!mit-eddie!rutgers!bellcore!tness7!ninja!dalsqnt!rpp386!pigs!haugj From: haugj@pigs.UUCP (The Beach Bum) Newsgroups: comp.unix.xenix Subject: Re: "#!" scripts, kernel patches, and Xenix Summary: it depends on where they put it ... Message-ID: <423@pigs.UUCP> Date: 16 Sep 88 20:53:25 GMT References: <161@tessera.UUCP> <858@viscous> <405@pigs.UUCP> <1459@ssc.UUCP> Reply-To: haugj@pigs.UUCP (The Beach Bum) Organization: The Big "D" Home for Wayward Hackers Lines: 25 In article <1459@ssc.UUCP> markz@ssc.UUCP (Mark Zenier) writes: >Isn't the shell script check implemented in the library routine that >is linked in, and not the kernel. This is what Rochkind says in >"Advanced Unix Programming". This sounds much easier than disassembling >half of the kernel. it depends. on some systems the '#!' hack is part of the C library. on others, it is in the kernel. the actually hack is so simple that it can be added in one afternoon of work. i'd guess [ in case ross wants to added it to xenix 2.4 ;-) ] the best place to start is in gethead(). just look for the appropriate magic number [ see the previous posting by my ], then jump off and get the program name since the block has already by read [ there should be a bread() in gethead() - add an extra field to the x.out header for the program name or something ... ] and we are only talking about disassembling 2000 lines of assembler or so. shouldn't take more than 3 or 4 days to produce C code from that ;-) -- =-=-=-=-=-=-=-The Beach Bum at The Big "D" Home for Wayward Hackers-=-=-=-=-=-= Very Long Address: John.F.Haugh@rpp386.dallas.tx.us Very Short Address: jfh@rpp386 "ANSI C: Just say no" -- Me