library/src/exploitation/WebExploitation/SQLErrCodes/BP-WebExploitMsqlErrCodes.cc
// Generates an allocated array of Msql error codes
Generates an allocated array of Msql error codes
Generates an allocated array of Msql error codes
P_BP_MSQL_ERR_CODES BP_MsqlGenErrCodeArray(){
	size_t retSize = sizeof(msqlErrCodes);
	P_BP_MSQL_ERR_CODES retTable = (P_BP_MSQL_ERR_CODES) bpcalloc(retSize, 1);
	if(!retTable)
		return NULL;
	size_t x = 0;
	for(x = 0; ( sizeof(BP_MSQL_ERR_CODES) * x ) < sizeof(msqlErrCodes); x++)
	{
		memset((void *) &retTable[x], 0x00, sizeof(retTable[x]) );
		char *tmp_description = strdup(msqlErrCodes[x].description);
		char *tmp_err_num = strdup(msqlErrCodes[x].errNum);
		char *tmp_logged = strdup(msqlErrCodes[x].logged);
		char *tmp_severity = strdup(msqlErrCodes[x].severity);
		retTable[x].description = bpstrdup(tmp_description);
		retTable[x].errNum      = bpstrdup(tmp_err_num);
		retTable[x].logged      = bpstrdup(tmp_logged);
		retTable[x].severity    = bpstrdup(tmp_severity);
	}
	return retTable;
}
P_BP_MSQL_ERR_CODES BP_MsqlGenErrCodeArray ( ) { size_t retSize = sizeof ( msqlErrCodes ) ; P_BP_MSQL_ERR_CODES retTable = ( P_BP_MSQL_ERR_CODES ) bpcalloc ( retSize , 1 ) ; if ( ! retTable ) return NULL ; size_t x = 0 ; for ( x = 0 ; ( sizeof ( BP_MSQL_ERR_CODES ) * x ) < sizeof ( msqlErrCodes ) ; x ++ ) { memset ( ( void * ) & retTable [ x ] , 0x00 , sizeof ( retTable [ x ] ) ) ; char * tmp_description = strdup ( msqlErrCodes [ x ] . description ) ; char * tmp_err_num = strdup ( msqlErrCodes [ x ] . errNum ) ; char * tmp_logged = strdup ( msqlErrCodes [ x ] . logged ) ; char * tmp_severity = strdup ( msqlErrCodes [ x ] . severity ) ; retTable [ x ] . description = bpstrdup ( tmp_description ) ; retTable [ x ] . errNum = bpstrdup ( tmp_err_num ) ; retTable [ x ] . logged = bpstrdup ( tmp_logged ) ; retTable [ x ] . severity = bpstrdup ( tmp_severity ) ; } return retTable ; }
Generates an allocated array of Msql error codes
Generates an allocated array of Msql error codes
// duplicate the array // zero out the  table before filling in values