library/src/decoders/x86ASM/BP-x86InstDecode.cc
// Retrieves list of instruction elements (instructions) given a start
// and end address.  __No list pointers are set for this element.__
Retrieves list of instruction elements (instructions) given a start
and end address.  __No list pointers are set for this element.
Retrieves list of instruction elements ( instructions ) given a start and end address . __No list pointers are set for this element .
P_X86_32_DECODED_INSTRUCTION_LIST X86_32_GetInstructionsFromMem(P_DEBUG_HANDLE dbgHandle, P_X86_32_INSTRUCTION instTable, void *start, void *top){
	if(dbgHandle == NULL)
		return NULL;
	if(top == NULL)
		return NULL;
	if(start == NULL)
		return NULL;
	if(top <= start)
		return NULL;
	unsigned char * binaryBlob = NULL;
	binaryBlob = DebugReadMemory(dbgHandle, start, (size_t) top - (size_t) start);
	printf("\n undecoded read: %.02x %.02x %.02x %.02x", binaryBlob[0], binaryBlob[1], binaryBlob[2], binaryBlob[3]);
	if(binaryBlob == NULL)
		return NULL;
	int prefixMatch = 0;
	int opcodeMatch = 0;
	unsigned char rPlusEncoded = 0;
	size_t instLength = 0;
	size_t instPosition = 0;
	P_X86_32_INSTRUCTION tableFirst = instTable;
	end:
	if(instTable->dstOperand != NULL){
	}
	if(instTable->srcOperand != NULL){
	}
	return NULL;
}
P_X86_32_DECODED_INSTRUCTION_LIST X86_32_GetInstructionsFromMem ( P_DEBUG_HANDLE dbgHandle , P_X86_32_INSTRUCTION instTable , void * start , void * top ) { if ( dbgHandle == NULL ) return NULL ; if ( top == NULL ) return NULL ; if ( start == NULL ) return NULL ; if ( top <= start ) return NULL ; unsigned char * binaryBlob = NULL ; binaryBlob = DebugReadMemory ( dbgHandle , start , ( size_t ) top - ( size_t ) start ) ; printf ( " \n " , binaryBlob [ 0 ] , binaryBlob [ 1 ] , binaryBlob [ 2 ] , binaryBlob [ 3 ] ) ; if ( binaryBlob == NULL ) return NULL ; int prefixMatch = 0 ; int opcodeMatch = 0 ; unsigned char rPlusEncoded = 0 ; size_t instLength = 0 ; size_t instPosition = 0 ; P_X86_32_INSTRUCTION tableFirst = instTable ; end : if ( instTable -> dstOperand != NULL ) { } if ( instTable -> srcOperand != NULL ) { } return NULL ; }
Retrieves list of instruction elements (instructions) given a start
and end address.
Retrieves list of instruction elements ( instructions ) given a start and end address .
// Read in the bytes to decode // detach immediately and trace process so we can attach // ptrace(PT_DETACH, dbgHandle->debugPid, 0, 0); // printf("\n wtf: %i", dbgHandle->debugPid); // 1 if it matches, -1 if its borked/invalid, 0 if there is no prefix // 1 if it matches, -1 if its invalid, // 1 if it matches, 0 if there is no encoding of rPlus instructions // Instruction Vars // Exit Label // printf(" %s ", instTable->dstOperand); // printf(" %s ", instTable->dstOperand);