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

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

?? disasm.c

?? 反匯編工具原代碼,從sourceforge上下的
?? C
?? 第 1 頁 / 共 5 頁
字號:
/*
 *
 * File Name: 
 *
 *		disasm.c
 *
 * Summary:
 *
 *		This file was created to be included within a 'disassembler' project for PE 
 *		image files running on x86 and x86-compatible processors.
 *
 *		File contains functions for disassembling IA32 binary instructions
 *
 * 
 *
 * Copyright (C) 2004, Isaac Sigasa [isigasa@ananzi.co.za]
 * All Rights Reserved
 *
 *
 *  
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 *
 *		-	Redistributions of source code must retain the above copyright notice, 
 *			this list of conditions and the following disclaimer. 
 *
 *		-	Redistributions in binary form must reproduce the above copyright notice, 
 *			this list of conditions and the following disclaimer in the documentation 
 *			and/or other materials provided with the distribution. 
 *
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
 * ARE DISCLAIMED. 
 * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 *
 */

#include <stdio.h>
#include <string.h>
#include <windows.h>

#include "Disasm.h"


extern InstructionTemplate _11OpcodeExtensions[0x10][0x8][0x3];
extern InstructionTemplate _1ByteOpcode[0x10][0x10];
extern InstructionTemplate _2ByteOpcode[0x10][0x10][0x5];
extern InstructionTemplate MemOpcodeExtensions[0x10][0x8][0x3];
extern InstructionTemplate FPUModRMReg[0x8][0x8];

extern InstructionTemplate FPUModRMFullD8[0x4][0x10];
extern InstructionTemplate FPUModRMFullD9[0x4][0x10];
extern InstructionTemplate FPUModRMFullDA[0x4][0x10];
extern InstructionTemplate FPUModRMFullDB[0x4][0x10];
extern InstructionTemplate FPUModRMFullDC[0x4][0x10];
extern InstructionTemplate FPUModRMFullDD[0x4][0x10];
extern InstructionTemplate FPUModRMFullDE[0x4][0x10];
extern InstructionTemplate FPUModRMFullDF[0x4][0x10];


int IsIA32InstructionPrefix(unsigned char c)
{
	switch(c)
	{
		case 0xF0:
		case 0xF2:
		case 0xF3:
		case 0x2E:
		case 0x36:
		case 0x3E:
		case 0x26:
		case 0x64:
		case 0x65:
		case 0x66:
		case 0x67:
			return 1;
	};
	return 0;
};


void FetchOperandDescriptors(const InstructionTemplate *pInstructionTemplate, IA32InstructionDecode *pIA32Decode)
{
	int iCol = 0, iTemp = 0;

	if(pInstructionTemplate->strOperandsDescr == N)
		return;
	if(!strlen(pIA32Decode->SIA32InstructionDescription.strOperandA))
	{
		while((pInstructionTemplate->strOperandsDescr[iCol] != 0) && (pInstructionTemplate->strOperandsDescr[iCol] != ','))
		{		
			pIA32Decode->SIA32InstructionDescription.strOperandA[iTemp++] = pInstructionTemplate->strOperandsDescr[iCol];
			iCol++;
		}
	}
	else
		iCol = 0;
	iTemp = 0;
	if(pInstructionTemplate->strOperandsDescr[iCol] == ',')
		iCol++;
	if(!strlen(pIA32Decode->SIA32InstructionDescription.strOperandB))
	{
		while((pInstructionTemplate->strOperandsDescr[iCol] != 0) && (pInstructionTemplate->strOperandsDescr[iCol] != ','))
		{		
			pIA32Decode->SIA32InstructionDescription.strOperandB[iTemp++] = pInstructionTemplate->strOperandsDescr[iCol];
			iCol++;
		};
	}
	else
		iCol = 0;
	iTemp = 0;
	if(pInstructionTemplate->strOperandsDescr[iCol] == ',')
		iCol++;
	if(!strlen(pIA32Decode->SIA32InstructionDescription.strOperandC))
		while((pInstructionTemplate->strOperandsDescr[iCol] != 0) && (pInstructionTemplate->strOperandsDescr[iCol] != ','))
		{			
			pIA32Decode->SIA32InstructionDescription.strOperandC[iTemp++] = pInstructionTemplate->strOperandsDescr[iCol];
			iCol++;
		};
};


