diff --git a/src/def.h b/src/def.h index ca5daa3..644fae4 100644 --- a/src/def.h +++ b/src/def.h @@ -1,7 +1,7 @@ #pragma once #include #define PAYLOAD_TIME 10 -#define AUDIO_NUM 5 +#define AUDIO_NUM 10 typedef union _RGBQUAD { COLORREF rgb; struct { diff --git a/src/main.cpp b/src/main.cpp index a9ae7d3..12cec62 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -15,11 +15,16 @@ int WinMain( ) { AUDIO_SEQUENCE_PARAMS pAudioSequences[AUDIO_NUM] = {0}; - pAudioSequences[0] = { 8000, 8000 * PAYLOAD_TIME, AudioSequence1}; - pAudioSequences[1] = { 8000, 8000 * PAYLOAD_TIME, AudioSequence2}; - pAudioSequences[2] = { 8000, 8000 * PAYLOAD_TIME, AudioSequence3}; - pAudioSequences[3] = { 8000, 8000 * PAYLOAD_TIME, AudioSequence4}; - pAudioSequences[4] = { 8000, 8000 * PAYLOAD_TIME, AudioSequence5}; + pAudioSequences[0] = { 8000, 8000 * PAYLOAD_TIME, AudioSequence1 }; + pAudioSequences[1] = { 8000, 8000 * PAYLOAD_TIME, AudioSequence2 }; + pAudioSequences[2] = { 8000, 8000 * PAYLOAD_TIME, AudioSequence3 }; + pAudioSequences[3] = { 8000, 8000 * PAYLOAD_TIME, AudioSequence4 }; + pAudioSequences[4] = { 8000, 8000 * PAYLOAD_TIME, AudioSequence5 }; + pAudioSequences[5] = { 8000, 8000 * PAYLOAD_TIME, AudioSequence6 }; + pAudioSequences[6] = { 8000, 8000 * PAYLOAD_TIME, AudioSequence7 }; + pAudioSequences[7] = { 8000, 8000 * PAYLOAD_TIME, AudioSequence8 }; + pAudioSequences[8] = { 8000, 8000 * PAYLOAD_TIME, AudioSequence9 }; + pAudioSequences[9] = { 8000, 8000 * PAYLOAD_TIME, AudioSequence10 }; SeedXorshift32((DWORD)__rdtsc()); diff --git a/src/payloads.cpp b/src/payloads.cpp index 5153b89..b2c199e 100644 --- a/src/payloads.cpp +++ b/src/payloads.cpp @@ -123,6 +123,42 @@ void AudioSequence5(int nSamplesPerSec, int nSampleCount, PSHORT psSamples) { ((BYTE*)psSamples)[t] = bFreq; } } + +void AudioSequence6(int nSamplesPerSec, int nSampleCount, PSHORT psSamples) { + for (INT t = 0; t < nSampleCount * 2; t++) { + BYTE bFreq = (BYTE)(t >> 5 | (t >> 2) * (t >> 5)); + ((BYTE*)psSamples)[t] = bFreq; + } +} + +void AudioSequence7(int nSamplesPerSec, int nSampleCount, PSHORT psSamples) { + for (INT t = 0; t < nSampleCount * 2; t++) { + BYTE bFreq = (BYTE)(100 * ((t << 2 | t >> 5 | t ^ 63) & (t << 10 | t >> 11))); + ((BYTE*)psSamples)[t] = bFreq; + } +} + +void AudioSequence8(int nSamplesPerSec, int nSampleCount, PSHORT psSamples) { + for (INT t = 0; t < nSampleCount * 2; t++) { + BYTE bFreq = (BYTE)(t / 8 >> (t >> 9) * t / ((t >> 14 & 3) + 4)); + ((BYTE*)psSamples)[t] = bFreq; + } +} + +void AudioSequence9(int nSamplesPerSec, int nSampleCount, PSHORT psSamples) { + for (INT t = 0; t < nSampleCount * 2; t++) { + BYTE bFreq = (BYTE)(10 * (t & 5 * t | t >> 6 | (t & 32768 ? -6 * t / 7 : (t & 65536 ? -9 * t & 100 : -9 * (t & 100)) / 11))); + ((BYTE*)psSamples)[t] = bFreq; + } +} + +void AudioSequence10(int nSamplesPerSec, int nSampleCount, PSHORT psSamples) { + for (INT t = 0; t < nSampleCount * 2; t++) { + BYTE bFreq = (BYTE)(10 * (t >> 7 | 3 * t | t >> (t >> 15)) + (t >> 8 & 5)); + ((BYTE*)psSamples)[t] = bFreq; + } +} + void ExecutePayload(TROJAN_PAYLOAD payload, int nTime) { int dwStartTime = Time; for (int i = 0; Time < (dwStartTime + nTime); i++) { @@ -186,10 +222,10 @@ void Payload4(int t, HDC hdcScreen) { blf.AlphaFormat = 0; AlphaBlend(hdcScreen, ptScreen.x + t % 200 + 10, ptScreen.y - t % 25, szScreen.cx, szScreen.cy, hcdc, ptScreen.x, ptScreen.y, szScreen.cx, szScreen.cy, blf); - + DeleteObject(hcdc); DeleteObject(hBitmap); - + Sleep(20); } @@ -258,7 +294,7 @@ void Payload7(int t, HDC hdcScreen) { SetTextColor(hdcScreen, RGB(random() % 256, random() % 256, random() % 256)); TextOut(hdcScreen, random() % szScreen.cx, random() % szScreen.cy, L"HYDROGEN", 8); - + AlphaBlend(hdcScreen, 0, 0, szScreen.cx, szScreen.cy, hcdc, 0, 0, szScreen.cx, szScreen.cy, blf); DeleteObject(hcdc); diff --git a/src/payloads.h b/src/payloads.h index ead510d..ab730ab 100644 --- a/src/payloads.h +++ b/src/payloads.h @@ -27,6 +27,11 @@ extern void AudioSequence2(int nSamplesPerSec, int nSampleCount, PSHORT psSample extern void AudioSequence3(int nSamplesPerSec, int nSampleCount, PSHORT psSamples); extern void AudioSequence4(int nSamplesPerSec, int nSampleCount, PSHORT psSamples); extern void AudioSequence5(int nSamplesPerSec, int nSampleCount, PSHORT psSamples); +extern void AudioSequence6(int nSamplesPerSec, int nSampleCount, PSHORT psSamples); +extern void AudioSequence7(int nSamplesPerSec, int nSampleCount, PSHORT psSamples); +extern void AudioSequence8(int nSamplesPerSec, int nSampleCount, PSHORT psSamples); +extern void AudioSequence9(int nSamplesPerSec, int nSampleCount, PSHORT psSamples); +extern void AudioSequence10(int nSamplesPerSec, int nSampleCount, PSHORT psSamples); extern void Payload1(int t, HDC hdcScreen); extern void Payload2(int t, HDC hdcScreen);