library/src/exploitation/ModularExploitation/BP-ModularExploitation.cc
// Create a new modular exploitation session
Create a new modular exploitation session
Create a new modular exploitation session
P_BP_MODULAR_EXPLOITATION_SESSION BP_CreateNewModularExploitationSession
(
		P_BP_MYSQL_CONN_POOL db_pool
)
{
	P_BP_MODULAR_EXPLOITATION_SESSION session = (P_BP_MODULAR_EXPLOITATION_SESSION) bpcalloc(sizeof(BP_MODULAR_EXPLOITATION_SESSION), 1);
	if(!session)
		return NULL;
	session->session_id = NEW_RANDOM_ID;
	session->tq = BP_CreateLinkL("BP Modular Exploitation Session Allocator", BP_FALSE);
	session->db_pool = db_pool;
	session->enabled_status = BP_MODULAR_EXPLOITATION_SESSION_ENABLED;
	session->run_status = BP_MODULAR_EXPLOITATION_SESSION_RUN_STATUS_STOPPED;
	sem_init(&session->session_lock, 0, 0);
	sem_init(&session->module_manipulation_lock, 0, 0);
	sem_init(&session->target_manipulation_lock, 0, 0);
	return session;
}
P_BP_MODULAR_EXPLOITATION_SESSION BP_CreateNewModularExploitationSession ( P_BP_MYSQL_CONN_POOL db_pool ) { P_BP_MODULAR_EXPLOITATION_SESSION session = ( P_BP_MODULAR_EXPLOITATION_SESSION ) bpcalloc ( sizeof ( BP_MODULAR_EXPLOITATION_SESSION ) , 1 ) ; if ( ! session ) return NULL ; session -> session_id = NEW_RANDOM_ID ; session -> tq = BP_CreateLinkL ( " " , BP_FALSE ) ; session -> db_pool = db_pool ; session -> enabled_status = BP_MODULAR_EXPLOITATION_SESSION_ENABLED ; session -> run_status = BP_MODULAR_EXPLOITATION_SESSION_RUN_STATUS_STOPPED ; sem_init ( & session -> session_lock , 0 , 0 ) ; sem_init ( & session -> module_manipulation_lock , 0 , 0 ) ; sem_init ( & session -> target_manipulation_lock , 0 , 0 ) ; return session ; }
Create a new modular exploitation session
Create a new modular exploitation session
// attempt to create a new session structure // ensure the memory was actually allocated // memory allocator identifier from random // create a new tail queue memory allocator // set the database pool // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%%%% Set Session Status to Defaults %%%%%%%%%%%%%%%%%%%%%%% // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // set default session status to enabled // set default run status to stopped // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%%%%% Initialize Session Semaphores %%%%%%%%%%%%%%%%%%%%%% // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // initialize session lock semaphore // initialize module manipulation lock // initialize target manipulation lock // return the newly allocated session