library/src/blockclass/BP-BlockClass.cc
// memory comparison
// on loop compares whats in cmpBuff to the process memory
// at procAddr, for cmpLen bytes.
memory comparison
on loop compares whats in cmpBuff to the process memory
at procAddr, for cmpLen bytes.
memory comparison on loop compares whats in cmpBuff to the process memory at procAddr for cmpLen bytes .
int Block::SetMemCondition(void *procAddr, void *cmpBuff, int cmpLen)
{
	if (dbgHandle == NULL)
		return ERR_FAILURE;
	if (dbgHandle->conditions == NULL)
	{
		AddConditionElement
		(
				dbgHandle, 0, 0, 
				0, 0, 0, 0, 
				0, 0, 0, 0, 
				0, 0, 0, 0, 
				0, 0, 0, 0, 
				0, 0, 0, 0, 
				0, 0, 0, 0, 
				0, 0, 0, 0, 
				0, 0, 0, 0, 
				1, procAddr, (unsigned char *) cmpBuff, cmpLen
		);
		return ERR_SUCCESS;
	}
	if (dbgHandle->conditions != NULL)
	{
		for
		(
				dbgHandle->conditions = dbgHandle->conditions->first;
				dbgHandle->conditions->next != NULL;
				dbgHandle->conditions = dbgHandle->conditions->next
		) {}
		if (dbgHandle->conditions->espSet > 0)
		{
			AddConditionElement
			(
					dbgHandle, 0, 0, 
					0, 0, 0, 0, 
					0, 0, 0, 0, 
					0, 0, 0, 0, 
					0, 0, 0, 0, 
					0, 0, 0, 0, 
					0, 0, 0, 0, 
					0, 0, 0, 0, 
					0, 0, 0, 0, 
					1, procAddr, (unsigned char *) cmpBuff, cmpLen
			);
			return ERR_SUCCESS;
		}
		else
		{
			dbgHandle->conditions->cmpSet = 1;
			dbgHandle->conditions->cmpBuff = (unsigned char *) cmpBuff;
			dbgHandle->conditions->cmpAddr = procAddr;
			dbgHandle->conditions->cmpLen = cmpLen;
		}
	}
	return ERR_SUCCESS;
}
int Block :: SetMemCondition ( void * procAddr , void * cmpBuff , int cmpLen ) { if ( dbgHandle == NULL ) return ERR_FAILURE ; if ( dbgHandle -> conditions == NULL ) { AddConditionElement ( dbgHandle , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , procAddr , ( unsigned char * ) cmpBuff , cmpLen ) ; return ERR_SUCCESS ; } if ( dbgHandle -> conditions != NULL ) { for ( dbgHandle -> conditions = dbgHandle -> conditions -> first ; dbgHandle -> conditions -> next != NULL ; dbgHandle -> conditions = dbgHandle -> conditions -> next ) { } if ( dbgHandle -> conditions -> espSet > 0 ) { AddConditionElement ( dbgHandle , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , procAddr , ( unsigned char * ) cmpBuff , cmpLen ) ; return ERR_SUCCESS ; } else { dbgHandle -> conditions -> cmpSet = 1 ; dbgHandle -> conditions -> cmpBuff = ( unsigned char * ) cmpBuff ; dbgHandle -> conditions -> cmpAddr = procAddr ; dbgHandle -> conditions -> cmpLen = cmpLen ; } } return ERR_SUCCESS ; }
memory comparison
on loop compares whats in cmpBuff to the process memory
at procAddr, for cmpLen bytes.
memory comparison on loop compares whats in cmpBuff to the process memory at procAddr for cmpLen bytes .
// check debug handle // first see if the conditions stucture is set // create a new one if not, and return // signal // eax // ebx // ecx // edx // esp, set condition // ebp // eip // esi // return indicating success // if a condition does exist, be sure that it hasn't // been set yet, if it has, create and append a new // condition to the list. // get the last element of the list first // conditions should now be set to the last element. // Evaluate the last conditions setability, if it is // already set, then create and append a new list. // signal // eax // ebx // ecx // edx // esp, set condition // ebp // eip // esi // return indicating success // if the condition is settable, set it in the // existing condition list element (saves space) // return indicating success