library/src/blockclass/BP-BlockClass.cc
int Block::SetMemCondition(void *procAddr, void *cmpBuff, int cmpLen)
{

	// check debug handle
	if (dbgHandle == NULL)
		return ERR_FAILURE;

	// first see if the conditions stucture is set
	// create a new one if not, and return
	if (dbgHandle->conditions == NULL)
	{

		AddConditionElement
		(
				dbgHandle, 0, 0, // signal
				0, 0, 0, 0, // eax
				0, 0, 0, 0, // ebx
				0, 0, 0, 0, // ecx
				0, 0, 0, 0, // edx
				0, 0, 0, 0, // esp, set condition
				0, 0, 0, 0, // ebp
				0, 0, 0, 0, // eip
				0, 0, 0, 0, // esi
				1, procAddr, (unsigned char *) cmpBuff, cmpLen
		);

		// return indicating success
		return ERR_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.
	if (dbgHandle->conditions != NULL)
	{

		// get the last element of the list first
		for
		(
				dbgHandle->conditions = dbgHandle->conditions->first;
				dbgHandle->conditions->next != NULL;
				dbgHandle->conditions = dbgHandle->conditions->next
		) {}

		// 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.

		if (dbgHandle->conditions->espSet > 0)
		{

			AddConditionElement
			(
					dbgHandle, 0, 0, // signal
					0, 0, 0, 0, // eax
					0, 0, 0, 0, // ebx
					0, 0, 0, 0, // ecx
					0, 0, 0, 0, // edx
					0, 0, 0, 0, // esp, set condition
					0, 0, 0, 0, // ebp
					0, 0, 0, 0, // eip
					0, 0, 0, 0, // esi
					1, procAddr, (unsigned char *) cmpBuff, cmpLen
			);

			// return indicating success
			return ERR_SUCCESS;

		}
		else
		{

			// if the condition is settable, set it in the
			// existing condition list element (saves space)
			dbgHandle->conditions->cmpSet = 1;
			dbgHandle->conditions->cmpBuff = (unsigned char *) cmpBuff;
			dbgHandle->conditions->cmpAddr = procAddr;
			dbgHandle->conditions->cmpLen = cmpLen;
		}

	}

	// return indicating success
	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.
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