⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 arm2x86_test.c

📁 这是Skyeye 0.9 版本的源代码
💻 C
字号:
#include "armdefs.h"
#include "arm2x86_self.h"

uint8_t *
get_op_test_dataabort(int *len)
{
	unsigned int	begin=0,end=0;

	OP_BEGIN("get_op_test_dataabort");
	if (st->abortSig != LOW) {
		__asm__ __volatile__ ("jmp	0xffffffff");
	}
	OP_END("get_op_test_dataabort");
	*len = end - begin;

	return((uint8_t *)begin);
}

uint8_t *
get_op_test_dataabort_ret(int *len)
{
	unsigned int	begin=0,end=0;

	OP_BEGIN("get_op_test_dataabort_ret");
	if (st->abortSig != LOW) {
		__asm__ __volatile__ ("ret");
	}
	OP_END("get_op_test_dataabort_ret");
	*len = end - begin;

	return((uint8_t *)begin);
}

uint8_t *
get_op_test_cpsr_ret_UNP(int *len)
{
	unsigned int	begin=0,end=0;

	OP_BEGIN("get_op_test_cpsr_ret_UNP");
	T2 = st->Cpsr & 0x1f;
	if (T2 == 0x10 || T2 == 0x1f) {
		st->trap = TRAP_UNPREDICTABLE;
		__asm__ __volatile__ ("ret");
	}
	OP_END("get_op_test_cpsr_ret_UNP");
	*len = end - begin;

	return((uint8_t *)begin);
}

/*uint8_t *
get_op_test_debug(int *len)
{
	unsigned int	begin=0,end=0;

	OP_BEGIN("get_op_test_debug");
	T0 = st->Emulate;
	if (T0 == 0) {
		st->trap = TRAP_DEBUG;
		__asm__ __volatile__ ("ret");
	}
	OP_END("get_op_test_debug");
	*len = end - begin;

	return((uint8_t *)begin);
}*/

op_table_t	op_test_dataabort;
op_table_t	op_test_dataabort_ret;
op_table_t	op_test_cpsr_ret_UNP;
//op_table_t	op_test_debug;
int
arm2x86_test_init()
{
	op_test_dataabort.op = get_op_test_dataabort(&op_test_dataabort.len);
	if (op_test_dataabort.len <= 0)
		return(-1);

	op_test_dataabort_ret.op = get_op_test_dataabort_ret(&op_test_dataabort_ret.len);
	if (op_test_dataabort_ret.len <= 0)
		return(-1);

	op_test_cpsr_ret_UNP.op = get_op_test_cpsr_ret_UNP(&op_test_cpsr_ret_UNP.len);
	if (op_test_cpsr_ret_UNP.len <= 0)
		return(-1);

	/*op_test_debug.op = get_op_test_debug(&op_test_debug.len);
	if (op_test_debug.len <= 0)
		return(-1);*/

	return(0);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -