library/src/exploitation/Utilities/BP-Gadgets.cc
// BP_GADGET_TYPE to heap alloc string.
BP_GADGET_TYPE to heap alloc string.
BP_GADGET_TYPE to heap alloc string .
char * BP_GetGadgetType(BP_GADGET_TYPE type, P_BP_LINKL tq)
{
	switch(type)
	{
		case BP_GADGET_TYPE_UNSET:
			return tq ? tq_strdup(tq, "BP_GADGET_TYPE_UNSET", BPLN) :  bpstrdup("BP_GADGET_TYPE_UNSET");
			break;
		case BP_GADGET_TYPE_OBFUSCATOR:
			return tq ? tq_strdup(tq, "BP_GADGET_TYPE_OBFUSCATOR", BPLN) :  bpstrdup("BP_GADGET_TYPE_OBFUSCATOR");
			break;
		case BP_GADGET_TYPE_OUTPUT_MAPPER:
			return tq ? tq_strdup(tq, "BP_GADGET_TYPE_OUTPUT_MAPPER", BPLN) :  bpstrdup("BP_GADGET_TYPE_OUTPUT_MAPPER");
			break;
		case BP_GADGET_TYPE_SYSTEM_INFO:
			return tq ? tq_strdup(tq, "BP_GADGET_TYPE_SYSTEM_INFO", BPLN) :  bpstrdup("BP_GADGET_TYPE_SYSTEM_INFO");
			break;
		case BP_GADGET_TYPE_PERMISSION_DETERMINATION:
			return tq ? tq_strdup(tq, "BP_GADGET_TYPE_PERMISSION_DETERMINATION", BPLN) :  bpstrdup("BP_GADGET_TYPE_PERMISSION_DETERMINATION");
			break;
		case BP_GADGET_TYPE_DOWNLOAD_AND_EXECUTE:
			return tq ? tq_strdup(tq, "BP_GADGET_TYPE_DOWNLOAD_AND_EXECUTE", BPLN) :  bpstrdup("BP_GADGET_TYPE_DOWNLOAD_AND_EXECUTE");
			break;
		case BP_GADGET_TYPE_TROJAN_FILE:
			return tq ? tq_strdup(tq, "BP_GADGET_TYPE_TROJAN_FILE", BPLN) :  bpstrdup("BP_GADGET_TYPE_TROJAN_FILE");
			break;
		case BP_GADGET_TYPE_INTERACTIVE_SYSTEM_SHELL:
			return tq ? tq_strdup(tq, "BP_GADGET_TYPE_INTERACTIVE_SYSTEM_SHELL", BPLN) :  bpstrdup("BP_GADGET_TYPE_INTERACTIVE_SYSTEM_SHELL");
			break;
		case BP_GADGET_TYPE_INTERACTIVE_LANGUAGE_SHELL:
			return tq ? tq_strdup(tq, "BP_GADGET_TYPE_INTERACTIVE_LANGUAGE_SHELL", BPLN) :  bpstrdup("BP_GADGET_TYPE_INTERACTIVE_LANGUAGE_SHELL");
			break;
		case BP_GADGET_TYPE_DATABASE_INFO:
			return tq ? tq_strdup(tq, "BP_GADGET_TYPE_DATABASE_INFO", BPLN) :  bpstrdup("BP_GADGET_TYPE_DATABASE_INFO");
			break;
		case BP_GADGET_TYPE_DATABASE_DUMP:
			return tq ? tq_strdup(tq, "BP_GADGET_TYPE_DATABASE_DUMP", BPLN) :  bpstrdup("BP_GADGET_TYPE_DATABASE_DUMP");
			break;
		case BP_GADGET_TYPE_DATABASE_ANALYSIS:
			return tq ? tq_strdup(tq, "BP_GADGET_TYPE_DATABASE_ANALYSIS", BPLN) :  bpstrdup("BP_GADGET_TYPE_DATABASE_ANALYSIS");
			break;
		default:
			return NULL;
	}
	return NULL;
}
char * BP_GetGadgetType ( BP_GADGET_TYPE type , P_BP_LINKL tq ) { switch ( type ) { case BP_GADGET_TYPE_UNSET : return tq ? tq_strdup ( tq , " " , BPLN ) : bpstrdup ( " " ) ; break ; case BP_GADGET_TYPE_OBFUSCATOR : return tq ? tq_strdup ( tq , " " , BPLN ) : bpstrdup ( " " ) ; break ; case BP_GADGET_TYPE_OUTPUT_MAPPER : return tq ? tq_strdup ( tq , " " , BPLN ) : bpstrdup ( " " ) ; break ; case BP_GADGET_TYPE_SYSTEM_INFO : return tq ? tq_strdup ( tq , " " , BPLN ) : bpstrdup ( " " ) ; break ; case BP_GADGET_TYPE_PERMISSION_DETERMINATION : return tq ? tq_strdup ( tq , " " , BPLN ) : bpstrdup ( " " ) ; break ; case BP_GADGET_TYPE_DOWNLOAD_AND_EXECUTE : return tq ? tq_strdup ( tq , " " , BPLN ) : bpstrdup ( " " ) ; break ; case BP_GADGET_TYPE_TROJAN_FILE : return tq ? tq_strdup ( tq , " " , BPLN ) : bpstrdup ( " " ) ; break ; case BP_GADGET_TYPE_INTERACTIVE_SYSTEM_SHELL : return tq ? tq_strdup ( tq , " " , BPLN ) : bpstrdup ( " " ) ; break ; case BP_GADGET_TYPE_INTERACTIVE_LANGUAGE_SHELL : return tq ? tq_strdup ( tq , " " , BPLN ) : bpstrdup ( " " ) ; break ; case BP_GADGET_TYPE_DATABASE_INFO : return tq ? tq_strdup ( tq , " " , BPLN ) : bpstrdup ( " " ) ; break ; case BP_GADGET_TYPE_DATABASE_DUMP : return tq ? tq_strdup ( tq , " " , BPLN ) : bpstrdup ( " " ) ; break ; case BP_GADGET_TYPE_DATABASE_ANALYSIS : return tq ? tq_strdup ( tq , " " , BPLN ) : bpstrdup ( " " ) ; break ; default : return NULL ; } return NULL ; }
BP_GADGET_TYPE to heap alloc string.
BP_GADGET_TYPE to heap alloc string .
// return null as default case // should never get here