unsigned char GetSegmentOverride(IA32InstructionDecode *pIA32Decode)
{
	int i;
	char strSegOverrides[] = {0x2E,0x36,0x3E,0x26,0x64,0x65,0};

	for(i = 0; i < pIA32Decode->SIA32InstructionHelper.cbRawPrefixes; i++)
		if(strchr(strSegOverrides,pIA32Decode->SIA32RawInstruction.caRawPrefixes[i]))
			return pIA32Decode->SIA32RawInstruction.caRawPrefixes[i];
	return 0;
};


void GetSegmentOverrideStr(unsigned char sreg, char*strBuffer, int cbBuffer)
{
	ZeroMemory(strBuffer,cbBuffer);
	switch(sreg)
	{
		case 0x2E:
			strncpy(strBuffer,"cs",cbBuffer);
			break;
		case 0x36:
			strncpy(strBuffer,"ss",cbBuffer);
			break;
		case 0x3E:
			strncpy(strBuffer,"ds",cbBuffer);
			break;
		case 0x26:
			strncpy(strBuffer,"es",cbBuffer);
			break;
		case 0x64:
			strncpy(strBuffer,"fs",cbBuffer);
			break;
		case 0x65:
			strncpy(strBuffer,"gs",cbBuffer);
			break;
	};
};


int FetchPrefixes(const unsigned char *pStart, IA32InstructionDecode *pIA32Decode)
{
	int i;

	ZeroMemory(pIA32Decode->SIA32InstructionDescription.strPrefix,sizeof(pIA32Decode->SIA32InstructionDescription.strPrefix));
	ZeroMemory(pIA32Decode->SIA32RawInstruction.caRawPrefixes,sizeof(pIA32Decode->SIA32RawInstruction.caRawPrefixes));
	pIA32Decode->SIA32InstructionHelper.cbRawPrefixes = 0;
	
	strcat(pIA32Decode->SIA32InstructionDescription.strPrefix,"");

	// Instruction prefixes can only be up to four, so let's probe for at most four times 	
	for(i = 0; i < 4; i++)
	{
		switch(pStart[i])
		{
			case 0xF0:
				if(strlen(pIA32Decode->SIA32InstructionDescription.strPrefix))
					strcat(pIA32Decode->SIA32InstructionDescription.strPrefix," lock");
				else
					strcat(pIA32Decode->SIA32InstructionDescription.strPrefix,"lock");
				break;
			case 0xF2:
				if(strlen(pIA32Decode->SIA32InstructionDescription.strPrefix))
					strcat(pIA32Decode->SIA32InstructionDescription.strPrefix," repne");
				else
					strcat(pIA32Decode->SIA32InstructionDescription.strPrefix,"repne");
				break;
			case 0xF3:
				if(strlen(pIA32Decode->SIA32InstructionDescription.strPrefix))
					strcat(pIA32Decode->SIA32InstructionDescription.strPrefix," rep");
				else
					strcat(pIA32Decode->SIA32InstructionDescription.strPrefix,"rep");
				break;
			case 0x2E:
			case 0x36:
			case 0x3E:
			case 0x26:
			case 0x64:
			case 0x65:
			case 0x66:
			case 0x67:				
				break;
			default:
				return i;
		};
		pIA32Decode->SIA32RawInstruction.caRawPrefixes[i] = pStart[i];
		pIA32Decode->SIA32InstructionHelper.cbRawPrefixes++;			
	};
	return i;
};


int IA32InstructionPrefixExists(unsigned char cPrefix, IA32InstructionDecode *pIA32Decode)
{
	int i;

	for(i = 0; i < pIA32Decode->SIA32InstructionHelper.cbRawPrefixes; i++)
		if(pIA32Decode->SIA32RawInstruction.caRawPrefixes[i] == cPrefix)
			return 1;
	return 0;
};


