Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /opt/rh/gcc-toolset-11/root/usr/share/systemtap/tapset/linux/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/rh/gcc-toolset-11/root/usr/share/systemtap/tapset/linux/sysc_getpid.stp
# getpid _____________________________________________________
# long sys_getpid(void)

@define _SYSCALL_GETPID_NAME
%(
	name = "getpid"
%)

@define _SYSCALL_GETPID_ARGSTR
%(
	argstr = ""
%)

probe syscall.getpid = dw_syscall.getpid !, nd_syscall.getpid ? {}
probe syscall.getpid.return = dw_syscall.getpid.return !, nd_syscall.getpid.return ? {}

# dw_getpid _____________________________________________________

probe dw_syscall.getpid = kernel.function("sys_getpid").call
{
	@_SYSCALL_GETPID_NAME
	@_SYSCALL_GETPID_ARGSTR
}
probe dw_syscall.getpid.return = kernel.function("sys_getpid").return
{
	@_SYSCALL_GETPID_NAME
	@SYSC_RETVALSTR($return)
}

# nd_getpid _____________________________________________________

probe nd_syscall.getpid = nd1_syscall.getpid!, nd2_syscall.getpid!, tp_syscall.getpid
  { }

probe nd1_syscall.getpid = kprobe.function("sys_getpid")
{
	@_SYSCALL_GETPID_NAME
	@_SYSCALL_GETPID_ARGSTR
}

/* kernel 4.17+ */
probe nd2_syscall.getpid = kprobe.function(@arch_syscall0_prefix "sys_getpid") ?
{
	@_SYSCALL_GETPID_NAME
	@_SYSCALL_GETPID_ARGSTR
}

/* kernel 3.5+, but undesirable because it affects all syscalls */
probe tp_syscall.getpid = kernel.trace("sys_enter")
{
	@__syscall_compat_gate(@const("__NR_getpid"), @const("__NR_compat_getpid"))
	@_SYSCALL_GETPID_NAME
	@_SYSCALL_GETPID_ARGSTR
}

probe nd_syscall.getpid.return = nd1_syscall.getpid.return!, nd2_syscall.getpid.return!, tp_syscall.getpid.return
  { }
  
probe nd1_syscall.getpid.return = kprobe.function("sys_getpid").return
{
	@_SYSCALL_GETPID_NAME
	@SYSC_RETVALSTR(returnval())
}

/* kernel 4.17+ */
probe nd2_syscall.getpid.return = kprobe.function(@arch_syscall0_prefix "sys_getpid").return ?
{
	@_SYSCALL_GETPID_NAME
	@SYSC_RETVALSTR(returnval())
}
 
/* kernel 3.5+, but undesirable because it affects all syscalls */
probe tp_syscall.getpid.return = kernel.trace("sys_exit")
{
	__set_syscall_pt_regs($regs)
	@__syscall_compat_gate(@const("__NR_getpid"), @const("__NR_compat_getpid"))
	@_SYSCALL_GETPID_NAME
	@SYSC_RETVALSTR($ret)
}

Spamworldpro Mini