library/src/exploitation/Utilities/BP-Gadgets.cc
// BP_GADGET_CAGETORY to heap alloc string.
BP_GADGET_CAGETORY to heap alloc string.
BP_GADGET_CAGETORY to heap alloc string .
char * BP_GetGadgetCategory(BP_GADGET_CAGETORY category, P_BP_LINKL tq)
{
	switch(category)
	{
		case BP_GADGET_CATEGORY_UNSET:
			return tq ? tq_strdup(tq, "BP_GADGET_CATEGORY_UNSET", BPLN) : bpstrdup("BP_GADGET_CATEGORY_UNSET");
			break;
		case BP_GADGET_CATEGORY_LOADER:
			return tq ? tq_strdup(tq, "BP_GADGET_CATEGORY_LOADER", BPLN) :  bpstrdup("BP_GADGET_CATEGORY_LOADER");
			break;
		case BP_GADGET_CATEGORY_MAPPER:
			return tq ? tq_strdup(tq, "BP_GADGET_CATEGORY_MAPPER", BPLN) :  bpstrdup("BP_GADGET_CATEGORY_MAPPER");
			break;
		case BP_GADGET_CATEGORY_WRITER:
			return tq ? tq_strdup(tq, "BP_GADGET_CATEGORY_WRITER", BPLN) :  bpstrdup("BP_GADGET_CATEGORY_WRITER");
			break;
		case BP_GADGET_CATEGORY_BACKDOOR:
			return tq ? tq_strdup(tq, "BP_GADGET_CATEGORY_BACKDOOR", BPLN) :  bpstrdup("BP_GADGET_CATEGORY_BACKDOOR");
			break;
		default:
			return NULL;
	}
	return NULL;
}
char * BP_GetGadgetCategory ( BP_GADGET_CAGETORY category , P_BP_LINKL tq ) { switch ( category ) { case BP_GADGET_CATEGORY_UNSET : return tq ? tq_strdup ( tq , " " , BPLN ) : bpstrdup ( " " ) ; break ; case BP_GADGET_CATEGORY_LOADER : return tq ? tq_strdup ( tq , " " , BPLN ) : bpstrdup ( " " ) ; break ; case BP_GADGET_CATEGORY_MAPPER : return tq ? tq_strdup ( tq , " " , BPLN ) : bpstrdup ( " " ) ; break ; case BP_GADGET_CATEGORY_WRITER : return tq ? tq_strdup ( tq , " " , BPLN ) : bpstrdup ( " " ) ; break ; case BP_GADGET_CATEGORY_BACKDOOR : return tq ? tq_strdup ( tq , " " , BPLN ) : bpstrdup ( " " ) ; break ; default : return NULL ; } return NULL ; }
BP_GADGET_CAGETORY to heap alloc string.
BP_GADGET_CAGETORY to heap alloc string .
// Switch based on the category value, fail if lookup fails // return null in the case of lookup failure