X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_47 X-Spam-Check-By: sourceware.org Message-ID: <49C50564.705@t-online.de> Date: Sat, 21 Mar 2009 16:19:00 +0100 From: Christian Franke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080702 SeaMonkey/1.1.11 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Any Cygwin tool to change .exe subsystem type ? References: <1Lkb2J-2570k40 AT fwd11 DOT aul DOT t-online DOT de> <49C4A24C DOT 6050603 AT gmail DOT com> <49C4E935 DOT 9000003 AT cwilson DOT fastmail DOT fm> In-Reply-To: <49C4E935.9000003@cwilson.fastmail.fm> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Charles Wilson wrote: > Dave Korn wrote: > >> Christian Franke wrote: >> >>> Is there any tool in the Cygwin distro that allows to change subsystem >>> type (Console, GUI, ...) of an already linked .exe ? >>> >>> Same operation as e.g. 'editbin /subsystem:windows ...', but without the >>> need to have MS tools installed. >>> >>> >> Not yet, but it would make a great PTC for the new 'peflags' tool recently >> discussed on this list. >> > > If desired, I can later provide a patch that adds some 'peflags --subsystem=...'. For now, I use a quick hack within the project's Makefile. It first checks the header magic number and then: $ echo -ne '\002\000' | dd bs=1 count=2 seek=220 conv=notrunc of=file.exe :-) This works because apparently all cygwin and mingw compiled .exe have the optional header at the same position. > Actually, I think THIS functionality, as well as the ability to set the > date field of a PE object as recently mentioned on the gcc list, is a > better fit for objdump. I agree, but shouldn't this be a function of objcopy ? -- Christian Franke -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/