2010-02-04 19:00:18

by Oleg Kutkov

[permalink] [raw]
Subject: Intercepting system calls

Hello.
Maybe this question is often, but all post i found is too old and some
things is wrong...
So, i need to intercept some system calls (socket calls) and make my own
handler.
Is there legal, correct and clean way to do it, without hacking system
call table ?
Thank.

Best regards,
Oleg.


2010-02-04 19:26:33

by Bryan Donlan

[permalink] [raw]
Subject: Re: Intercepting system calls

On Thu, Feb 4, 2010 at 2:00 PM, Oleg Kutkov <[email protected]> wrote:
> Hello.
> Maybe this question is often, but all post i found is too old and some
> things is wrong...
> So, i need to intercept some system calls (socket calls) and make my own
> handler.
> Is there legal, correct and clean way to do it, without hacking system call
> table ?
> Thank.

Why do you need to do this? There may be a better way than overriding syscalls.

2010-02-05 07:20:34

by Bryan Donlan

[permalink] [raw]
Subject: Re: Intercepting system calls

2010/2/5 Oleg Kutkov <[email protected]>:
> Hello. l need to capture and process outgoing and incoming packets from all
> network interfaces, include virtual interfaces. So I try to overload socket
> and if_rx. I'm not found another way to do that.

Why not just use libpcap?