#The Most Simple Method to get sys_call_table addr
#c0d3 by : ev1lut10n
sub cek_kernel
{
  open(UNAME, "uname -a |");
  while (<UNAME>) 
       {
     $tampilan .=  $_;
       }
  close(UNAME);
  if($tampilan=~/2.4/)
   {
    our $style="oldies";	   
   } 
   
}
sub get_syscall_table_addr
{
eval
{
print "The Most Simple Method to get sys_call_table addr";
print "\nc0d3 by : ev1lut10n";
if($style=~"oldies")
 {
	$simpat="/proc/ksyms";
 }
 else
 {
     	$simpat="/proc/kallsyms";

 }
if(-e $simpat)
 {
	 print "\n[+] Checkin $simpat\n";
open(KALLSYMS, "cat $simpat |");
                                     while (<KALLSYMS>) 
                                            {
                                                $tampilan_simbol .=  $_;
						($mem,$mode,$simbol) = split;	
							if($simbol=~/sys_call_table/)
							{
							  print "[+] Got sys_call_table addr :".$mem."\n";
						    	}
					    }
close(KALLSYMS);
  }
  else
  {
	  print "\n[+] Checkin System.Map\n";
	  if(-e "/boot/System.map*")
	    {
		 $sysmap="/boot/System.map*";   
	    }
	    else
	    {
		     $sysmap="/System.ma*";   
	    }
	  open(SYSMAP, "cat /boot/System.ma* |");
                                     while (<SYSMAP>) 
                                            {
                                                $tampilan_simbol .=  $_;
						($mem,$mode,$simbol) = split;	
							if($simbol=~/sys_call_table/)
							{
							   print "[+] Got sys_call_table addr :".$mem."\n";
						    	}
					    }
close(SYSMAP);
  }
  
}
}
get_syscall_table_addr();