delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/08/11/12:42:38

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <42FB7FF2.3020709@club-internet.fr>
Date: Thu, 11 Aug 2005 18:42:26 +0200
From: Louis Lecaroz <louis DOT lecaroz AT club-internet DOT fr>
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: "Segmentation fault" CygWin tools with code Injection-MS Detours
References: <42FB7644 DOT 8020905 AT le-resistant DOT com> <20050811163305 DOT GB6935 AT trixie DOT casa DOT cgf DOT cx>
In-Reply-To: <20050811163305.GB6935@trixie.casa.cgf.cx>
X-IsSubscribed: yes

>I can't really tell from your description.  It looks like the LD_PRELOAD
>stuff won't be called in the forkee, but I don't know if that's what you're
>seeing or not.  It still works when a process is execed, so it seems
>like it should be working most of the time.  I've fixed this in CVS.
>
>I'll generate a snapshot with this change today.
>  
>
Ok, the behavior I would like to have, is the LD_PRELOAD also called by 
the forkee, this willl allow the forkee to load the DLL I have declared 
in the LD_PRELOAD environment variable & allowing me to manipulate 
memories & Win32 functions addresses/pointers to perform hook inside.

>  
>
>>If yes, & if it is possible to correct this special really interresting 
>>undocumented CygWin Feature, I think, it will allow me to trace systems 
>>Win32 native call (not cygwin call like strace), in all cygwin tools. 
>>    
>>
>
>Sorry, but no, this is a cygwin-only solution.  It doesn't work with
>non-cygwin DLLs.
>  
>
I understand well that this is a cygwin only solution but it appears to 
work with non cygwin dlls as DllMain entries are standard & my code to 
install the hook is executed from the DllMain entry ;). It is sure, I 
cannot know how it impact the Cygwin Tools stability, but it works... 
(only in the forker ! not in the forkee ! as We saw above :( ).
I really understand this & your point of view & declining 
responsabilities or future behavior on this ;)

Just only having the forkee working with the LD_PRELOAD will be I 
suppose, not a solution for me... but a good workaround....
Louis

>cgf
>
>--
>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/
>
>
>  
>


--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019