int FetchFPUInstruction(IA32InstructionDecode *pIA32Decode)
{
	unsigned char ModRM = pIA32Decode->SIA32RawInstruction.ModRM;
	int iRow;
	int iCol;
	InstructionTemplate *pInstructionTemplate = NULL;

	if((ModRM >= 0) && (ModRM <= 0xBF))
	{
		iRow = pIA32Decode->SIA32RawInstruction.URawOpcode.cByteRawOpcode - 0xD8;
		iCol = (ModRM & 0x38) >> 3;

		pInstructionTemplate = &FPUModRMReg[iRow][iCol];
		if(pInstructionTemplate->strOpcode == N)
			return 1;
		strcpy(pIA32Decode->SIA32InstructionDescription.strOpcode,pInstructionTemplate->strOpcode);
		FetchOperandDescriptors(pInstructionTemplate,pIA32Decode);
		return 1;
	};
	iRow = (ModRM & 0xF0) >> 4;
	iRow -= 0x0B + 1;
	iCol = ModRM & 0x0F;

	switch(pIA32Decode->SIA32RawInstruction.URawOpcode.cByteRawOpcode)
	{
	case 0xD8:
		pInstructionTemplate = &FPUModRMFullD8[iRow][iCol];
		break;
	case 0xD9:
		pInstructionTemplate = &FPUModRMFullD9[iRow][iCol];
		break;
	case 0xDA:
		pInstructionTemplate = &FPUModRMFullDA[iRow][iCol];
		break;
	case 0xDB:
		pInstructionTemplate = &FPUModRMFullDB[iRow][iCol];
		break;
	case 0xDC:
		pInstructionTemplate = &FPUModRMFullDC[iRow][iCol];
		break;
	case 0xDD:
		pInstructionTemplate = &FPUModRMFullDD[iRow][iCol];
		break;
	case 0xDE:
		pInstructionTemplate = &FPUModRMFullDE[iRow][iCol];
		break;
	case 0xDF:
		pInstructionTemplate = &FPUModRMFullDF[iRow][iCol];
		break;
	};

	if(((ModRM & 0xF0) >> 4) < 0x0B)
		return 1;
	iRow = (ModRM & 0xF0) >> 4;
	iRow -= 0x0B + 1;
	iCol = ModRM & 0x0F;
	if(pInstructionTemplate->strOpcode == N)
			return 1;
	
	strcpy(pIA32Decode->SIA32InstructionDescription.strOpcode,pInstructionTemplate->strOpcode);
	FetchOperandDescriptors(pInstructionTemplate,pIA32Decode);	

	return 1;
};


int FetchInstructionFrom1ByteOpcodeTable(const unsigned char *pStart,IA32InstructionDecode *pIA32Decode)
{
	unsigned int iRow, iCol;
	InstructionTemplate *pInstructionTemplate;
	unsigned char ucTemp;
	unsigned char ModRM;
	char *pchr1;
	char *pchr2;
	char strTemp[64];

	ucTemp = pIA32Decode->SIA32RawInstruction.URawOpcode.cByteRawOpcode = pStart[0];
	pIA32Decode->SIA32InstructionHelper.cbRawOpcode = 1;

	/* FPU encodings are in 1 byte opcode table and are running from 0xD8 to 0xDF
	 * Let's check if we have an FP instruction and deal with it
	 */
	if((ucTemp >= 0xD8) && (ucTemp <= 0xDF))
	{
		/* if it's an FP instruction - we have an ModRM byte */
		ModRM = pIA32Decode->SIA32RawInstruction.ModRM = pStart[1];
		pIA32Decode->SIA32InstructionHelper.boolModRMExists = 1;
		FetchFPUInstruction(pIA32Decode);
		return 1;
	}
	iRow = (unsigned int)(pStart[0] >> 4);
	iCol = (unsigned int)(pStart[0] & 0x0F);
	pInstructionTemplate = &_1ByteOpcode[iRow][iCol];	
	if(pInstructionTemplate->strOpcode == N)
		return 1;		
	if(!strnicmp(pInstructionTemplate->strOpcode,"__G",strlen("__G")))
	{
		pIA32Decode->SIA32RawInstruction.ModRM = pStart[1];
		pIA32Decode->SIA32InstructionHelper.boolModRMExists = 1;
		pchr1 = pInstructionTemplate->strOpcode + strlen("__G");
		ucTemp = (unsigned char)strtoul(pchr1,&pchr2,10);
		if((ucTemp == 0) || (*pchr2 != 0))
			return 0;

		if((pIA32Decode->SIA32RawInstruction.ModRM & 0xC0) == 0xC0)
			FetchInstructionFromOpcodeExtensionsTable(ucTemp,pStart,_11OpcodeExtensions,pIA32Decode);
		else
			FetchInstructionFromOpcodeExtensionsTable(ucTemp,pStart,MemOpcodeExtensions,pIA32Decode);
	}
	else
		strcpy(pIA32Decode->SIA32InstructionDescription.strOpcode,pInstructionTemplate->strOpcode);
	FetchOperandDescriptors(pInstructionTemplate,pIA32Decode);
	if(strchr(pIA32Decode->SIA32InstructionDescription.strOperandA,'/'))
		if(!strcmp(pIA32Decode->SIA32InstructionDescription.strOpcode,"test"))
		{
			/*
			 * layout of 0xF6 'test' instruction is violating the intergrity provided
			 * by the layout of opcode tables,
			 * so let's treat the 0xF6 opcode separately.
			 * we basically need to swap the operands
			 *
			 */
			strcpy(strTemp,pIA32Decode->SIA32InstructionDescription.strOperandA);
			strcpy(pIA32Decode->SIA32InstructionDescription.strOperandA,pIA32Decode->SIA32InstructionDescription.strOperandB);
			strcpy(pIA32Decode->SIA32InstructionDescription.strOperandB,strTemp);
		}			

	if(strchr(pIA32Decode->SIA32InstructionDescription.strOperandA,'/'))
	{
		pchr1 = pIA32Decode->SIA32InstructionDescription.strOperandB;
		while((*pchr1) && isupper(*pchr1))
			pchr1++;
		if(GetOperandTypeSize(pchr1) == 1)
		{
			pchr1 = strchr(pIA32Decode->SIA32InstructionDescription.strOperandA,'/');
			if(pchr1)
				*pchr1 = 0;
		}
		else
		{
			strcpy(strTemp,strchr(pIA32Decode->SIA32InstructionDescription.strOperandA,'/') + 1);
			strcpy(pIA32Decode->SIA32InstructionDescription.strOperandA,strTemp);
		}
	}
	if(strchr(pIA32Decode->SIA32InstructionDescription.strOperandB,'/'))
	{
		pchr1 = pIA32Decode->SIA32InstructionDescription.strOperandA;
		while((*pchr1) && isupper(*pchr1))
			pchr1++;
		if(GetOperandTypeSize(pchr1) == 1)
		{
			pchr1 = strchr(pIA32Decode->SIA32InstructionDescription.strOperandB,'/');
			if(pchr1)
				*pchr1 = 0;
		}
		else
		{
			strcpy(strTemp,strchr(pIA32Decode->SIA32InstructionDescription.strOperandB,'/') + 1);
			strcpy(pIA32Decode->SIA32InstructionDescription.strOperandB,strTemp);
		}
	}
	return 1;
};


