library/src/blockclass/BP-BlockClass.cc
// prints out printLen bytes of memory from the process starting
// at void *processAddr 0x.08 style
prints out printLen bytes of memory from the process starting
at void *processAddr 0x.08 style
prints out printLen bytes of memory from the process starting at void * processAddr 0x . 08 style
int Block::DbgPrintMem(void *processAddr, int printLen)
{
	if (processAddr == NULL)
		return ERR_FAILURE;
	if (printLen == 0)
		return ERR_FAILURE;
	printf("\n Trying to read from %p", processAddr);
	unsigned char * memRead = DbgReadMemory(processAddr, printLen);
	if (memRead == NULL)
		return ERR_FAILURE;
	printf("\n memRead returned :%p\n", memRead);
	int i = 0;
	int x = 0;
	size_t tempMem = 0;
	for (printLen = printLen / 4; printLen > 0; printLen--)
	{
		if (i == 6)
		{
			printf("\n");
			i = 0;
		}
		memcpy(&tempMem, &memRead[x], 4);
		printf("0x%.08x ", tempMem);
		x += 4;
		i++;
		tempMem = 0;
	}
	return ERR_SUCCESS;
}
int Block :: DbgPrintMem ( void * processAddr , int printLen ) { if ( processAddr == NULL ) return ERR_FAILURE ; if ( printLen == 0 ) return ERR_FAILURE ; printf ( " \n " , processAddr ) ; unsigned char * memRead = DbgReadMemory ( processAddr , printLen ) ; if ( memRead == NULL ) return ERR_FAILURE ; printf ( " \n \n " , memRead ) ; int i = 0 ; int x = 0 ; size_t tempMem = 0 ; for ( printLen = printLen / 4 ; printLen > 0 ; printLen -- ) { if ( i == 6 ) { printf ( " \n " ) ; i = 0 ; } memcpy ( & tempMem , & memRead [ x ] , 4 ) ; printf ( " " , tempMem ) ; x += 4 ; i ++ ; tempMem = 0 ; } return ERR_SUCCESS ; }
prints out printLen bytes of memory from the process starting
at void *processAddr 0x.08 style
prints out printLen bytes of memory from the process starting at void * processAddr 0x . 08 style
// return indicating success