Re: "Segmentation fault" CygWin tools with code Injection-MS Detours

2005-08-13 Thread Shaffer, Kenneth
I hope you're not hard-coding c:\cygwin! -- Ken Shaffer - - - - - - - Appended by Scientific-Atlanta, Inc. - - - - - - - This e-mail and any attachments may contain information which is confidential, proprietary, privileged or otherwise protected by law. The information is solely i

Re: "Segmentation fault" CygWin tools with code Injection-MS Detours

2005-08-12 Thread Louis Lecaroz
Hi all, Let me thx all the CygWin team ! I tested your modifications, & now I can hook native Win32 systems calls (like CreateFile you call indirectly by your libc fake methods) with the Microsoft Detours Toolkit) by using LD_PRELOAD, also in forkee ! Your LD_PRELOAD simply replace the Microso

RE: "Segmentation fault" CygWin tools with code Injection-MS Detours

2005-08-12 Thread Dave Korn
Original Message >From: Brian Ford >Sent: 11 August 2005 19:06 > Just to add a useless speculation that I don't currently have time to > follow up on... > > I'd bet this is the mechanism used by SysInternals Process Explorer for > the currently broken (on Cygwin) DLL list and thread list

Re: "Segmentation fault" CygWin tools with code Injection-MS Detours

2005-08-11 Thread Brian Ford
On Thu, 11 Aug 2005, Christopher Faylor wrote: > On Thu, Aug 11, 2005 at 02:58:58PM +0200, Louis Lecaroz wrote: > >Having (if possible ;) ) a patch & a standard modification in cygwin to > >allow this type of programming will be really great ! > > Cygwin has its own (currently undocumented) hookin

Re: "Segmentation fault" CygWin tools with code Injection-MS Detours

2005-08-11 Thread Louis Lecaroz
So to be more clear on my previous post (sorry, english is not my natural language :( ) : -The LD_PRELOAD is not performed (It appears not to be performed...) in the forkee, so the code is not loaded in it (I think) -Yes, I would like the LD_PRELOAD to be loaded in the forkee, this will allow al

Re: "Segmentation fault" CygWin tools with code Injection-MS Detours

2005-08-11 Thread Louis Lecaroz
Oups I missed something in my previous post... I also tried processes started directly not by bash, like sh, & others, & LD_PRELOAD allow to have my hooks working in cygwin processs ! that's really great ! So, the only issue keeping on my solution, is LD_PRELOAD a I said in my post above... Sor

Re: "Segmentation fault" CygWin tools with code Injection-MS Detours

2005-08-11 Thread Louis Lecaroz
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 gen

Re: "Segmentation fault" CygWin tools with code Injection-MS Detours

2005-08-11 Thread Christopher Faylor
On Thu, Aug 11, 2005 at 06:01:08PM +0200, Louis Lecaroz wrote: >I tried to LD_PRELOAD my Microsoft DLL Hook, & it appears to work, >cygwin is loaded correctly, & code is not injected but loaded by cygwin. & >Hooks appears working ! that's a great improvement on my issue. So it >appears to be the

Re: "Segmentation fault" CygWin tools with code Injection-MS Detours

2005-08-11 Thread Louis Lecaroz
Hi Dave, First I really understand your point of view of starting programs sent by internet ! I am working like you to have a secure computer ;) Next, ok, I said, I am writing a TRuss program but by using the Microsoft Detours toolkit. You have some example shipped with the MS Detours, doing

RE: "Segmentation fault" CygWin tools with code Injection-MS Detours

2005-08-11 Thread Dave Korn
Original Message >From: Louis Lecaroz >Sent: 11 August 2005 16:13 > Dave, > For your information, you don't need my code specificaly, as it is not > directly link to "my" code but to the Microsoft Toolkit, but I think, > when You were talking about my code, You mean Microsoft ?. I'm not

Re: "Segmentation fault" CygWin tools with code Injection-MS Detours

2005-08-11 Thread Louis Lecaroz
Christopher, That's a possible workaround. I tried to LD_PRELOAD my Microsoft DLL Hook, & it appears to work, cygwin is loaded correctly, & code is not injected but loaded by cygwin. & Hooks appears working ! that's a great improvement on my issue. So it appears to be the code injection from one

Re: "Segmentation fault" CygWin tools with code Injection-MS Detours

2005-08-11 Thread Christopher Faylor
On Thu, Aug 11, 2005 at 02:58:58PM +0200, Louis Lecaroz wrote: >Having (if possible ;) ) a patch & a standard modification in cygwin to >allow this type of programming will be really great ! Cygwin has its own (currently undocumented) hooking mechanism. Setting the LD_PRELOAD environment variable

RE: "Segmentation fault" CygWin tools with code Injection-MS Detours

2005-08-11 Thread Dave Korn
Original Message >From: Louis Lecaroz >Sent: 11 August 2005 14:36 >> > Yes, ok, but so, how to trace cygwin+native Win32 program together ? Ok, so you wrote a truss tool, and it doesn't work with cygwin executables, and you want to know what to do? The answer is simple. You have

Re: "Segmentation fault" CygWin tools with code Injection-MS Detours

2005-08-11 Thread Louis Lecaroz
Thank's you Eric for your quick answer... But I have many questions for you... : Eric Blake wrote: And what's wrong with cygwin's strace tool? Does the strace tool working with standard Win32 tools. Because I need a generic tool tracing file accesses on CygWin+Win32 native tools (not only

Re: "Segmentation fault" CygWin tools with code Injection-MS Detours

2005-08-11 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Louis Lecaroz on 8/11/2005 6:45 AM: > Hi, > > I search (I think ;) ) in all forums, newsgroups, mailing list on > internet about this topic but I did not found anything. > I wrote an Advanced "truss like" tool to examine files opened by a

Re: "Segmentation fault" CygWin tools with code Injection-MS Detours

2005-08-11 Thread Louis Lecaroz
Just to prevent you, I have given more details between the truss debugging log & the cygcheck.out which are : As you will see, internal Win32 system calls of CygWin have been correctly hooked, Bash appears to work correctly still it does not fork.