library/src/buffer_analysis/ASCII/BP-BufferAnalysisASCII.cc
// Marks the strings.marked_as_restricted marker with the value of mark_restricted_status based
// on the provided flags, and the match how setting.
Marks the strings.marked_as_restricted marker with the value of mark_restricted_status based
on the provided flags, and the match how setting.
Marks the strings . marked_as_restricted marker with the value of mark_restricted_status based on the provided flags and the match how setting .
BP_ERROR_T BP_MarkRestrictedOnExtractedStrings
(
	P_BP_BUFFER_ANALYSIS                    buff_analysis,
	BP_BOOL                                 mark_restricted_status,
	P_BP_BUFFER_ANALYSIS_ASCII_STRING_FLAGS flags_match,
	BP_ASCII_STRING_SEARCH_FLAG_VALUES      flags_match_how
)
{
	if(!buff_analysis)
		return ERR_FAILURE;
	if(!buff_analysis->ascii)
		return ERR_FAILURE;
	if(!buff_analysis->ascii->strings || !buff_analysis->ascii->string_n)
		return ERR_FAILURE;
	BP_FLAGS_T match_flags = 0;
	size_t n = 0;
	for(; n < buff_analysis->ascii->string_n; n++)
	{
		if(!flags_match)
		{
			buff_analysis->ascii->strings[n].marked_as_restricted = mark_restricted_status;
			continue;
		}
		match_flags = BP_CompareASCIIStringFlags(flags_match, &buff_analysis->ascii->strings[n].string_flags);
		if(BP_FLAG_IS_SET(match_flags, flags_match_how))
		{
			buff_analysis->ascii->strings[n].marked_as_restricted = mark_restricted_status;
		}
		match_flags = 0;
	}
	return ERR_SUCCESS;
}
BP_ERROR_T BP_MarkRestrictedOnExtractedStrings ( P_BP_BUFFER_ANALYSIS buff_analysis , BP_BOOL mark_restricted_status , P_BP_BUFFER_ANALYSIS_ASCII_STRING_FLAGS flags_match , BP_ASCII_STRING_SEARCH_FLAG_VALUES flags_match_how ) { if ( ! buff_analysis ) return ERR_FAILURE ; if ( ! buff_analysis -> ascii ) return ERR_FAILURE ; if ( ! buff_analysis -> ascii -> strings || ! buff_analysis -> ascii -> string_n ) return ERR_FAILURE ; BP_FLAGS_T match_flags = 0 ; size_t n = 0 ; for ( ; n < buff_analysis -> ascii -> string_n ; n ++ ) { if ( ! flags_match ) { buff_analysis -> ascii -> strings [ n ] . marked_as_restricted = mark_restricted_status ; continue ; } match_flags = BP_CompareASCIIStringFlags ( flags_match , & buff_analysis -> ascii -> strings [ n ] . string_flags ) ; if ( BP_FLAG_IS_SET ( match_flags , flags_match_how ) ) { buff_analysis -> ascii -> strings [ n ] . marked_as_restricted = mark_restricted_status ; } match_flags = 0 ; } return ERR_SUCCESS ; }
Marks the strings.marked_as_restricted marker with the value of mark_restricted_status based
on the provided flags, and the match how setting.
Marks the strings . marked_as_restricted marker with the value of mark_restricted_status based on the provided flags and the match how setting .
// ensure we have an analysis buffer and an extracted strings count // match flags set, set dynamically below // if we're marking all, just go ahead and do it // compute the match flags // BP_DisplayASCIIStringMatchFlags(match_flags); // mark restricted here // reset flags // return indicating success