how to use this C / C++ source?

I use a bruteforcer (ncrack + visual c++) and someone told me to use this code to open more threads,this is the code,i don't know how to use it can someone show me the steps,please?where do i Paste this code?many many thanksssss
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include "stdafx.h"

#define _MT
#include <windows.h>
#include <process.h>    /* _beginthread, _endthread */
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>

#pragma comment(lib, "user32.lib")
#pragma comment(lib, "libcmt.lib")
#pragma comment(linker, "/NODEFAULTLIB:libcd.lib")

 

void ThreadFunction1(void *ch);
void ThreadFunction2(void *dummy);
 

 
BOOL repeat = TRUE;     /* Global repeat flag  */
 
int main(){
	printf("\nMultithreading with two threads.\n\n");
	printf("Thread Function 2  listens for key strokes. \n");
	printf("Thread Function 1  does all the other work \n");
	printf("  \n");
	CHAR    ch = 'A';
 

	/* Launch ThreadFunction2 thread to check for terminating keystroke. */
	_beginthread(ThreadFunction2, 0, NULL);
 
	/* Loop until ThreadFunction2 terminates program. */
	while (repeat){
		/* On first loops, launch character threads. */
		_beginthread(ThreadFunction1, 0, (void *)(ch++));
 
		/* Wait one second between loops. */
		Sleep(1000L);
	}
 
	printf("  \n");
	return 0;
}
 
/* ThreadFunction2 - Thread to wait for a keystroke, then end program. */
void ThreadFunction2(void *dummy){
	_getch();
	repeat = 0;    /* _endthread implied */
 
}
 

/* ThreadFunction2 - Thread to do work */
void ThreadFunction1(void *ch){
 
	while (repeat){
 
		/* Pause between loops. */
		Sleep(100L);
 
	}
	/* _endthread given to terminate */
	_endthread();
}
Last edited on
Topic archived. No new replies allowed.