Ejemplo n.º 1
0
Archivo: disas.c Proyecto: JaonLin/pemu
int helper_pemu_trace(target_ulong pc)
{
		
		target_ulong target;
		xed_error_enum_t xed_error = disas_one_inst(pc);

		if(xed_error != XED_ERROR_NONE){
			return -1;
		}

		const xed_inst_t * xi = xed_decoded_inst_inst(&xedd_g);
		xed_iclass_enum_t opcode = xed_decoded_inst_get_iclass(&xedd_g);

	//	char inst_str[512];
	//	xed_decoded_inst_dump_intel_format(&xedd_g, inst_str, 
	//		   sizeof(inst_str), 0);	
		switch(opcode){
			case XED_ICLASS_JMP:
				target = Instrument_JMP(xi, pc);
				break;
			case XED_ICLASS_CALL_NEAR:
				target = Instrument_CALL_NEAR(xi,pc);
				break;
			case XED_ICLASS_RET_NEAR:
				target = Instrument_RET(xi);
				break;
			default:
				break;
		}
		PEMU_add_trace(target);
		return 0;
}
Ejemplo n.º 2
0
void helper_call_handler(target_ulong pc)
{
	//printf("%x %x\n", pc, Instrument_CALL_NEAR(pc));
	if(pc > 0xc0000000) {
		recover_sem_types(Instrument_CALL_NEAR(pc));
	}
}
Ejemplo n.º 3
0
void helper_call_handler1(target_ulong pc)
{
	if(pc > 0xc0000000) {
		add_call_dst(Instrument_CALL_NEAR(pc));
	}
}