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

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

?? search.c

?? MIPS下的boottloader yamon 的源代碼
?? C
字號:

/************************************************************************
 *
 *  search.c
 *
 *  Monitor command to search for ascii or hex string in memory.
 *
 *  search [-asc|-hex] <address> <length> <string>
 *
 *
 * ######################################################################
 *
 * Copyright (c) 1999-2000 MIPS Technologies, Inc. All rights reserved. 
 * 
 * Unpublished rights reserved under the Copyright Laws of the United States of 
 * America. 
 * 
 * This document contains information that is proprietary to MIPS Technologies, 
 * Inc. ("MIPS Technologies"). Any copying, modifying or use of this information 
 * (in whole or in part) which is not expressly permitted in writing by MIPS 
 * Technologies or a contractually-authorized third party is strictly 
 * prohibited. At a minimum, this information is protected under unfair 
 * competition laws and the expression of the information contained herein is 
 * protected under federal copyright laws. Violations thereof may result in 
 * criminal penalties and fines. 
 * MIPS Technologies or any contractually-authorized third party reserves the 
 * right to change the information contained in this document to improve 
 * function, design or otherwise. MIPS Technologies does not assume any 
 * liability arising out of the application or use of this information. Any 
 * license under patent rights or any other intellectual property rights owned 
 * by MIPS Technologies or third parties shall be conveyed by MIPS Technologies 
 * or any contractually-authorized third party in a separate license agreement 
 * between the parties. 
 * The information contained in this document constitutes one or more of the 
 * following: commercial computer software, commercial computer software 
 * documentation or other commercial items. If the user of this information, or 
 * any related documentation of any kind, including related technical data or 
 * manuals, is an agency, department, or other entity of the United States 
 * government ("Government"), the use, duplication, reproduction, release, 
 * modification, disclosure, or transfer of this information, or any related 
 * documentation of any kind, is restricted in accordance with Federal 
 * Acquisition Regulation 12.212 for civilian agencies and Defense Federal 
 * Acquisition Regulation Supplement 227.7202 for military agencies. The use of 
 * this information by the Government is further restricted in accordance with 
 * the terms of the license agreement(s) and/or applicable contract terms and 
 * conditions covering this information from MIPS Technologies or any 
 * contractually-authorized third party. 
 *
 ************************************************************************/


/************************************************************************
 *  Include files
 ************************************************************************/

#include <sysdefs.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <shell_api.h>
#include <sys_api.h>
#include "shell.h"

/************************************************************************
 *  Definitions
 ************************************************************************/

#define	STRTYPE_ASC		1	/* ascii string */
#define	STRTYPE_HEX		2	/* hex string */
#define SEARCH_DEFAULT_STRTYPE	STRTYPE_ASC

/************************************************************************
 *  Public variables
 ************************************************************************/

/************************************************************************
 *  Static variables
 ************************************************************************/

/* OPTIONS */
static t_cmd_option options[] =
{ 
#define OPTION_ASC	0
  { "asc",  "Search for ascii string" },
#define OPTION_HEX	1
  { "hex",  "Search for hex string" }
};
#define OPTION_COUNT	(sizeof(options)/sizeof(t_cmd_option))


/************************************************************************
 *  Static function prototypes
 ************************************************************************/

static UINT32 
get_options(
    UINT32 argc,
    char   **argv,
    UINT32 *strtype,
    UINT32 *addr,
    UINT32 *length,
    char   **pstr);

static int hexd(                        /* Get hex digit        */
    char ch);

/************************************************************************
 *  Implementation : Static functions
 ************************************************************************/

/************************************************************************
 *                          search
 ************************************************************************/
static MON_FUNC(search)
{
    UINT32  width;
    UINT32  strtype;
    UINT32  addr;
    UINT32  length;
    char    *str;
    char    sdata[81];
    char    ch;
    UINT32  slen, out, i;
    int	    d1, d2;
    bool    found, ctrlc;
    UINT32  rc;
    char    msg[80];

    rc = get_options( argc, argv, &strtype, &addr, &length, &str );

    if( rc != OK )
        return rc;

    if (!length)
	return OK;

    slen  = 0;
    out   = 0;
    found = FALSE;
    ctrlc = FALSE;

    if (strtype == STRTYPE_HEX)
    {
	/* skip prefix 0x, if present */
	if (str[0] == '0'  &&  tolower(str[1]) == 'x')
	    str += 2;

    	while ((ch = *str++)  &&  (slen < sizeof(sdata)-1))
    	{
	    d1 = hexd(ch);
	    d2 = hexd(*str++);

	    if ((d1 < 0) || (d2 < 0))
	    {
	        return SHELL_ERROR_SYNTAX;
	    }

	    sdata[slen++] = (d1<<4) | d2;
	}
    }
    else
    {
    	while ((ch = *str++)  &&  (slen < sizeof(sdata)))
    	{
	    sdata[slen++] = ch;
	}
    }

    sdata[slen] = 0;

    SHELL_PUTS("Searching after ");

    if (strtype == STRTYPE_ASC)
    {
	if (slen < 30)
	{
	    SHELL_PUTC( '"' );
	    SHELL_PUTS( sdata );
	    SHELL_PUTC( '"' );
        }
	else
	{
	    SHELL_PUTS( "ascii-string" );
	}
    }
    else
    {
	if (slen < 9)
	{
            SHELL_PUTS( "0x" );

	    for (i = 0;  i < slen;  i++)
	    {
	        sprintf( msg, "%02x", (UINT8)sdata[i] );
		SHELL_PUTS( msg );
	    }
	}
	else
	{
	    SHELL_PUTS( "hex-string" );
	}
    }

    sprintf( msg, " in area 0x%08X..0x%08x.\n",
	     addr, addr + length - 1);

    SHELL_PUTS( msg );

    SHELL_PUTS(shell_msg_ctrl_c);

    /* Now do the search */
    for (i = 0;  i <= length - slen;  i++)
    {
	if (memcmp((void *) (addr+i), sdata, slen) == 0)
	{
	    found = TRUE;
	    if ((out++ % 6) == 0)
	    {
		if( SHELL_PUTC( '\n' ) ) 
		{
		    ctrlc = TRUE;
		    break;
		}
	    }

	    sprintf( msg, "0x%08X  ", addr+i);
	    if( SHELL_PUTS( msg ) )
	    {
	        ctrlc = TRUE;
		break;
	    }
	}

	if ((i & 0x0FFF) == 0x0000)
	{
	    if (GETCHAR_CTRLC(DEFAULT_PORT))
	    {
		ctrlc = TRUE;
		break;
	    }
	}
    }

    if (!found)
    {
	SHELL_PUTS("\nNo match found.");
    }

    SHELL_PUTC( '\n' );

    return ctrlc ? SHELL_ERROR_CONTROL_C_DETECTED : OK;
}

/************************************************************************
 *                          get_options
 ************************************************************************/
static UINT32
get_options(
    UINT32 argc,
    char   **argv,
    UINT32 *strtype,
    UINT32 *addr,
    UINT32 *length,
    char   **pstr)
{
    char	   *token;
    t_shell_option decode;
    UINT32	   type;
    bool	   ok 		= TRUE;
    bool	   addr_valid	= FALSE;
    bool	   length_valid	= FALSE;
    bool	   str_valid	= FALSE;
    UINT32	   i;
    UINT32	   arg;
    UINT32	   error = SHELL_ERROR_SYNTAX;

    /* Setup defaults */
    *strtype = SEARCH_DEFAULT_STRTYPE;

    for( arg = 1; 
	          ok && 
	          (arg < argc) && 
		  (token = argv[arg]) &&
                  shell_decode_token( token, &type, &decode );
         arg++ )
    {
	switch( type )
	{
	  case SHELL_TOKEN_OPTION :
	    /* Find match */
	    for(i=0; 
		(i<OPTION_COUNT) &&
		(strcmp(decode.option, options[i].option) != 0);
		i++) ;

	    switch(i)
	    {
	      case OPTION_ASC   :
		*strtype = STRTYPE_ASC; break;
	      case OPTION_HEX   :
		*strtype = STRTYPE_HEX; break;
	      default :
	        error		 = SHELL_ERROR_OPTION;
		shell_error_data = token;
		ok		 = FALSE;
	        break;		      
	    }
	    break;

	  case SHELL_TOKEN_NUMBER :

	    if (!addr_valid)
	    {
		*addr      = decode.number;
		addr_valid = TRUE;
		break;
	    }
	    else if (!length_valid)
	    {
		*length      = decode.number;
		length_valid = TRUE;
		break;
	    }
	    /* else fall-through */

	  case SHELL_TOKEN_STRING :

	    /* Use raw token as search string */
	    if (!str_valid)
	    {
		*pstr     = token;
		str_valid = TRUE;
	    }
	    else
	        ok = FALSE;
	    break;

	  default :
	    ok = FALSE;
	    break;
        }
    }

    if( !length_valid || !str_valid )
        ok = FALSE;

    return ok ?
        sys_validate_range( *addr, *length, sizeof(UINT8), FALSE ) :
	error;
}

/************************************************************************
 *                          hexd
 ************************************************************************/

static int hexd(                        /* Get hex digit		*/
    char ch )				/* Char				*/
{
        if (!isxdigit(ch)) return -1;
        if (islower(ch)) ch = toupper(ch);
        if (isalpha(ch)) ch -= 7;
  
        return ch - 48;
}


/************************************************************************
 *                          cmd stuff
 ************************************************************************/

/* Command definition for search */
static t_cmd cmd_def =
{
    "search",
    search,
    "search [-asc|-hex] <address> <size> <string>",

    "Search for string in the memory area specified by <address> and <size>.\n"
    "Default string type is ASCII. If the search string contains spaces,\n"
    "remember to use quotes around the string.\n"
    "\n"
    "If searching for a hex string, the search pattern must be entered as\n"
    "a number of two-digit hexcodes without spaces inbetween.",

    options,
    OPTION_COUNT,
    FALSE
};


/************************************************************************
 *  Implementation : Public functions
 ************************************************************************/

/************************************************************************
 *
 *                          shell_search_init
 *  Description :
 *  -------------
 *
 *  Initialise command
 *
 *  Return values :
 *  ---------------
 *
 *  void
 *
 ************************************************************************/
t_cmd *
shell_search_init( void )
{
    return &cmd_def;
}


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人爽a毛片一区二区免费| 一区二区欧美在线观看| 久久午夜色播影院免费高清| 欧美日韩一级视频| 3751色影院一区二区三区| 欧美精品高清视频| 精品第一国产综合精品aⅴ| 精品盗摄一区二区三区| 久久久精品人体av艺术| 国产精品欧美精品| 亚洲一级不卡视频| 激情综合五月天| 91色porny在线视频| 91精品综合久久久久久| 国产欧美精品一区二区三区四区| 国产精品五月天| 日韩**一区毛片| 成人激情小说网站| 欧美日韩在线播放| 国产精品美女久久久久av爽李琼| 亚洲精品乱码久久久久久黑人| 亚洲一区二区综合| 国产精华液一区二区三区| 一本大道久久a久久综合婷婷| 欧美一区二区三区四区久久| 欧美极品少妇xxxxⅹ高跟鞋| 天堂成人国产精品一区| 不卡视频在线看| 日韩欧美国产综合| 免费成人小视频| 欧美日韩久久一区二区| 中文字幕不卡在线播放| 亚洲高清视频的网址| 成人免费视频一区| 欧美一区二区观看视频| 亚洲mv在线观看| 欧美婷婷六月丁香综合色| 亚洲欧美视频在线观看| 成人福利视频网站| 欧美国产精品专区| 国产成人av自拍| 久久精品在线观看| 国产高清不卡一区| 欧美国产1区2区| 91视频免费播放| 亚洲制服欧美中文字幕中文字幕| 色综合天天综合在线视频| 国产精品视频九色porn| 色婷婷综合五月| 日日摸夜夜添夜夜添国产精品 | 老司机精品视频在线| 91精品在线免费观看| 国产成人综合视频| 亚洲欧美aⅴ...| 日韩亚洲欧美综合| 国产99久久久久久免费看农村| 国产精品久久久久桃色tv| 在线欧美小视频| 麻豆成人久久精品二区三区红 | 国产宾馆实践打屁股91| 国产精品成人免费| 7777女厕盗摄久久久| 国产露脸91国语对白| 亚洲欧美日韩小说| 精品国产百合女同互慰| 95精品视频在线| 国产原创一区二区三区| 久久精品噜噜噜成人av农村| 国产精品99久| 日韩成人精品在线| 亚洲美女区一区| 日本一区二区三区视频视频| 69久久99精品久久久久婷婷| 99久久精品国产导航| 国产中文字幕精品| 日本欧美在线观看| 亚洲成人av一区二区三区| 久久久五月婷婷| 亚洲欧洲精品天堂一级| 欧美日韩国产乱码电影| 91丨九色丨蝌蚪富婆spa| 精品一区二区三区在线播放视频| 亚洲一区二区视频| 性做久久久久久| 调教+趴+乳夹+国产+精品| 亚洲一区二区三区免费视频| 亚洲已满18点击进入久久| 亚洲色大成网站www久久九九| 国产亚洲成年网址在线观看| 欧美激情在线看| 亚洲欧美偷拍另类a∨色屁股| 亚洲另类在线制服丝袜| 亚洲夂夂婷婷色拍ww47| 香蕉成人啪国产精品视频综合网 | 免费一级欧美片在线观看| 三级亚洲高清视频| 久久99这里只有精品| 国产xxx精品视频大全| 成人av免费网站| 欧美日韩激情一区二区| 欧美成人高清电影在线| 国产日产欧美一区二区视频| 国产精品久久久久久久久免费丝袜 | 久久久欧美精品sm网站| 日本一区二区三区四区在线视频| 首页亚洲欧美制服丝腿| 日本一区二区三区国色天香 | 日韩欧美视频在线| 国产欧美日本一区视频| 亚洲男人天堂av| 男人操女人的视频在线观看欧美| 国产成人免费在线视频| 欧美性感一类影片在线播放| 久久久久97国产精华液好用吗| 中文字幕一区二区在线观看| 久久国产精品免费| 欧美伊人久久久久久久久影院| 精品国产亚洲在线| 亚洲国产视频直播| 成人av在线影院| 国产精品婷婷午夜在线观看| 国产精品盗摄一区二区三区| 亚洲男人的天堂网| 久久99精品国产麻豆婷婷洗澡| 色婷婷av久久久久久久| 国产欧美久久久精品影院| 九九九精品视频| 欧美一二三区在线| 日本特黄久久久高潮| 欧美在线三级电影| 亚洲伊人色欲综合网| 成人精品一区二区三区四区| 国产三级精品在线| 国产高清视频一区| 国产精品人妖ts系列视频| eeuss鲁片一区二区三区 | 一区二区三区中文在线| 亚洲影视在线播放| 国产在线精品不卡| 2021国产精品久久精品| 激情小说亚洲一区| 国产精品理论片在线观看| 成人福利电影精品一区二区在线观看| 久久人人超碰精品| 久久电影网电视剧免费观看| 欧美经典一区二区| 91视频91自| 久久精品国产精品亚洲红杏| 国产日韩欧美在线一区| 在线免费观看一区| 久久超碰97人人做人人爱| 中文字幕在线一区| 欧美一区二区视频免费观看| 国产乱色国产精品免费视频| 亚洲一区中文在线| 精品国产三级电影在线观看| 91麻豆精品在线观看| 美女免费视频一区二区| 亚洲影院理伦片| 国产精品国产自产拍在线| 9191精品国产综合久久久久久| 国产精品99久久久| 麻豆91在线观看| 香蕉成人啪国产精品视频综合网| 久久九九久久九九| 日韩一区二区三区在线观看| 在线亚洲+欧美+日本专区| 国产成+人+日韩+欧美+亚洲| 久久精品国产一区二区三区免费看| 久久久精品综合| 国产日韩精品一区二区三区| 精品欧美一区二区三区精品久久| 欧美精品日韩综合在线| 欧美性色综合网| 国模少妇一区二区三区| 亚洲人一二三区| 欧美xxxx老人做受| 在线视频一区二区三| 轻轻草成人在线| 日韩精品一二三四| 婷婷一区二区三区| 蜜臀av性久久久久蜜臀aⅴ| 亚洲va中文字幕| 国内精品写真在线观看| 7777精品伊人久久久大香线蕉超级流畅| 捆绑变态av一区二区三区| 日本欧美一区二区在线观看| 免费的成人av| 国产精品99久久久| a级高清视频欧美日韩| 日本高清不卡视频| 欧美少妇xxx| 久久免费看少妇高潮| 香蕉影视欧美成人| 国产一区二区三区精品视频| 成人性视频网站| 91麻豆精品国产91久久久| 久久一留热品黄| 欧美国产精品一区二区三区| 亚洲狠狠丁香婷婷综合久久久|