int FetchInstructionFrom2ByteOpcodeTable(const unsigned char *pStart,IA32InstructionDecode *pIA32Decode)
{
	int iRow, iCol, i;
	InstructionTemplate *pInstructionTemplate;
	char *pchr1;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本一区二区免费在线| 日韩av电影免费观看高清完整版| 一区二区三区丝袜| 日韩不卡一区二区| 成人激情视频网站| 欧美一区二区三区的| 亚洲精品国产第一综合99久久 | 9191成人精品久久| 国产精品久久久久久久久图文区| 麻豆久久久久久久| 欧美日韩中文字幕精品| 国产精品人成在线观看免费| 久久爱另类一区二区小说| 色综合天天综合网天天看片| 国产欧美一区二区在线| 精品一区二区三区在线视频| 欧美日韩不卡一区| 亚洲资源中文字幕| 日本精品一区二区三区四区的功能| 国产午夜精品一区二区三区视频| 日产国产欧美视频一区精品| 欧美日韩高清一区二区三区| 亚洲欧美另类久久久精品2019| 成人国产电影网| 久久婷婷久久一区二区三区| 久色婷婷小香蕉久久| 91精品国产一区二区| 日韩有码一区二区三区| 91精品福利在线一区二区三区 | 国产99一区视频免费| 精品国产伦一区二区三区观看方式 | 亚洲欧美日韩电影| 一本大道综合伊人精品热热| 中文字幕综合网| 波多野结衣中文字幕一区| 国产精品动漫网站| 色综合视频一区二区三区高清| 国产精品三级在线观看| 91女人视频在线观看| 亚洲欧美区自拍先锋| 精品视频在线免费观看| 香蕉av福利精品导航| 欧美一区二区三区免费在线看| 精品一区二区日韩| 国产亚洲欧美日韩在线一区| 成人深夜福利app| 一区二区三区在线播放| 欧美日韩精品欧美日韩精品一综合| 亚洲第一福利一区| 日韩欧美久久一区| 国产91在线|亚洲| 亚洲免费在线电影| 91麻豆精品国产自产在线观看一区| 强制捆绑调教一区二区| 国产亚洲精久久久久久| 一本高清dvd不卡在线观看| 午夜精品福利一区二区蜜股av| 精品少妇一区二区三区免费观看 | 成人免费精品视频| 亚洲综合一二三区| 日韩一区二区免费电影| 成人av午夜电影| 午夜成人在线视频| 日本一区二区成人| 欧美精品三级在线观看| 国产成人av资源| 亚洲va欧美va人人爽午夜| 欧美大片国产精品| 91麻豆.com| 国内不卡的二区三区中文字幕| 中文字幕亚洲电影| 欧美成人伊人久久综合网| 99久久免费精品| 精品夜夜嗨av一区二区三区| 亚洲精品国产精华液| 亚洲精品一区二区三区香蕉| 色婷婷狠狠综合| 国产毛片精品一区| 日本一区中文字幕| 夜夜嗨av一区二区三区| 欧美精品一区二区三区在线播放| 91成人免费电影| 成人激情午夜影院| 国精产品一区一区三区mba视频| 一区二区欧美精品| 中文字幕电影一区| www成人在线观看| 欧美日本一区二区| 色狠狠桃花综合| www.亚洲人| 国产成人亚洲综合a∨婷婷| 老司机午夜精品99久久| 亚洲国产色一区| 亚洲欧美区自拍先锋| 欧美国产日韩亚洲一区| 精品福利av导航| 4hu四虎永久在线影院成人| 欧美在线一二三四区| 成人黄色小视频| 福利电影一区二区三区| 激情综合网最新| 久久99精品久久久久婷婷| 午夜a成v人精品| 亚洲成人免费电影| 亚洲va欧美va人人爽| 亚洲制服欧美中文字幕中文字幕| 国产精品国产自产拍高清av王其| 久久蜜桃av一区精品变态类天堂| 欧美成人一区二区三区| 91麻豆精品国产91久久久久久| 欧美日韩精品欧美日韩精品| 精品视频1区2区3区| 在线观看国产一区二区| 91成人看片片| 欧美日韩激情在线| 制服丝袜中文字幕一区| 欧美猛男gaygay网站| 欧美高清性hdvideosex| 91精品国产品国语在线不卡| 欧美高清你懂得| 日韩一区二区影院| 精品理论电影在线观看| 国产欧美一区二区三区在线看蜜臀| 久久精品一区二区| 中文字幕在线不卡国产视频| 亚洲三级在线观看| 亚洲国产精品一区二区尤物区| 午夜精品视频在线观看| 另类小说一区二区三区| 国产成人av一区| 在线免费视频一区二区| 欧美日韩大陆在线| 亚洲精品在线电影| 亚洲欧美综合另类在线卡通| 一区二区三国产精华液| 免费精品99久久国产综合精品| 国内精品在线播放| 91亚洲男人天堂| 欧美一区2区视频在线观看| 精品91自产拍在线观看一区| 国产精品高潮久久久久无| 亚洲韩国精品一区| 久久99热这里只有精品| 北条麻妃国产九九精品视频| 欧美亚洲一区二区在线观看| 精品欧美乱码久久久久久1区2区| 中文字幕+乱码+中文字幕一区| 一区av在线播放| 国产一区二区三区免费看| 色婷婷香蕉在线一区二区| 日韩一区二区精品葵司在线| 国产精品每日更新在线播放网址| 亚洲在线观看免费视频| 国产乱码字幕精品高清av | 国产精品66部| 欧美在线制服丝袜| 久久婷婷国产综合精品青草| 亚洲精品国产一区二区精华液| 精品在线观看免费| 在线精品亚洲一区二区不卡| 久久欧美一区二区| 午夜久久久影院| 91在线视频网址| 久久久久久久久久久久电影| 亚洲国产成人tv| 91在线丨porny丨国产| 久久综合久色欧美综合狠狠| 亚洲一区二区综合| 成人久久视频在线观看| 精品国精品国产| 性久久久久久久| 日本韩国欧美一区| 国产精品欧美精品| 久久国内精品自在自线400部| 欧美日韩在线亚洲一区蜜芽| 日本一区二区三区久久久久久久久不| 天天操天天综合网| 欧美中文字幕一二三区视频| 欧美韩国一区二区| 紧缚奴在线一区二区三区| 欧美日韩精品久久久| 一区二区三区在线免费视频 | 成人欧美一区二区三区视频网页 | 五月天网站亚洲| 91网站在线观看视频| 日本一区二区动态图| 国产一区二区视频在线| 精品美女一区二区三区| 美女任你摸久久| 欧美一区二区三区四区在线观看| 亚洲狠狠爱一区二区三区| 色综合久久天天| 亚洲人成在线播放网站岛国| 成人丝袜视频网| 国产精品三级电影| 成人免费观看av| 国产精品久久毛片| 91在线观看美女| 亚洲资源在线观看| 欧美日韩一区二区三区免费看 |