亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ksym.c

?? linux下記錄系統日志代碼以及記錄內核日志代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*    ksym.c - functions for kernel address->symbol translation    Copyright (c) 1995, 1996  Dr. G.W. Wettstein <greg@wind.rmcc.com>    Copyright (c) 1996 Enjellic Systems Development    This file is part of the sysklogd package, a kernel and system log daemon.    This program is free software; you can redistribute it and/or modify    it under the terms of the GNU General Public License as published by    the Free Software Foundation; either version 2 of the License, or    (at your option) any later version.    This program is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    GNU General Public License for more details.    You should have received a copy of the GNU General Public License    along with this program; if not, write to the Free Software    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.*//* * This file contains functions which handle the translation of kernel * numeric addresses into symbols for the klogd utility. * * Sat Oct 28 09:00:14 CDT 1995:  Dr. Wettstein *	Initial Version. * * Fri Nov 24 12:50:52 CST 1995:  Dr. Wettstein *	Added VERBOSE_DEBUGGING define to make debugging output more *	manageable. * *	Added support for verification of the loaded kernel symbols.  If *	no version information can be be found in the mapfile a warning *	message is issued but translation will still take place.  This *	will be the default case if kernel versions < 1.3.43 are used. * *	If the symbols in the mapfile are of the same version as the kernel *	that is running an informative message is issued.  If the symbols *	in the mapfile do not match the current kernel version a warning *	message is issued and translation is disabled. * * Wed Dec  6 16:14:11 CST 1995:  Dr. Wettstein *	Added /boot/System.map to the list of symbol maps to search for. *	Also made this map the first item in the search list.  I am open *	to CONSTRUCTIVE suggestions for any additions or corrections to *	the list of symbol maps to search for.  Be forewarned that the *	list in use is the consensus agreement between myself, Linus and *	some package distributers.  It is a given that no list will suit *	everyone's taste.  If you have rabid concerns about the list *	please feel free to edit the system_maps array and compile your *	own binaries. * *	Added support for searching of the list of symbol maps.  This *	allows support for access to multiple symbol maps.  The theory *	behind this is that a production kernel may have a system map in *	/boot/System.map.  If a test kernel is booted this system map *	would be skipped in favor of one found in /usr/src/linux. * * Thu Jan 18 11:18:31 CST 1996:  Dr. Wettstein *	Added patch from beta-testers to allow for reading of both *	ELF and a.out map files. * * Wed Aug 21 09:15:49 CDT 1996:  Dr. Wettstein *	Reloading of kernel module symbols is now turned on by the *	SetParanoiaLevel function.  The default behavior is to NOT reload *	the kernel module symbols when a protection fault is detected. * *	Added support for freeing of the current kernel module symbols. *	This was necessary to support reloading of the kernel module symbols. * *	When a matching static symbol table is loaded the kernel version *	number is printed. * * Mon Jun  9 17:12:42 CST 1997:  Martin Schulze *	Added #1 and #2 to some error messages in order to being able *	to divide them (ulmo@Q.Net) * * Fri Jun 13 10:50:23 CST 1997:  Martin Schulze *	Changed definition of LookupSymbol to non-static because it is *	used in klogd.c, too. * * Fri Jan  9 23:00:08 CET 1998: Martin Schulze <joey@infodrom.north.de> *	Fixed bug that caused klogd to die if there is no System.map available. * * Sun 29 Mar 18:14:07 BST 1998: Mark Simon Phillips <M.S.Phillips@nortel.co.uk> *	Switched to fgets() as gets() is not buffer overrun secure. * * Mon Apr 13 18:18:45 CEST 1998: Martin Schulze <joey@infodrom.north.de> *	Modified loop for detecting the correct system map.  Now it won't *	stop if a file has been found but doesn't contain the correct map. *	Special thanks go go Mark Simon Phillips for the hint. * * Mon Oct 12 00:42:30 CEST 1998: Martin Schulze <joey@infodrom.north.de> *	Modified CheckVersion() *	. Use shift to decode the kernel version *	. Compare integers of kernel version *	. extract major.minor.patch from utsname.release via sscanf() *	The reason lays in possible use of kernel flavours which *	modify utsname.release but no the Version_ symbol. * * Sun Feb 21 22:27:49 EST 1999: Keith Owens <kaos@ocs.com.au> *	Fixed bug that caused klogd to die if there is no sym_array available. * * Tue Sep 12 23:48:12 CEST 2000: Martin Schulze <joey@infodrom.ffis.de> *	Close symbol file in InitKsyms() when an error occurred. *//* Includes. */#include <stdlib.h>#include <malloc.h>#include <sys/utsname.h>#include "klogd.h"#include "ksyms.h"#define VERBOSE_DEBUGGING 0/* Variables static to this module. */struct sym_table{	unsigned long value;	char *name;};static int num_syms = 0;static int i_am_paranoid = 0;static char vstring[12];static struct sym_table *sym_array = (struct sym_table *) 0;static char *system_maps[] ={	"/boot/System.map",	"/System.map",#if defined(TEST)	"./System.map",#endif	(char *) 0};#if defined(TEST)int debugging;#elseextern int debugging;#endif/* Function prototypes. */static char * FindSymbolFile(void);static int AddSymbol(unsigned long, char*);static void FreeSymbols(void);static int CheckVersion(char *);static int CheckMapVersion(char *);/************************************************************************** * Function:	InitKsyms * * Purpose:	This function is responsible for initializing and loading *		the data tables used by the kernel address translations. * * Arguements:	(char *) mapfile * *			mapfile:->	A pointer to a complete path *					specification of the file containing *					the kernel map to use. * * Return:	int * *		A boolean style context is returned.  The return value will *		be true if initialization was successful.  False if not. **************************************************************************/extern int InitKsyms(mapfile)	char *mapfile;{	auto char	type,			sym[512];	auto int version = 0;	auto unsigned long int address;	auto FILE *sym_file;	/* Check and make sure that we are starting with a clean slate. */	if ( num_syms > 0 )		FreeSymbols();	/*	 * Search for and open the file containing the kernel symbols.	 */	if ( mapfile != (char *) 0 )	{		if ( (sym_file = fopen(mapfile, "r")) == (FILE *) 0 )		{			Syslog(LOG_WARNING, "Cannot open map file: %s.", \			       mapfile);			return(0);		}	}	else	{		if ( (mapfile = FindSymbolFile()) == (char *) 0 ) 		{			Syslog(LOG_WARNING, "Cannot find map file.");			if ( debugging )				fputs("Cannot find map file.\n", stderr);			return(0);		}				if ( (sym_file = fopen(mapfile, "r")) == (FILE *) 0 )		{			Syslog(LOG_WARNING, "Cannot open map file.");			if ( debugging )				fputs("Cannot open map file.\n", stderr);			return(0);		}	}		/*	 * Read the kernel symbol table file and add entries for each	 * line.  I suspect that the use of fscanf is not really in vogue	 * but it was quick and dirty and IMHO suitable for fixed format	 * data such as this.  If anybody doesn't agree with this please	 * e-mail me a diff containing a parser with suitable political	 * correctness -- GW.	 */	while ( !feof(sym_file) )	{		if ( fscanf(sym_file, "%lx %c %s\n", &address, &type, sym)		    != 3 )		{			Syslog(LOG_ERR, "Error in symbol table input (#1).");			fclose(sym_file);			return(0);		}		if ( VERBOSE_DEBUGGING && debugging )			fprintf(stderr, "Address: %lx, Type: %c, Symbol: %s\n",				address, type, sym);		if ( AddSymbol(address, sym) == 0 )		{			Syslog(LOG_ERR, "Error adding symbol - %s.", sym);			fclose(sym_file);			return(0);		}		if ( version == 0 )			version = CheckVersion(sym);	}		Syslog(LOG_INFO, "Loaded %d symbols from %s.", num_syms, mapfile);	switch ( version )	{	    case -1:		Syslog(LOG_WARNING, "Symbols do not match kernel version.");		num_syms = 0;		break;	    case 0:		Syslog(LOG_WARNING, "Cannot verify that symbols match " \		       "kernel version.");		break;			    case 1:		Syslog(LOG_INFO, "Symbols match kernel version %s.", vstring);		break;	}			fclose(sym_file);	return(1);}/************************************************************************** * Function:	FindSymbolFile * * Purpose:	This function is responsible for encapsulating the search *		for a valid symbol file.  Encapsulating the search for *		the map file in this function allows an intelligent search *		process to be implemented. * *		The list of symbol files will be searched until either a *		symbol file is found whose version matches the currently *		executing kernel or the end of the list is encountered.  If *		the end of the list is encountered the first available *		symbol file is returned to the caller. * *		This strategy allows klogd to locate valid symbol files *		for both a production and an experimental kernel.  For *		example a map for a production kernel could be installed *		in /boot.  If an experimental kernel is loaded the map *		in /boot will be skipped and the map in /usr/src/linux would *		be used if its version number matches the executing kernel. * * Arguements:	None specified. * * Return:	char * * *		If a valid system map cannot be located a null pointer *		is returned to the caller. * *		If the search is succesful a pointer is returned to the *		caller which points to the name of the file containing *		the symbol table to be used. **************************************************************************/static char * FindSymbolFile(){	auto char	*file = (char *) 0,			**mf = system_maps;	auto struct utsname utsname;	static char symfile[100];	auto FILE *sym_file = (FILE *) 0;        if ( uname(&utsname) < 0 )        {                Syslog(LOG_ERR, "Cannot get kernel version information.");                return(0);        }	if ( debugging )		fputs("Searching for symbol map.\n", stderr);		for (mf = system_maps; *mf != (char *) 0 && file == (char *) 0; ++mf)	{ 		sprintf (symfile, "%s-%s", *mf, utsname.release);		if ( debugging )			fprintf(stderr, "Trying %s.\n", symfile);		if ( (sym_file = fopen(symfile, "r")) != (FILE *) 0 ) {			if (CheckMapVersion(symfile) == 1)				file = symfile;		}		if (sym_file == (FILE *) 0 || file == (char *) 0) {			sprintf (symfile, "%s", *mf);			if ( debugging )				fprintf(stderr, "Trying %s.\n", symfile);			if ( (sym_file = fopen(symfile, "r")) != (FILE *) 0 ) {				if (CheckMapVersion(symfile) == 1)					file = symfile;			}		}	}	/*	 * At this stage of the game we are at the end of the symbol	 * tables.	 */	if ( debugging )		fprintf(stderr, "End of search list encountered.\n");	return(file);}/************************************************************************** * Function:	CheckVersion * * Purpose:	This function is responsible for determining whether or *		the system map being loaded matches the version of the *		currently running kernel. * *		The kernel version is checked by examing a variable which *		is of the form:	_Version_66347 (a.out) or Version_66437 (ELF). * *		The suffix of this variable is the current kernel version *		of the kernel encoded in base 256.  For example the *		above variable would be decoded as: * *			(66347 = 1*65536 + 3*256 + 43 = 1.3.43) * *		(Insert appropriate deities here) help us if Linus ever *		needs more than 255 patch levels to get a kernel out the *		door... :-) * * Arguements:	(char *) version * *			version:->	A pointer to the string which *					is to be decoded as a kernel *					version variable. * * Return:	int * *		       -1:->	The currently running kernel version does *				not match this version string. * *			0:->	The string is not a kernel version variable. * *			1:->	The executing kernel is of the same version *				as the version string. **************************************************************************/static int CheckVersion(version)	char *version;	{	auto int	vnum,			major,			minor,			patch;#ifndef TESTING	int kvnum;	auto struct utsname utsname;#endif	static char *prefix = { "Version_" };	/* Early return if there is no hope. */	if ( strncmp(version, prefix, strlen(prefix)) == 0  /* ELF */ ||	   (*version == '_' &&		strncmp(++version, prefix, strlen(prefix)) == 0 ) /* a.out */ )		;	else		return(0);	/*	 * Since the symbol looks like a kernel version we can start	 * things out by decoding the version string into its component	 * parts.	 */	vnum = atoi(version + strlen(prefix));	patch = vnum & 0x000000FF;	minor = (vnum >> 8) & 0x000000FF;	major = (vnum >> 16) & 0x000000FF;	if ( debugging )		fprintf(stderr, "Version string = %s, Major = %d, " \		       "Minor = %d, Patch = %d.\n", version +		       strlen(prefix), major, minor, \		       patch);	sprintf(vstring, "%d.%d.%d", major, minor, patch);#ifndef TESTING

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩三级一区二区| 日韩精品在线一区| 久久国产精品色婷婷| 一色桃子久久精品亚洲| 91精品国产乱| 97久久精品人人做人人爽| 免费日韩伦理电影| 一区二区三区在线播放| 国产日韩精品久久久| 欧美熟乱第一页| 97久久人人超碰| 国产成人亚洲综合a∨婷婷图片| 亚洲国产一区二区三区| 国产精品久久精品日日| 久久综合九色综合欧美就去吻 | 国产亚洲精品bt天堂精选| 欧美日韩国产高清一区二区| 成人免费毛片片v| 国模娜娜一区二区三区| 日韩高清一级片| 亚洲图片欧美视频| 日韩毛片视频在线看| 中文字幕av资源一区| 2023国产精品自拍| 日韩女优av电影| 日韩网站在线看片你懂的| 精品视频1区2区| 色婷婷精品久久二区二区蜜臂av| 波多野结衣视频一区| 国产精品69毛片高清亚洲| 激情国产一区二区| 蜜臀91精品一区二区三区| 丝袜美腿亚洲色图| 午夜不卡av免费| 青椒成人免费视频| 免费久久精品视频| 伦理电影国产精品| 久久福利视频一区二区| 久久成人麻豆午夜电影| 国产在线精品一区二区夜色| 精品一区二区三区不卡| 国产麻豆成人传媒免费观看| 国产一区二区伦理片| 丁香啪啪综合成人亚洲小说| 波多野结衣欧美| 日本高清不卡一区| 欧美日韩日日夜夜| 日韩亚洲国产中文字幕欧美| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 天天综合天天做天天综合| 香蕉av福利精品导航| 日产国产欧美视频一区精品| 欧美a级一区二区| 韩国视频一区二区| 成人免费精品视频| 一本色道久久综合亚洲精品按摩| 欧美日韩久久一区二区| 日韩精品一区二区三区四区| 久久免费视频色| 国产精品国模大尺度视频| 亚洲视频狠狠干| 婷婷综合另类小说色区| 免费人成精品欧美精品| 国产一区二区三区免费播放 | 色先锋aa成人| 欧美体内she精高潮| 日韩一区二区精品在线观看| 久久久精品综合| 亚洲色图在线视频| 免费三级欧美电影| k8久久久一区二区三区| 欧美色图一区二区三区| 日韩欧美在线123| 中文字幕国产精品一区二区| 亚洲午夜一区二区三区| 欧美a级一区二区| www.日韩在线| 日韩一区二区电影| 国产精品久久久久久妇女6080| 石原莉奈一区二区三区在线观看| 黄色小说综合网站| 在线观看精品一区| 久久久99久久精品欧美| 亚洲精品乱码久久久久久| 久久国产综合精品| 色综合久久中文字幕| 精品久久久久久综合日本欧美| 自拍av一区二区三区| 精品一区二区三区免费视频| 一本高清dvd不卡在线观看| 精品欧美久久久| 一区二区三区四区av| 福利电影一区二区三区| 欧美一区二区三区男人的天堂| 专区另类欧美日韩| 国产一区二三区| 日韩一区二区三区精品视频| 亚洲图片激情小说| 国产一区二区在线观看免费| 欧美日韩不卡一区二区| 中文子幕无线码一区tr| 蜜臀av性久久久久蜜臀aⅴ四虎 | 久久久精品天堂| 亚洲成人av在线电影| 99国产精品国产精品久久| 久久一区二区三区四区| 日韩电影网1区2区| 欧美日韩亚洲综合在线| 日韩码欧中文字| 不卡欧美aaaaa| 久久久久久久网| 久久精品国产网站| 欧美一区二区三区四区视频| 亚洲电影一区二区三区| 91在线视频在线| 中文成人综合网| 国产精品亚洲人在线观看| 欧美va亚洲va在线观看蝴蝶网| 日本视频一区二区三区| 欧美精品在线一区二区三区| 亚洲一区中文在线| 91视频观看视频| 日韩毛片精品高清免费| 97精品久久久午夜一区二区三区| 国产亚洲成年网址在线观看| 国产一区二区在线观看免费| 精品国产乱码久久久久久免费| 日本亚洲三级在线| 日韩午夜中文字幕| 久久精品久久99精品久久| 日韩女优av电影在线观看| 理论电影国产精品| 欧美成人一区二区三区在线观看| 免费成人在线影院| 欧美videofree性高清杂交| 麻豆91在线看| 久久综合久久鬼色中文字| 国产精品一区二区三区四区| 国产欧美一区二区三区在线看蜜臀 | 一区二区三区视频在线看| 色狠狠色噜噜噜综合网| 亚洲最大的成人av| 欧美喷潮久久久xxxxx| 天堂久久久久va久久久久| 欧美肥妇free| 老司机精品视频一区二区三区| 欧美电影免费观看高清完整版在线 | 欧美日韩亚洲另类| 亚洲成av人片www| 欧美一级午夜免费电影| 国产在线精品一区在线观看麻豆| 久久精品日产第一区二区三区高清版 | 亚洲电影在线播放| 日韩欧美亚洲另类制服综合在线| 国内精品视频一区二区三区八戒| 久久久精品综合| 91免费观看视频| 亚洲国产成人porn| 日韩免费观看高清完整版| 国产乱码字幕精品高清av | 久久精品人人爽人人爽| 成人激情开心网| 亚洲一区av在线| 日韩免费电影一区| 成人免费看片app下载| 亚洲影视在线观看| 日韩精品一区二区三区在线| 国产成人8x视频一区二区| 亚洲综合无码一区二区| 欧美成人在线直播| 91丨九色丨尤物| 免费欧美在线视频| 亚洲欧洲成人精品av97| 欧美三级乱人伦电影| 九色|91porny| 一区二区三区在线视频免费 | 亚洲精品v日韩精品| 欧美一区二区三区视频在线观看| 懂色av一区二区三区免费观看| 亚洲一区二区三区四区中文字幕 | 亚洲最色的网站| 久久午夜免费电影| 欧美午夜精品电影| 国产精品一区二区久久精品爱涩| 一区二区成人在线观看| 久久综合给合久久狠狠狠97色69| 色素色在线综合| 国产乱码精品一品二品| 亚洲图片一区二区| 国产精品美女久久久久高潮| 欧美日韩国产另类不卡| 99久久精品一区二区| 日本成人在线电影网| 亚洲三级免费观看| 久久久久久久久97黄色工厂| 欧美日韩一区三区| 色综合久久中文综合久久97| 国产呦萝稀缺另类资源| 日韩高清在线电影| 亚洲已满18点击进入久久|