library/src/decoders/x86ASM/BP-x86InstDecode.cc
// Determines if the byte is a +rb etc instruction, string must be at least 2
// bytes long.
Determines if the byte is a +rb etc instruction, string must be at least 2
bytes long.
Determines if the byte is a + rb etc instruction string must be at least 2 bytes long .
int X86_32_IsBytePlusEncodedOpcode(unsigned char *opstr){
	if(opstr == NULL)
		return false;
	if(opstr[0] >= 0xb0 && opstr[0] < (0xb0+8)){
		return 0xB0;
	}
	if(opstr[0] >= 0xb8 && opstr[0] < (0xb8+8)){
		return 0xB8;
	}
	if(opstr[0] == 0x0f)
	if(opstr[1] >= 0xC8 && opstr[1] < (0xc8+8)){
		return 0xC8;
	}
	if(opstr[0] >= 0x48 && opstr[0] < (0x48+8)){
		return 0x48;
	}
	if(opstr[0] >= 0x40 && opstr[0] < (0x40+8)){
		return 0x40;
	}
	if(opstr[0] >= 0x58 && opstr[0] < (0x58+8)){
		return 0x58;
	}
	if(opstr[0] >= 0x50 && opstr[0] < (0x50+8)){
		return 0x50;
	}
	if(opstr[0] >= 0x90 && opstr[0] < (0x90+8)){
		return 0x90;
	}
	return 0;
}
int X86_32_IsBytePlusEncodedOpcode ( unsigned char * opstr ) { if ( opstr == NULL ) return false ; if ( opstr [ 0 ] >= 0xb0 && opstr [ 0 ] < ( 0xb0 + 8 ) ) { return 0xB0 ; } if ( opstr [ 0 ] >= 0xb8 && opstr [ 0 ] < ( 0xb8 + 8 ) ) { return 0xB8 ; } if ( opstr [ 0 ] == 0x0f ) if ( opstr [ 1 ] >= 0xC8 && opstr [ 1 ] < ( 0xc8 + 8 ) ) { return 0xC8 ; } if ( opstr [ 0 ] >= 0x48 && opstr [ 0 ] < ( 0x48 + 8 ) ) { return 0x48 ; } if ( opstr [ 0 ] >= 0x40 && opstr [ 0 ] < ( 0x40 + 8 ) ) { return 0x40 ; } if ( opstr [ 0 ] >= 0x58 && opstr [ 0 ] < ( 0x58 + 8 ) ) { return 0x58 ; } if ( opstr [ 0 ] >= 0x50 && opstr [ 0 ] < ( 0x50 + 8 ) ) { return 0x50 ; } if ( opstr [ 0 ] >= 0x90 && opstr [ 0 ] < ( 0x90 + 8 ) ) { return 0x90 ; } return 0 ; }
Determines if the byte is a +rb etc instruction, string must be at least 2
bytes long.
Determines if the byte is a + rb etc instruction string must be at least 2 bytes long .
// Database shows suprisingly 0 +ro instructions // if bug is found, investigate later. //  MOV + rb check // MOV + rw / rd check // BSWAP + rd check (requires first byte as simd 0f prefix) // DEC + rd check // INC + rd check // POP + rd check (also a 64 bit instructions) // PUSH + rd check // XCHG + rd check